React Native for Windows + CodePush

13 Apr 2016 - byJonathan Carter

We’re very excited about today’s announcement at F8 2016 that Universal Windows Platform support is coming to React Native! The CodePush team has been fortunate enough to work with thousands of developers in the React Native community, and the ability to target your app(s) at any Windows 10 device is an awesome opportunity that we look forward to seeing folks begin to take advantage of.

Along with this announcement, we have also published a very early version of Windows support for the React Native CodePush module, which will allow releasing updates to your React Native apps running on a Windows 10 PC, phone, Xbox One and even HoloLens (!), using the same developement workflow as iOS and Android: code-push release-react MyApp windows. We want to make it as simple as possible to practice continuous delivery with React Native, and this support will extend that capability to millions of new devices.

     

NOTE: While the production F8 app uses CodePush, it doesn’t display an update prompt. We just added that for the sake of illustrating the concept more easily.

Current Support

The Windows implementation of CodePush currently has ~80% parity with the existing iOS and Android platforms, including all of the most commonly used features (e.g. updating assets, pivoting the install mode based on whether an update is mandatory or not). We were able to re-use 100% of our existing JavaScript code, and because React Native for Windows was architected to be conceptually similar to React Native for Android, it was a pretty straight forward port for our native code. We expect to implement the few remaining features in the next couple weeks, and will then maintain 100% parity across all three platforms moving forward.

We haven’t published the Windows support to NPM yet, but if you want to check it out, you can view the source and/or install the bits from our Windows branch, which includes an updated readme with setup instructions. Additionally, if you want to check out a sample app that uses React Native for Windows and CodePush, the beautiful and open-sourced F8 App is a great example to play around with. The production version of the app already uses CodePush for iOS and Android, and we implemented a fork of it which includes CodePush support on Windows. Clone the fork, run the setup instructions, and try it out! The above screenshots were taken using it, so feel free to have fun with running the app on the various device emulators.

Moving Forward

As the Windows support for React Native continues to evolve and mature, we’ll be improving the CodePush support as well, and will look forward to seeing the community response and contributions. In the meantime, please continue to send us feedback, ping us in the #code-push chanel on Reactiflux, and stay tuned for future feature investments!