feat!: add modular resource fetcher adapters for Expo and bare React Native#759
Conversation
|
Lint CI fails (you don't need to worry about the second failing CI ;)). Please could you fix the errors from this CI? |
|
@msluszniak I’m not able to reproduce the lint CI failure locally — everything passes on my side. I’ll take a closer look and investigate further to see what might be causing the discrepancy (environment, cache, or config differences). I’ll follow up with a fix or more details as soon as I find the root cause.
|
|
@rizalibnu Sure thing, maybe the configuration of the CI itself does not work with as it should. We'll also look at this, don't worry :) |
|
@msluszniak Found the issue 👍 Fixed by adding a build step before adapter type checks and bumped Node to 22 in |
72914c0 to
359427b
Compare
|
Also I think that adding these changes will make section |
|
Hi, I worked a bit with this PR by building bare react native app. From what I've tested I didn't get a single issue with the bare resource fetcher and the integration was also very smooth. To sum up my experience with it was good and I don't have any issues. Thank you @rizalibnu for this amazing piece of code :D |
|
The last thing from my side is to add |
e06996f to
1407899
Compare
1b95894 to
f9d9449
Compare
packages/react-native-executorch/src/modules/computer_vision/OCRModule.ts
Outdated
Show resolved
Hide resolved
packages/react-native-executorch/src/modules/computer_vision/OCRModule.ts
Show resolved
Hide resolved
packages/react-native-executorch/src/modules/computer_vision/TextToImageModule.ts
Outdated
Show resolved
Hide resolved
packages/react-native-executorch/src/modules/computer_vision/TextToImageModule.ts
Outdated
Show resolved
Hide resolved
Add modular resource fetcher adapters to support both Expo and bare React Native environments. - Expo-based resource fetcher using expo-file-system - Supports asset bundles, local files, and remote downloads - Download management with pause/resume/cancel capabilities - Bare React Native resource fetcher using RNFS and background downloader - Supports all platform-specific file operations - Background download support with proper lifecycle management - Refactor ResourceFetcher to use adapter pattern - Add initExecutorch() and cleanupExecutorch() for adapter management - Export adapter interfaces and utilities - Update LLM controller to support new resource fetching - Update computer-vision, llm, speech-to-text, text-embeddings apps - Add adapter initialization to each app - Update dependencies to use workspace packages
6a63f5a to
246348c
Compare
This comment was marked as resolved.
This comment was marked as resolved.
packages/react-native-executorch/src/controllers/BaseOCRController.ts
Outdated
Show resolved
Hide resolved
...ence/react-native-executorch/namespaces/ResourceFetcherUtils/functions/getFilenameFromUri.md
Show resolved
Hide resolved
packages/react-native-executorch/src/modules/computer_vision/ImageSegmentationModule.ts
Outdated
Show resolved
Hide resolved
packages/react-native-executorch/src/modules/computer_vision/ObjectDetectionModule.ts
Outdated
Show resolved
Hide resolved
packages/react-native-executorch/src/modules/computer_vision/StyleTransferModule.ts
Outdated
Show resolved
Hide resolved
packages/react-native-executorch/src/modules/general/ExecutorchModule.ts
Outdated
Show resolved
Hide resolved
packages/react-native-executorch/src/modules/natural_language_processing/VADModule.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Jakub Chmura <92989966+chmjkb@users.noreply.github.com>
chmjkb
left a comment
There was a problem hiding this comment.
overall looks good, thanks @rizalibnu @msluszniak
one more thing - the current README is now obsolete. Can we update it? 🙏🏻
Added installation instructions for Expo and bare React Native projects.

Description
This PR introduces modular resource fetcher adapters to support both Expo and bare React Native environments, replacing the previous monolithic approach with a flexible, platform-specific architecture.
Key Changes
New Adapter Packages:
Initialization Changes:
Documentation Updates:
Introduces a breaking change?
Migration Required:
Users must now explicitly initialize the library with a resource fetcher adapter:
Type of change
Tested on
Testing instructions
For Expo projects:
yarn add @rn-executorch/expo-adapter expo-file-system expo-assetinitExecutorch({ resourceFetcher: ExpoResourceFetcher })For bare React Native projects:
yarn add @rn-executorch/bare-adapter @dr.pogodin/react-native-fs @kesha-antonov/react-native-background-downloaderinitExecutorch({ resourceFetcher: BareResourceFetcher })Screenshots
Related issues
Closes #549
Checklist
Additional notes
Why This Change:
Split Into Multiple PRs:
To make review easier, this work has been split:
BREAKING CHANGE:
initExecutorch()with explicit adapter selection is now required before using any react-native-executorch hooks. Users must install and configure either@rn-executorch/expo-adapteror@rn-executorch/bare-adapterdepending on their project type.