feat: return ArrayBuffer from downloadFile - #197
Conversation
|
Warning Review limit reachedNext included review available in 32 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (25)
📒 Files selected for processing (14)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe download API adds an optional output mode for file or ArrayBuffer results. Android and iOS implement ArrayBuffer downloads through memory-mapped files. TypeScript declarations, documentation, examples, and type tests reflect the new result union. ChangesDownload output selection
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to This change adds an opt-in ArrayBuffer download result while preserving the default file-metadata behavior. No actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Client
participant NitroFS
participant PlatformDownloader
participant FileSystem
participant ArrayBuffer
Client->>NitroFS: downloadFile(options)
NitroFS->>PlatformDownloader: download with output mode
PlatformDownloader->>FileSystem: save downloaded file
alt output is arrayBuffer
PlatformDownloader->>ArrayBuffer: map saved file
ArrayBuffer-->>PlatformDownloader: ArrayBuffer result
else output is file or unset
FileSystem-->>PlatformDownloader: NitroFile result
end
PlatformDownloader-->>NitroFS: NitroDownloadResult
NitroFS-->>Client: Promise result
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 5.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 12 files. (2 skipped: 2 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
2bcb2d1 to
6b5b5f5
Compare
6b5b5f5 to
f86f74d
Compare
Summary
output?: 'file' | 'arrayBuffer'toNitroDownloadOptionsdownloadFileto returnPromise<NitroFile | ArrayBuffer>NitroFileArrayBufferforoutput: 'arrayBuffer'by memory-mapping the saved file on iOS and AndroidNew usage
Default usage still returns file metadata:
Verification
rtk bunx nitrogen --logLevel="debug"rtk node post-script.jsrtk proxy git diff --checkrtk bun run typecheckrtk bun run buildNative build notes
xcodebuildfailed before reaching NitroFS because ReactCodegen generated files were missing underexample/ios/build/generated/ios/ReactCodegen.