Search code examples
react-nativecode-pushreact-native-code-push

Code-Push with CI/CD and native dependency changes


I am readying an app for release to the app stores and I'm concerned with CI/CD pipeline and Code-Push.

How does this scenario play out:

If a developer makes NPM dependency updates and there is a package updated that has native code changes that the JS relies on, will Code-Push still update the JS bundle on user devices ahead of their device downloading the native code updates?

Just so my question is clear, I'm not trying to OTA update native code - I'm referring to a situation where some package like react-native-device-info has native Java/Swift code and also has JS code that requires some api or event constant from the native code. If you bump the package version for react-native-device-info to a new release and there is changes to both native and JS code, would code-push have any way to know to not update the bundle until the native code/app was updated because the JS bundle has code that depends on the native code?

Or, am I thinking of using the tool Code-Push wrong?


Solution

  • The way codepush works is that it updates the JS bundle of your app. Your requirement is to update a NPM package which has a native change and update only your client side which is not possible. If you do this you will probably end up with a crash of your app when the JS contacts the native code.

    would code-push have any way to know to not update the bundle until the native code/app was updated because the JS bundle has code that depends on the native code?

    Simple answer NO Codepush is targeted on a version number so your new version which hits the stores will have a new version number so no point of updating the bundle of the old version of the app.

    If you really want all your users to move to a new version push an alert or some sort of message using codepush asking the user to update.