Releases: microsoft/react-native-code-push
v1.9.0-beta
This release introduces a couple of highly-requested features, as well as some key bug fixes. It is now available on NPM and can be updated immediately by running npm i --save react-native-code-push@latest
.
New Features
-
Added client-side support for the new release rollout feature in the CLI This version of the React Native SDK is required in order to begin taking advantage of this new capability, so make sure to upgrade your apps before attempting to release updates with a rollout percentage. More details
code-push release-react MyApp ios --rollout 25%
-
Added support for throttling resume-based installs We've seen a lot of developers want to use the resume-based install strategy, in order to get their updates in front of their end users sooner. However, forcing a restart on the next resume might be too obtrusive if the user switched away from the app for only a few seconds (e.g. to respond to a text). In order to help get updates in front of users sooner, while still respecting their workflow, the
sync
method now accepts a new option calledminimumBackgroundDuration
that specifies the number of seconds that the app needs to have been in the background before forcing the install. More details// If the app was in the background for 10 minutes, we assume that it is "safe" to restart to install the update codePush.sync({ installMode: codePush.InstallMode.ON_NEXT_RESUME, minimumBackgroundDuration: 10 * 60 });
Bug Fixes (General)
- When an update is downloaded from the CodePush server, the plugin now looks for the JS bundle file using the exact same file name that was specified as being contained in the binary (via either
[CodePush bundleURL]
orCodePush.getBundleURL
), as opposed to looking for the first file with a.jsbundle
,.bundle
or.js
extension. This makes the update E2E more reliable, and prevents issues for apps that use local<WebView>
hosted content.
Bug Fixes (iOS)
- The contents of the app binary are now successfully hashed for apps that aren't using React Native assets
- A custom error message is displayed when using
[CodePush bundleURL]
in yourAppDelegate.m
file, and deploying a debug build to the iOS Simulator. React Native doesn't generate a JS bundle in the binary in this circumstance, and it has confused many CodePush users. To help alleviate the confusion, we now explain the issue as well as a few possible workarounds.
Bug Fixes (Android)
- Cleaned up a bunch of lint warnings that didn't impact behavior, but may have been noisy for devs integrating CodePush into a native Android app
- Fixed an interop bug for apps that are using CodePush along with the Fabric SDK
v1.8.0-beta
This release introduces a handful of highly requested features and some key bug fixes. It is now available on NPM and can be updated immediately by running npm i --save react-native-code-push@latest
.
New Features
- The
sync
method now accepts a new option calledmandatoryInstallMode
, which allows you to individually customize the install mode that is used for optional and mandatory updates. This new property defaults toInstallMode.IMMEDIATE
(which is what we've found most devs want), but can be changed by passing a different value when callingsync
(e.g.codePush.sync({ mandatoryInstallMode: codePush.InstallMode.ON_NEXT_RESUME })
). - The contents of the binary are now hashed and sent to the CodePush server so that we can detect whether an available update is equivalent to what the end-user is already running. This helps prevent the unnecessary first-run update issue, and we now encourage developers to release their binary contents to CodePush to help solve this scenario, as well as enable diff updates for the initial CodePush update after a fresh binary install/update.
- When we download a diff update from the server, and merge its contents together with the previous update (or binary contents), we now validate the contents of the entire update on the client-side to ensure integrity.
Bug Fixes
- We removed our use of
Promise.prototype.done
for compatibility with allPromise
implementations, since we were seeing instances where folks were overriding the default React Native polyfill - We fixed our podspec to support CodePush being built as a framework in Swift apps using CocoaPods.
- We removed the requirement for apps to include a patch component in their version (e.g.
2.0
as opposed to2.0.0
), so you can now release updates for apps, without needing to change your versioning policies - Added some better diagnostic logging in certain scenarios (e.g. when the native module wasn't properily configured).
Breaking Changes (General)
- With the addition of the new
mandatoryInstallMode
option forsync
(described above), by default, mandatory updates will now be installed immediately. From our experience, this is what most developers were already doing or wanted to do, but just keep this change in mind, since it's possible that it would impact your existing update experience once you upgrade the plugin.
Breaking Changes (iOS)
v1.7.3-beta
This is a bug fix release which addresses a user-reported iOS issue and also introduces a small breaking change for apps using getCurrentPackage
. It is now available on NPM and can be updated immediately by running npm i --save react-native-code-push@latest
.
Bug Fixes (iOS)
- When the
Promise
returned bygetCurrentPackage
was rejected (rare but possible), the native-side wasn't properly returning from the method, and therefore, it would attempt to resolve thePromise
as well, which would result in a "Callback with id [ID] not found" error.
Breaking Changes
- The
getCurrentPackage
method now returnsnull
when the currently running JS bundle is coming from the binary and not from a CodePush update. This is the behavior that most people expected, but in case you're usinggetCurrentPackage
and not currently checking for anull
object as the resolved value of itsPromise
, you need to make sure to update that. Note that this isn't a server change, and therefore, existing production apps are unaffected. This breaking change only affects apps that upgrade to 1.7.3+ and continue callinggetCurrentPackage
without checking fornull
.
v1.7.2-beta
This is a bug fix release which addresses some key user-reported issues. It is now available on NPM and can be updated immediately by running npm i --save react-native-code-push@latest
.
Bug Fixes (General)
- We saw a few cases where apps were inadvertently calling the
sync
method multiple times concurrently (e.g. they calledsync
incomponentDidMount
as well as anAppState
change handler), which had the potential to put the app in a weird state. Now, whensync
is called, and a previoussync
call is still in progress (e.g. an update is downloading), it will resolve the promise with a new sync status ofSYNC_IN_PROGRESS
. That way, we can safeguard the runtime from getting into a bad state, while still providing the app with an indication of why eachsync
call completed.
Bug Fixes (iOS)
- If a developer's desktop clock wasn't synchronized with their testing device (i.e. it was significantly ahead of it), it would be possible to hit an issue where your app downloads a CodePush update, but after restart, continues to use the JS bundle that was shipped with the binary. This was because the
[CodePush bundleURL]
logic saw that the binary bundle was newer than the CodePush update, and therefore, gave it precedence. We no longer rely on this time-based heuristic for detecting whether to use the binary or CodePush update on app start, and therefore, this issue would no longer be possible in the rare cases that we saw it.
Bug Fixes (Android)
- We removed the superfluous NDK config from our
build.grade
file (we don't have any C++ code!), which was causing compilation errors for apps that use both the NDK and CodePush.
v1.7.1-beta
This is simply a bug fixing release that adds better logging for diagnostic purposes and re-enables install telemetry to be reported while debugging.
v1.7.0-beta
This release introduces the long-awaited support for updating assets on Android! This feature depends on React Native v0.19.0, so you'll need to update to that version of the platform in order to consume this CodePush release. We think it's extremely worth it though! (e.g. you get new debugging support for unhandled promises). This update is now available in NPM and can be installed immediately!
New Features (Android)
- Deploy updates to your assets on Android via CodePush. This works exactly like it does for iOS: instead of simply uploading your JS bundle to CodePush, you upload a directory containing your bundle and assets, and everything works great. The server supports differential updates, so your end-users will only get the files that changed between releases (i.e. they won't have to download all of your assets every time you release an update). Check out the CLI docs for the
release
command for more details.
New Features (iOS)
- We added a new method to the
CodePush
class calledsetDeploymentKey
which allows you to dynamically set your deployment key in Objective-C, as opposed to specifying it in theInfo.plist
file.
Breaking Changes
- This release depends on React Native 0.19.0, so if you choose to upgrade CodePush, then you need to also upgrade your React Native dependency.
- The newly added install metrics feature now only reports data to the server in release builds. Therefore, if you are testing your app and want to see this data populated in the CLI, you'll need to generate a release build first. This change was made to reduce noise from the metrics that are generated during debugging.
v1.6.0-beta
This release primarily introduces the necessary client-side telemetry to support the new install metrics of the CLI. You can view the details of this feature here. This version is now available in NPM and can be installed immediately!
New Features
- Update installations and rollbacks are now reported to the CodePush server in order to enable the CLI to display these metrics. You can find details about this feature here.
Bug Fixes
- The Android platform implementation no longer requires your app's
Activity
to inherit fromFragmentActivity
in order to display an update dialog prompt. This was necessary for enabling React Native 0.18.0, since it now makes use of a base class (ReactActivity
) which doesn't itself inherit fromFragmentActivity
.
v1.5.3-beta
This release is primarily meant to address an iOS compilation error that was introduced by React Native 0.18.0-RC (see details below), but it also includes a few other fixes and a minor feature enhancement. It is now available on NPM and can be upgraded to immediately.
Bug Fixes (iOS)
- In order to perform a programmatic app restart after an update has been installed, the CodePush plugin needs to update the
RCTBridge.bundleURL
property to point at the latest JS bundle file on disk. React Native 0.18.0 made this propertyreadonly
(in it's interface), and therefore, cause a compilation error with our plugin, since we could no longer set it. At runtime, this property is stillreadwrite
, so we simply use KVC to set the property, instead of relying on the "dot syntax" that the compiler didn't like. In the future, we'll use the more appropriate solution of importing the newRCTBridge+Private.h
header file, but for now, we wanted to maintain backwards combat so that this release didn't force all of our users to upgrade to React Native 0.18.0-RC.
Bug Fixes (General)
- Update assets (e.g. the JS bundle and images) weren't being removed from disk after being automatically rolled back due to a crash. This wouldn't have impacted the user experience, and unless you released a significant amount of CodePush updates that included a crash (please don't do this!), this wouldn't result in much disk space being used either. That said, we don't want to consume any more of the end users storage capacity than is absolutely necessary, so this was an important fix for cleanliness sake.
- Internal CodePush state (e.g. the list of updates that have previously failed) wasn't being properly cleared when a new binary was installed. It would be pretty rare for this behavior to have caused any issues, but it's more deterministic for us to treat each new binary installation as a "clean slate" since we can't make many assumptions about the new "environment" (e.g. which CodePush updates will work within it).
Feature Enhancements
- The
restartApp
method now includes an optional parameter that lets you specify whether you want to always restarts the app, or only if there is a pending update. This makes it simpler to implement a "forced restart" solution at some well-known point within your app (after installing a non-immediate update), without having to checkLocalPackage.isPending
before callingrestartApp
.
v1.5.2-beta
This release fixes a bug with the rollback protection feature that would occur in some circumstances on iOS when deploying React Native assets.
v1.5.1-beta
This is largely a bug-fix release to address a regression, but it also introduces a small feature request. It can be immediately acquired from NPM and includes the following improvements:
New Features (iOS and Android)
- The
LocalPackage
object returned by callinggetCurrentPackage
now includes anisPending
property which indicates whether or not the most recently installed update has actually been applied yet via a restart.
Bug fixes (iOS and Android)
- We fixed a regression that caused immediately-applied updates to automatically rollback in certain situations.