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
.