Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: Upgrade to RN v0.66! #5372

Merged
merged 6 commits into from
Jun 2, 2022
Merged

deps: Upgrade to RN v0.66! #5372

merged 6 commits into from
Jun 2, 2022

Conversation

chrisbobbe
Copy link
Contributor

Fixes: #5231

@chrisbobbe
Copy link
Contributor Author

chrisbobbe commented May 4, 2022

Here are the RN commits that touch the RN template app that are in v0.65.2 but are not in v0.66.4. They're ordered from first to last (oldest to newest).

I.e., they're the commits in the output of git log --oneline --reverse v0.65.2..v0.66.4 -- template, when I run it in a clone of the facebook/react-native repo.

Along with whether, how, and when we propagate the changes to our app.

We shouldn't forget to update this, if necessary, to follow any changes made during code review and merge.

RN commit When resolved Comment
facebook/react-native@6386f691f Deploy Flow v0.150.0 main commit Flow 150 adds a format.bracket_spacing option; see facebook/flow@2d7614f38. The RN template app sets that to false, but I think we're fine to stick with its default, true.
facebook/react-native@7252798ab Deploy Flow v0.151.0 to xplat main commit
facebook/react-native@726e68926 Deploy Flow v0.152.0 main commit
facebook/react-native@547b4c92e Gradle 6.9, Android Gradle Plugin 4.2.1 (#31593) 53ed195 This was backported to RN v0.65 in facebook/react-native@7599593b3 and we processed it for that upgrade.
facebook/react-native@70da64094 remove jcenter (#31609) 1f80f4b This was backported to RN v0.65 in facebook/react-native@9a923be89 and we processed it for that upgrade.
facebook/react-native@5d01110b5 bump buildToolsVersion to 30.0.2 (#31627) N/A This was backported to RN v0.65 in facebook/react-native@37e9f1d36 and we processed it for that upgrade.
facebook/react-native@b3a715f6e removal of textColor from base application theme (#31487) 4fc4e96
facebook/react-native@80927791e Update _gitignore - Remove .hprof (#31679) N/A The commit doesn't help me understand why an .hprof file might appear, and I've never seen one appear. Let's wait till we see one, then maybe we can get a better idea of why it appears, and we can act on that.
facebook/react-native@06c33e9ab Bump Android deps to 0.93 (#31675) 7b4be5d This was backported to RN v0.65 in facebook/react-native@d8b115afa and we processed it for that upgrade.
facebook/react-native@b176617d1 Release v0.153.0 to xplat main commit
facebook/react-native@aa43aab77 Bump NDK to 21.4.7075529 (#31731) N/A Instead of pinning explicitly, we defer to the Android Gradle Plugin's choice of NDK version; see https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/Pin.20to.20explicit.20NDK.20version.3F/near/1132815
facebook/react-native@36318b677 Deploy v0.154.0 to xplat main commit
facebook/react-native@ca440b910 Upgrade Metro to v0.66.1 this PR
facebook/react-native@d6ed1ff58 Allow configuring ndk build architectures (#31232) N/A We're skipping this for now; see https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/RN.3A.20.22Allow.20configuring.20ndk.20build.20architectures.22/near/1377512
facebook/react-native@efd4dafc5 Update xplat to Flow v0.155.0 main commit
facebook/react-native@1e6fddbe0 Deploy Flow v0.155.1 main commit
facebook/react-native@cfdc4fed0 Upgrade metro to 0.66.2 this PR
facebook/react-native@a67799fc4 Deploy 0.156.0 to xplat main commit
facebook/react-native@41f45a77a Bump Flipper to 0.99.0 (#31896) this PR
facebook/react-native@d27288044 Handle OSS renderers in sync script 72583b1 This was backported to RN v0.65 in facebook/react-native@5a1dc1b6b and we processed it for that upgrade.
facebook/react-native@d583c2f15 Fix Undefined symbol: _swift_FORCE_LOAD$_swiftFileProvider when building with Xcode 13 N/A This gets cleanly reverted in facebook/react-native@ec083f914; ignore.
facebook/react-native@83b16292c Deploy 0.157.0 to xplat main commit
facebook/react-native@ae494e7ce Bump AGP to 4.2.2 this PR
facebook/react-native@ec083f914 Back out "Fix Undefined symbol: _swift_FORCE_LOAD$_swiftFileProvider when building with Xcode 13" N/A This cleanly reverts facebook/react-native@d583c2f15; ignore.
facebook/react-native@eb9388630 Include Swift lib in LIBRARY_SEARCH_PATHS N/A The RN maintainers announced a simpler fix to the build failure this seems to be aimed at: just don't include the LIBRARY_SEARCH_PATHS section at all. With one requirement: take an easy CocoaPods version bump. We did all that in 80a8621. See there, and also facebook/react-native@eb9388630#commitcomment-58407458
facebook/react-native@b48c3d1d4 Fix irregular indent in template (#29871) N/A This tiny indentation error doesn't appear in our project.
facebook/react-native@06e31c748 fix AGP 7 compatibility (#32030) N/A This was backported to RN v0.65 in facebook/react-native@8b430e00d and we processed it for that upgrade.
facebook/react-native@b55201c53 Deploy 0.158.0 to xplat main commit
facebook/react-native@ab829005b Move react-native-codegen to root main commit
facebook/react-native@a0429ebb5 (tag: v0.66.0-rc.0) [0.66.0-rc.0] Bump version numbers N/A
facebook/react-native@ea5109fc0 OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround main commit
facebook/react-native@038cdda23 Switch order of search libraries to fix M1 build error N/A This is downstream of facebook/react-native@eb9388630, which we decided not to follow; see there.
facebook/react-native@d552362f8 (tag: v0.66.0-rc.1) [0.66.0-rc.1] Bump version numbers N/A
facebook/react-native@614a370d8 (tag: v0.66.0-rc.2) [0.66.0-rc.2] Bump version numbers N/A
facebook/react-native@ab50c6ee2 (tag: v0.66.0-rc.3) [0.66.0-rc.3] Bump version numbers N/A
facebook/react-native@d47fd4a32 (tag: v0.66.0-rc.4) [0.66.0-rc.4] Bump version numbers N/A
facebook/react-native@09a21f0f3 (tag: v0.66.0) [0.66.0] Bump version numbers N/A
facebook/react-native@d48ed4a4b (tag: v0.66.1) [0.66.1] Bump version numbers N/A
facebook/react-native@6c19dc326 (tag: v0.66.2) [0.66.2] Bump version numbers N/A
facebook/react-native@3b5e4463a (tag: v0.66.3) [0.66.3] Bump version numbers N/A
facebook/react-native@1b31d6bb5 (HEAD, tag: v0.66.4, origin/0.66-stable) [0.66.4] Bump version numbers main commit

Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @chrisbobbe for taking care of this upgrade! This all looks good; just small commit-message comments below.

@@ -27,7 +27,7 @@ buildscript {
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.android.tools.build:gradle:4.2.2'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the release-notes page for 4.2.0; I don't see a note about
any of the patch releases there though.

It looks like you meant to include a URL here.

Comment on lines +5 to +6
export type Storage = interface {
multiSet(keyValuePairs: Array<Array<string>>): Promise<mixed>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: In the commit message:

(a) It looks like the error message it comes from the spiffy terminal version of Flow's output which relies on terminal color codes, but naturally it doesn't have the color. Can you include the version that doesn't rely on color?

The universal way (that works on basically all CLI programs) is by saying flow | cat instead of just flow, so that it sees its output isn't a terminal. The explicit way is flow --color=never.

(b) The quoted error is long because it has (most of) the whole text of getItem, with all its comments. Can you trim it down for the commit message?

@chrisbobbe
Copy link
Contributor Author

Thanks for the review! Revision pushed.

@chrisbobbe
Copy link
Contributor Author

Before merging, let's let a release with RN v0.65 go out to all users.

@gnprice
Copy link
Member

gnprice commented May 12, 2022

Before merging, let's let a release with RN v0.65 go out to all users.

(That way if there are issues that seem related to the upgrade, we have a head start on narrowing them down and don't have to wonder whether they were introduced by RN v0.65 or v0.66.)

@gnprice
Copy link
Member

gnprice commented May 16, 2022

Meanwhile, this branch all looks good! So once we have a release out to prod with RN v0.65, this will be ready for merge.

Otherwise, when we start using Flow v0.158, we'd see errors like

```
Error ------------------------------------ src/boot/store.js:168:12

Cannot assign object literal to `reduxPersistConfig` because
function type [1] cannot be unbound from the context [1] where it
was defined in the `this` parameter of property `storage.getItem`.
[method-unbinding]

   src/boot/store.js:168:12
   168|   storage: CompressedAsyncStorage,
                   ^^^^^^^^^^^^^^^^^^^^^^

References:
   src/storage/CompressedAsyncStorage.js:21:3
          v----------------------------------------------------------
    21|   static async getItem(key: string): Promise<string | null> {
      :
    64|   }
          ^ [1]
```

Greg explains, at
  https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/Flow.20158.20errors/near/1375554
, comparing the definition before and after this change:

> Those two types are very similar. But the difference is about
> `this`.
>
> The interface just says, you can call this method, and you should
> pass these types and you'll get this type.
>
> The object type says, you can get this *property*, and then go on
> to call that property as a function, passing these types and
> getting this type back.
>
> And the point that error seems to be making is that the latter
> thing isn't actually true here, while the first thing might be.
With Flow v0.158, we'd get errors like:

  Cannot get AsyncStorage.clear because typeof-annotation
  AsyncStorage.clear [1] cannot be unbound from the context [2]
  where it was defined. [method-unbinding]

Greg points out, at
  https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/Flow.20158.20errors/near/1375541 :

> Those can be fixed by just replacing typeof `AsyncStorage.clear`
> with what that type actually is. There aren't very many of those
> and their types aren't actually complicated, so that duplication
> is fine; I just wrote it that way because it seemed neater to
> avoid the duplication if I could.

So, do that.
….66.2.

Done to follow the template-app changes in

  facebook/react-native@ca440b910 (for ^0.66.1)
  facebook/react-native@cfdc4fed0 (for ^0.66.2)

on the path to the RN v0.66 upgrade. (Note, from the yarn.lock, that
the actual selected version doesn't change. It was 0.66.2 before,
and it still is now.)
Done to follow the template-app change in
facebook/react-native@41f45a77a, on the path to the RN v0.66
upgrade.
Done to follow the template-app change in
facebook/react-native@ae494e7ce, on the path to the RN v0.66
upgrade.

Here's the release-notes page for 4.2.0. I don't see a note about
any of the patch releases there though:
  https://developer.android.com/studio/releases/gradle-plugin#4-2-0
Note: If you get an error like

  CocoaPods could not find compatible versions for pod "RCT-Folly"

on `yarn` or `pod install` when crossing this commit (checking out a
branch that has it from one that doesn't, or vice versa), run
`pod update RCT-Folly` from `ios/` and try the command again.
Background:
  facebook/react-native#32659 (comment)

In this commit:

- Bump `react-native` and `flow-bin` versions

- Suppress a few errors from the new Flow version (see comments)

- Remove react-native-codegen, following the template-app change in
  facebook/react-native@ab829005b

- Add a hack line to the Podfile, following the template-app change
  in facebook/react-native@ea5109fc0
@gnprice
Copy link
Member

gnprice commented Jun 2, 2022

v27.186 is now out to all users, and it has RN v0.65.

I've rebased this PR, and on a quick manual smoketest everything still seems good. Merging!

@gnprice gnprice merged commit fe300d5 into zulip:main Jun 2, 2022
@chrisbobbe chrisbobbe deleted the pr-rn-66 branch June 2, 2022 21:23
@chrisbobbe
Copy link
Contributor Author

Great! Thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to RN v0.66
2 participants