config-plugins icon indicating copy to clipboard operation
config-plugins copied to clipboard

feat(react-native-code-push): add react-native-code-push plugin

Open GSTJ opened this issue 1 year ago • 17 comments

Why

This PR adds Codepush support without requiring manual changes to the native code. It's based on the work started on this thread, which never got merged: https://github.com/microsoft/react-native-code-push/pull/2415.

The community claimed this was broken on Android, so my work completely re-structured his work, ensured every step made sense, and followed the most up-to-date official Codepush documentation for both IOS and Android.

How

This evolved from a fork of @deggertsen's work at https://github.com/deggertsen/react-native-code-push-expo-plugin. The work here never got published on NPM and had some outstanding issues.

This is a rewrite, where I followed the newest Codepush Documentation step-by-step and updated every file accordingly to match. I also refactored and consolidated his work to make it easy to understand and follow through.

Shoutout to @deggertsen for his solid base structure.

Why not just merge it to Microsoft's repo?

@deggertsen has had a PR stuck on review since the beginning of the year, and there is a lot of bureaucracy in getting this code into CodePush's main repo.

Effectively, it isn't a repository made with this plugin in mind.

The idea here is to shine a light on the necessity of this plugin and battle-testing this approach with more users, and maybe we can get this merged into Codepush in the future.

@expo/config-plugins is community-maintained, so this fits better here for a head-start. I want to have this released on NPM sooner.

Test Plan

I've created a react-native-code-push folder on /apps, so this plugin can be more easily tested.

  1. Open the react-native-code-push folder on /apps
  2. Run yarn to install the projects dependencies
  3. Run npx expo prebuild
  4. Check if the changes on the IOS and Android folders match the Codepush instructions here: IOS, Android

GSTJ avatar Nov 03 '23 15:11 GSTJ