Skip to content

Releases: microsoft/react-native-code-push

v1.5.0-beta

12 Dec 21:19
Compare
Choose a tag to compare

This is largely a bug fix release for the Android platform, that also introduces a breaking change for both iOS and Android (hence the minor version bump). Because of this breaking change, you need to uninstall your app from the emulator/devices your testing against before upgrading. It can be immediately acquired from NPM, and includes the following improvements:

Breaking Changes (iOS and Android)

  1. The rollbackTimeout parameter of both the sync and LocalPackage.install methods have been removed. We received a lot of feedback regarding this parameter being pretty confusing, and it also required devs to opt-in to receiving client-side rollback protection. We believe that this behavior is extremely important for doing production deployments, and therefore, in order to be more prescriptive, calling sync and LocalPackage.install will now automatically enable rollback protection, and it cannot be disabled (why would you want to do that anyways?)

    If you are calling sync on app start (e.g. the componentDidMount method of your root component), then you don't need to do anything else. Your updates will be made available to users, but if you accidentally release something bad, you can rest assured that your users will be automatically rolled back. However, if you are calling sync somewhere else (e.g. button click, within a periodic timer), you MUST call notifyApplicationReady after your app has successfully started (e.g. in your root component's componentDidMount event), which lets the CodePush runtime know that the update is valid and won't automatically roll the end-user back to the previous version.


    We've found that the vast majority of users are calling sync in componentDidMount, and therefore, this change automatically makes your deployments more reliable, without doing any work!

Bug Fixes (Android)

  1. When dev support is enabled, the React Native runtime attempts to load the JS bundle from a locally available cache. This can create a confusing workflow when using CodePush, since it's possible to install an update, restart the app, and not see the changes applied. This occurs because the app might still be using the older cached file, and CodePush is effectively not being consulted. The CodePush plugin now deletes the React Native cache whenever an update is installed. This will have the effect of loading the JS bundle from the packager (if running), or the bundle file downloaded from CodePush.
  2. There were some instances where an installed update wouldn't be correctly applied when running your app in an emulator. This has now been addressed, and updates should work great across all emulators and devices.

v1.4.2-beta

09 Dec 07:24
Compare
Choose a tag to compare

This is a bug fix release that addresses the following issues and can be immediately acquired via NPM:

  1. When an error occurs during a call to sync (e.g. missing deployment key in Info.plist file), that error message is now logged to the console (e.g. adb logcat, Chrome, Xcode console). Previously, we would only log "Unknown error", which wasn't particularly useful. If an app was calling done on the Promise returned by sync, any errors would have resulted in a red box, so this issue only really impacted scenarios where the error was being completely swallowed and the console didn't provide any indication of the cause.
  2. We were previously writing the update contents (e.g. JS bundle, images) to the app's Documents folder, whereas the iOS guidelines recommend using the Library\Application Support directory for content that shouldn't be end-user visible. Because of this change, you should uninstall your app from any devices or simulators in order to clean out the Documents folder. The plugin automatically cleans out old updates when installing a new one, but with this fix, it won't attempt to clean out the Documents folder anymore. This won't impact any user experience, however, it's just for cleanliness sake.
  3. The iOS plugin was erroneously giving priority to the JS bundle contained in the binary in some instances. If you're installing an update but still seeing an older version of your app after restarting, it it likely this bug, and you should update your NPM dependency to this release.

v1.4.1-beta

07 Dec 18:39
Compare
Choose a tag to compare

This is a bug fix release which addresses the following two issues:

  1. The sync method wasn't calling notifyApplicationReady as was intended. This has been addressed, and therefore, when you are calling sync on app start, and specifying a rollbackTimeout, you don't have to manually call notifyApplicationReady, since
  2. The bug reported (and fixed!) via #94. Thanks @oney for being such a consistently amazing contributor!

v1.4.0-beta

05 Dec 02:24
Compare
Choose a tag to compare

This release introduces support for updating images via CodePush using the new React Native assets system. It currently only works for iOS, but we're working on Android support. In the meantime, you can still use CodePush and the new assets system on Android, and nothing will break, you just won't be able to add/edit images via CodePush like you can with iOS.

In order to support this change, we needed to rely on v0.15.0 of React Native, so if you're still using v0.14.*, we recommend sticking with v1.3.0 of CodePush. That said, we think the new asset system is awesome, and is way worth upgrading, so we encourage you to do it :)

Additionally, once you are using the assets system, you are no longer simply releasing updates of your JS bundle file, and therefore, you'll need to change your CodePush workflow a little bit. Refer to the docs for all the details here. We promise that it's still simple!

Note: If you aren't using the new React Native assets system, then you can continue to release only your JS bundle to CodePush, and rely on your images to be loaded from the binary. CodePush won't break this workflow in any way.

Breaking Changes (General)

  1. As mentioned above, this version of CodePush requires v0.15.0 of React Native. Even if you're not using the assets system or you are but on Android, this release of the CodePush plugin requires you to upgrade your RN dependency.

