-
Notifications
You must be signed in to change notification settings - Fork 31
feat(ios): add bundleURL provider for dynamic bundle loading #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ios): add bundleURL provider for dynamic bundle loading #212
Conversation
artus9033
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution @gronxb ! This looks awesome, left just one comment to rename the new option, other than that LGTM.
One more question, do you have feature parity in the current state on Android? I'm wondering if we need an equivalent feature in Android, where I think we currently would need to destroy & reinitialize the whole ReactHost, right?
|
For Android, from my perspective there’s no additional feature needed anymore. For reload behavior, we rely on the React Native API itself. On iOS, I use: On Android, we use: In the iOS case, Unfortunately, So once this gets merged, I don’t see any remaining issues from my side! Therefore, since this is already how things work in greenfield setups, there isn’t really anything additional we need to do for brownfield Android. |
|
I see, thank you for the explanation - then if there's a separate path for handling the |
artus9033
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for this contribution @gronxb !
Based on the Android HotUpdater, i need to have at least one backup bundle, so we keep the default built-in bundle. |
|
Amazing, thanks for the insights! |
|
These changes are now released as |
Summary
This is a follow-up to Android OTA support. Also, to support iOS reliably, we needed additional functionality.
In a typical OTA flow, when a force update occurs, we need to reload the current JSContext. In this case, ReactNativeDelegate’s bundleURL() is re-evaluated/reset without terminating the app, so even after the reload, we must be able to correctly reflect the latest bundle URL. Therefore, we need to be able to control this flow via a callback/hook.
However, with the currently provided options (bundlePath, bundle) alone:
In conclusion, the existing options don’t provide sufficient control, so we added a field that allows fully overriding the bundleURL() logic itself.
This field could be exposed under a name like overrideBundleURL(), for example.
Test plan
ios2.mov