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

Upgrade to RN v0.65 #5230

Closed
gnprice opened this issue Feb 15, 2022 · 7 comments · Fixed by #5337
Closed

Upgrade to RN v0.65 #5230

gnprice opened this issue Feb 15, 2022 · 7 comments · Fixed by #5337
Labels
P1 high-priority upstream: RN Issues related to an issue in React Native

Comments

@gnprice
Copy link
Member

gnprice commented Feb 15, 2022

The next round after #4426. This release came out last August:
https://reactnative.dev/blog/2021/08/17/version-065
so it's past time for us to try it out.

(There's actually now a v0.66 and a v0.67, too -- they've been aiming to make releases more often since last summer.)

The blog post doesn't highlight anything that sounds like a big compatibility issue, so this might be an easier upgrade than usual. More-detailed changelog:
https://github.com/facebook/react-native/blob/main/CHANGELOG.md#v0650

@gnprice gnprice added upstream: RN Issues related to an issue in React Native P1 high-priority labels Feb 15, 2022
@gnprice
Copy link
Member Author

gnprice commented Feb 15, 2022

One thing this may give us is support for Gradle 7 and Java 17: #5229

Chat thread here.

@gnprice
Copy link
Member Author

gnprice commented Feb 15, 2022

The biggest changes highlighted in this release are to Hermes. We don't use Hermes yet, so nothing there is a blocker to this upgrade -- but after this upgrade, that might be the time for us to try it: #4131. In particular this version is where Hermes on Android gains support for Intl, as we discussed here: 9a68ea3

@chrisbobbe
Copy link
Contributor

chrisbobbe commented Feb 15, 2022

Just sent #5234 to cut down on the Flow errors with Flow v0.149 🙂

@chrisbobbe
Copy link
Contributor

chrisbobbe commented Feb 16, 2022

When I test out with Flow v0.149, I get lots of errors from files in flow-typed/. That's probably down to this, in Flow 0.143:

Previously, errors in library files were sometimes being missed due to a bug. This has been fixed, which may expose errors in library files that were not previously being reported.

The affected libdefs are currently

  • netinfo
  • @react-navigation (various)
  • @sentry/react-native
  • expo-web-browser
  • react-intl
  • react-native-safe-area-context
  • react-native-webview

Greg, would this be a good opportunity to move all of those to .flow.js files? You started the pattern of using .flow.js files in 007dea3, for sqlite. In my experience with #5233, even on current Flow, errors will be flagged in a .flow.js file that aren't flagged in a libdef file in flow-typed/ (with declare module, etc.).

chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Feb 16, 2022
…w 149

We're not yet using Flow 0.149, but we'd like to start along with
the RN v0.65 upgrade (zulip#5230).
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Feb 16, 2022
…w 149

We're not yet using Flow 0.149, but we'd like to start along with
the RN v0.65 upgrade (zulip#5230).
gnprice pushed a commit to chrisbobbe/zulip-mobile that referenced this issue Feb 16, 2022
…w 149

We're not yet using Flow 0.149, but we'd like to start along with
the RN v0.65 upgrade (zulip#5230).
@gnprice
Copy link
Member Author

gnprice commented Feb 17, 2022

Greg, would this be a good opportunity to move all of those to .flow.js files? You started the pattern of using .flow.js files in 007dea3, for sqlite.

Yeah, that sounds like a good idea to me.

In general the big advantage of .flow.js files over libdef files is that they are a great deal more pleasant to iterate on changes to, because Flow handles those changes incrementally in the same way it does in any normal part of the codebase. (Whereas on any edit to a libdef file, Flow restarts from scratch.) So if we're going to go about making a bunch of edits to fix type errors, it'll be a lot more pleasant to do that after moving to .flow.js.

In my experience with #5233, even on current Flow, errors will be flagged in a .flow.js file that aren't flagged in a libdef file in flow-typed/ (with declare module, etc.).

Yeah. That's because the bug discussed here: #5233 (comment) was in the logic implementing Flow's special handling of libdef files.

In a .flow.js file, Flow behaves very nearly like it does for any normal file, with relatively little special handling. There are still bugs, of course, but they should be basically the same set of bugs as you see when using Flow anywhere else 🙂

@gnprice
Copy link
Member Author

gnprice commented Feb 17, 2022

From the list of errors you posted at #5234, I get the following summary:

$ perl -lne 'print $1 if (/^Error -* (.*):\d+:\d+/)' after.txt | uniq -c
      1 flow-typed/@react-native-community/netinfo_v5.x.x.js
      1 flow-typed/@react-navigation/native_v5.x.x.js
      5 flow-typed/@react-navigation/stack_v5.x.x.js
      2 flow-typed/@sentry/react-native_v2.x.x.js
      2 flow-typed/expo-web-browser_vx.x.x.js
     36 flow-typed/react-intl_vx.x.x.js
      8 flow-typed/react-native-safe-area-context_vx.x.x.js
     18 flow-typed/react-native-webview_v11.x.x.js
      1 src/RootErrorBoundary.js
      1 src/api/notifications/savePushToken.js
     10 src/message/__tests__/fetchActions-test.js
      1 src/message/fetchActions.js

And then I believe #5236 takes care of the errors there outside of flow-typed/.

@gnprice
Copy link
Member Author

gnprice commented Mar 1, 2022

One thing this may give us is support for Gradle 7 and Java 17: #5229

Another consequence of Gradle 7 support will be the ability to upgrade the Android Gradle Plugin: the next version, AGP 7.0.x, requires Gradle 7.0.2+: https://developer.android.com/studio/releases/gradle-plugin?buildsystem=cmake#7-0-0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 high-priority upstream: RN Issues related to an issue in React Native
Projects
None yet
2 participants