Breaking Changes (iOS)

  1. This upgrade requires an additional setup step for iOS to link the libz library with your app (we use it to unzip updates which contain the JS bundle and images). Refer to step #5 in the iOS installation section of the docs to see how to do this. If you upgrade your plugin and see a bunch of weird errors, this is likely the reason.
  2. If your app was already using the new assets system and deployed updates to CodePush that only specified a JS bundle, you need to do another release via the CLI which includes your assets and bundle (details here). When the plugin installs an update that contains only a JS bundle, it assumes you aren't using the React Native assets system, and therefore, won't copy over your existing assets in the binary to the location that the update is written to (and your app layout will be broken). As mentioned above, if you aren't using the new assets system, you can keep releasing just the JS bundle, and your release workflow doesn't need to change.

v1.3.1-beta

29 Nov 06:14
Compare
Choose a tag to compare

This is a bug fix release that ensures the actual update download runs on a background thread (Android only), and fixes a regression with the mandatory update message displayed as part of the sync method. Thanks to @oney for these contributions!

v1.3.0-beta

27 Nov 20:14
Compare
Choose a tag to compare

This is a significant release that contains many new features as well as some breaking changes. Please refer to the docs for more information regarding the behavior of the following API additions/modifications. You can update your react-native-code-push installation from NPM immediately to take advantage of these improvements.

New features (General)

  • Android support! This has been our #1 user request thus far, and so we're excited to get it out there. The Android API includes complete parity with iOS, including the new features mentioned in this release below.
  • The sync method now include a syncStatusChangedCallback parameter, which allows you to listen for state changes in the overall update process (e.g. update is available, download starting) and respond accordingly. This allows you to let the sync method handle the entire update process, while still having the option to display custom UI and/or perform additional behavior as needed.
  • The sync and RemotePackage.download methods now include a downloadProgressCallback parameter, which allows you to listen to progress events when an available update is being downloaded. This was a very common request and allows you to choose to show a download progress modal experience in your app.
  • The sync and LocalPackage.install method now accept an InstallMode parameter which allows you to determine whether the update should be installed immediately (the previous behavior), on the next app restart (to support fully silent installs) or on the next app resume.
  • The sync method now accepts an updateDialog parameter, which allows you to enable/disable the user confirmation, as well as customize its strings when displayed. The change, along with the InstallMode change above is what fully enables "silent updates" (see below for breaking changes with sync).
  • The sync and checkForUpdate methods now accept an optional deploymentKey parameter, which allows you to override the value that was specified in the Info.plist file (iOS) or MainActivity.java (Android). This enables you to build your app against a specific deployment (i.e. Production) and then dynamically "redirect" it at a different deployment
  • A new restartApp method was added to the react-native-code-push module, which allows your app to force a restart at any time. This can be useful when you choose not to install an available update immediately (e.g. when performing "silent" updates), but your app has a deterministic event that can be used to "force" the update instead of waiting for the user to restart/resume the app (e.g. when a form is submitted or a user navigates to the home route).
  • When your app is configured to used the packager for debugging, a CodePush update will no longer re-direct the React Native Bridge from the HTTP URL to the update file on disk. This change allows you to efficiently debug your app, as well as your CodePush update experience, without interrupting your flow as soon as an update is applied.

New features (iOS)

  • Besides the [CodePush bundleURL] method, which assumes your JS bundle is named main.jsbundle, the CodePush class now includes a bundleURLForResource: method (which lets you override the bundle name) and the bundleURLForResource:withExtension: method (which lets you override both the bundle name and extension).

Breaking changes (General)

  • This plugin now requires React Native v0.14.0 or greater. We needed to take advantage of some recent changes in the platform and choose to up our version requirement. If this is going to impact you, please let us know.
  • The sync method is now "silent" by default, and therefore, no longer displays the user prompt when an update is available, and also doesn't immediately restart the app after installing the update. This change was made based on lots of feedback. If you want to achieve the old behavior, you simply need to enable the updateDialog option and change the InstallMode to immediate when calling sync: codePush.sync({ userDialog: true, installMode: codePush.InstallMode.IMMEDIATE }).
  • The LocalPackage.apply method has been renamed to install to better reflect what it's actually doing.

Breaking changes (iOS)

  • The getBundleUrl method of the CodePush class has been renamed to bundleURL

v1.1.2-beta

08 Nov 20:19
Compare
Choose a tag to compare

This is a bug fix update, which addresses the following issues:

  1. #41 - Updates are now appropriately being "ignored" when they are associated with an app store version other than the one which the end-user is currently running. This was always the intended behavior, but it was regressed with a feature release. Therefore, if the end-user is running v1.0.0 of your app, and the app queries CodePush for an update, it will only accepts updates that have been explicitly "tagged" as v1.0.0. Older versions were already ignored (for obvious reasons), and with this update, so are newer versions (e.g. v1.0.1), since it isn't clear that they would work with the end-users running version of the app binary.
  2. #38 - If the JS bundle in the app binary is newer then the JS bundle from the latest CodePush update, it will be used instead of simply always using the CodePush update when one is available. This behavior is necessary so that if an end-user updates the app from the store (or whatever other means they could acquire a newer IPA file), the contents of that update will take precedent as long as it's newer. Thanks @qingfeng for handling this PR!

This release has been published to NPM and is the recommended version for all developers.