Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade React Native from v0.59 to v0.60.
Using the RN Upgrade Helper, a web app showing the diff from the release/0.59.10 and the release/0.60.6 branches of the `react-native-community/rn-diff-purge` repo, at https://react-native-community.github.io/upgrade-helper/?from=0.59.10&to=0.60.6. - Upgrade `react-native`, `react`, and `flow-bin` following the templates. - Upgrade `react-native-webview` to satisfy peer dependencies and remove the outdated libdef (to be replaced in an upcoming commit). - Adapt our Podfile to RN v0.60's new layout of pods, following the templates. - Upgrade `react-native-sound` and `rn-fetch-blob` to versions with podspecs compatible with the new pod layout in RN v0.60. A lot of work has already been done toward this: - We ignore or have already handled several changes to the Xcode and Gradle configs. A lot of work has already been done toward the upgrade: - most of the fixes necessary to adapt to Flow 0.98, without upgrading Flow yet (#3827). We do the upgrade in this commit, with warnings temporarily suppressed, for smaller commits. - updating to AndroidX (#3852) - migrating to using CocoaPods at all (#3987) Note: The following warning appears when running Metro and will be fixed with follow-up work: ``` warn The following packages use deprecated "rnpm" config that will stop working from next release: - react-native-orientation: https://github.com/yamill/react-native-orientation#readme - rn-fetch-blob: https://npmjs.com/package/rn-fetch-blob ``` ----- Platform-agnostic -------------------------------------------- After the upgrade, we get this peer dep warning: """ warning " > [email protected]" has incorrect peer dependency "react-native@>=0.57 <0.60". """ `[email protected]` is the minimum supported with RN v0.60.0. But if we try to get `[email protected] before the upgrade, we get this warning: """ warning " > [email protected]" has incorrect peer dependency "react-native@>=0.60 <0.62". """ In a previous commit, we removed the outdated libdef, with a suppression. We upgrade `react-native-webview` to at least 7.0.0 in this commit, then add the updated libdef in an upcoming commit. `react-native-webview` does declare that it follows semantic versioning [1], so we can feel comfortable taking a 7.x version later than 7.0.0. We take 7.6.0, the latest. Nicely, this gets us the changes from one of our PRs, released in 7.0.3; see 1982f3f and its reversion in the commit that followed, bbfac73. Handling the declared breaking changes [1] is straightforward: - Update to AndroidX (v6.0.2). If this is a real breaking change, we handled it in e433197. - UIWebView removed (7.0.1). This prompted the `scalesPageToFit` prop to be removed, but we don't use it. The `useWebKit` prop was also removed because it doesn't make sense for it to be anything but `true` now. So, remove our use of it. Also run `yarn yarn-deduplicate && yarn`, as prompted by `tools/test deps`. We've left "scripts" in `package.json` alone; ours work fine as-is. [1]: https://github.com/react-native-community/react-native-webview#versioning ----- Android ------------------------------------------------------ There are no updates on the Android side that must happen atomically with the RN upgrade. Some Android changes never appear in this series: - Adding the `debug.keystore` file and its config in `android/app/build.gradle`; we don't take these changes at all. See 9ccaa21. - Adding `android.useAndroidX=true` and `android.enableJetifier=true` in `android/gradle.properties`. These were done in e433197. - Deleting `android/keystores/BUCK` and `android/keystores/debug.keystore.properties`: We don't use Buck (removal of some of its boilerplate was 1c86488), and we don't have an `android/keystores` directory. As mentioned in 9ccaa21, we're happy with the Android Studio-provided debug keystore, and our own release keystore described in our release guide. ----- iOS ---------------------------------------------------------- facebook/react-native@2321b3fd7 appears to be the only cause of iOS changes that must happen atomically with the RN v0.60 upgrade. In that commit, all the "subspecs" that were nested under the "React" pod are un-nested so they each become their own pod, with many of these living in their own directory under node_modules/react-native/Libraries [1]. In our own code, this means changing our Podfile to refer to all these new pods, instead of the "React" pod's subspecs. So, do. Our Podfile has a list of "Pods we need that depend on React Native". We must also be sure all the dependencies in this list adapt to facebook/react-native@2321b3fd7. The syntax for pointing explicitly to a subspec is a slash, as in "React/Core" [2]. Knowing this, we check that list for pods that explicitly depended on those subspecs, with "React/[...]": ``` grep -Rl dependency.*React/ --include=\*.podspec \ --exclude="node_modules/react-native/*" node_modules ``` There are two, and they both have new versions that adapt to the new accepted shape: - `zmxv/react-native-sound@2f2c25a69`: "React/Core" -> "React" - `joltup/rn-fetch-blob`, `01f10cb10^..0f6c3e3cc`: "React/Core" -> "React-Core" So, take these new versions, and job done. Some iOS changes from the upgrade guide don't appear in this series. They fall neatly into a few touched files: - ios/ZulipMobile-tvOS/Info.plist: We're not (yet) in the TV business. ;) - ios/ZulipMobile.xcodeproj/project.pbxproj: The purge of many large chunks of this file, often known as "the Xcode config file", was already done, in 33f4b41. - ios/ZulipMobile.xcworkspace/contents.xcworkspacedata: After 33f4b41, this file already looks the way it should. - ios/ZulipMobile/Info.plist: These changes are done upstream in facebook/react-native@7b44fe56f. They fix a duplication issue and a code-comment issue, which were apparently causing build failures. Our code doesn't have these issues to begin with. [1]: They do still live in node_modules. It's possible for pods to be hosted online and downloaded on `pod install`, npm-style. For an example, see the 'Toast' dependency in node_modules/react-native-simple-toast/react-native-simple-toast.podspec. But that's not what's happening here, yet. facebook/react-native@2321b3fd7 hints that this will be the way of the future for React Native, "to make the experience nicer for library consumers". [2]: https://guides.cocoapods.org/syntax/podspec.html#subspec Fixes: #3548
- Loading branch information