react-native-code-push icon indicating copy to clipboard operation
react-native-code-push copied to clipboard

Codepush/Native update? in RN 0.61

Open HannanShaikYara opened this issue 6 years ago • 5 comments

I have been using code-push in production for more than 2 years.

How I implemented?

  1. Whenever android folder of my react native app was modified, I assumed there is a native change and my CI/CD tool created a native apk file.
  2. In all other cases, I generated an JS bundle and pushed via CodePush.

In the latest RN version >=0.60, we have auto-linking of native modules. Because of this, I am not able to identify if any library newly added requires a native APK to be generated or just a bundle update.

Please provide suggestion how can this be done?

Environment

  • react-native-code-push version: 6.0.0
  • react-native version: 0.61.4

HannanShaikYara avatar Jan 21 '20 08:01 HannanShaikYara

I lock down versions of libs in package-lock.json. If I upgrade a lib I check if it has binary code. If it does I assume the built binary will be incompatible with new js, so I bump the major version of the app and distribute new binaries.

code-pushes in this scheme are always compatible in the same major range.

fgeorgsson avatar Jan 24 '20 08:01 fgeorgsson

I lock down versions of libs in package-lock.json. If I upgrade a lib I check if it has binary code. If it does I assume the built binary will be incompatible with new js, so I bump the major version of the app and distribute new binaries.

code-pushes in this scheme are always compatible in the same major range.

When you say I check if it has binary code you do this manually? or do you have a script?

HannanShaikYara avatar Jan 29 '20 07:01 HannanShaikYara

Manually unfortunately. Not that many libs to go through though.

On Wed, 29 Jan 2020 at 08:09, Hannan Shaik [email protected] wrote:

I lock down versions of libs in package-lock.json. If I upgrade a lib I check if it has binary code. If it does I assume the built binary will be incompatible with new js, so I bump the major version of the app and distribute new binaries.

code-pushes in this scheme are always compatible in the same major range.

When you say I check if it has binary code you do this manually? or do you have a script?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/microsoft/react-native-code-push/issues/1764?email_source=notifications&email_token=AAGPI4JFP5VUTP65XH5CENDRAETSJA5CNFSM4KJPLZH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKGFW6I#issuecomment-579623801, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGPI4NE5ZXRECQFHLRQODTRAETSJANCNFSM4KJPLZHQ .

fgeorgsson avatar Feb 09 '20 19:02 fgeorgsson

Hi @HannanShaikYara, Thank you for reporting!

Code Push allows you to create bundle update only for js part of your application. If the package you added has a native code (This happens in most cases), it cannot be distributed via CodePush.

I'm going to close this issue for now. Please let me know if you have any other questions.

andreidubov avatar Feb 11 '20 15:02 andreidubov

Thanks for clarification @andreidubov.

For others who may have similar need. I did it with comparing if ios/Podfile.lock to decide if it is a native build to be generated or a JS build.

I use circle CI v.2.1 and have followed documentation here https://medium.com/labs42/monorepo-with-circleci-conditional-workflows-69e65d3f1bd0.

HannanShaik avatar Jun 03 '20 19:06 HannanShaik