Skip to content

Upgrade React Native to 0.71.6#6220

Merged
jpcloureiro merged 176 commits intomainfrom
upgrade/react-native/0.71.6-hermes
Jun 30, 2023
Merged

Upgrade React Native to 0.71.6#6220
jpcloureiro merged 176 commits intomainfrom
upgrade/react-native/0.71.6-hermes

Conversation

@jpcloureiro
Copy link
Copy Markdown
Contributor

@jpcloureiro jpcloureiro commented Apr 19, 2023

Description

React Native upgrade to 0.71.6 requires

Upgrade Helper

By using React-native upgrade helper (https://react-native-community.github.io/upgrade-helper/) we were able to bump one major version at a time. This approach allows us to handle specific version bump issues separately.

Most of the native (ios, android) changes were grabbed from this helper

React native Reanimated

Using Reanimated 2 we have the option to use Reanimated API v1 or V2. https://docs.swmansion.com/react-native-reanimated/docs/2.x/fundamentals/migration

Reanimated team added support for RN 0.71 on 2.14.4 but it is crashing our app on iOS native side.

We are forced to use Reanimated 3. This version only ships API v2, forcing us to do the V1 -> V2 migration as well as the gesture-handler that depends on it.

Hermes engine on Android

JSC does not fully support BigInt operations & that is a requirement for our app.

hermes version that comes with 0.71.6 crashes when some specific errors are thrown.

We can't use the latest version of hermes on 0.71.6 because its API is not compatible.

commit that fixes the crash facebook/hermes@f2f1a2e
We checked out https://github.com/facebook/hermes/releases/tag/hermes-2023-03-07-RNv0.71.4-31fdcf738940875c9bacf251e149006cf515d763, and cherry-picked the fix.

here's the tarball we are using https://github.com/MetaMask/hermes/tree/ae2ac688c3faf868d2360a10a7791226ed5702fb

hermes-engine/build.gradle had to be patched to allow the build process to fetch the tarball from our fork.

Why not Hermes on iOS as well?

We use JSC on iOS because it already has the necessary BigInt support. We tested hermes on iOS & it was unstable on our project (crashes)

Issue

Progresses https://github.com/metamask/mobile-planning/issues/690

Checklist

  • There is a related GitHub issue
  • Tests are included if applicable
  • Any added code is fully documented

@gantunesr gantunesr mentioned this pull request Jun 26, 2023
3 tasks
@jpcloureiro
Copy link
Copy Markdown
Contributor Author

jpcloureiro commented Jun 26, 2023

Our unit tests are failing on the components AdvancedSettings & EthSignFriction

EthSignFriction

Screenshot 2023-06-26 at 16 00 15 Screenshot 2023-06-26 at 16 00 41

It can't find the element with the role "button"

AdvancedSettings

Screenshot 2023-06-26 at 16 01 06

We seem to have issues with the navigation mock.

There are also two snapshots that need to be updated.

@cortisiko cortisiko added QA Passed QA testing has been completed and passed and removed QA in Progress QA has started on the feature. labels Jun 29, 2023
cortisiko
cortisiko previously approved these changes Jun 29, 2023
Copy link
Copy Markdown
Member

@cortisiko cortisiko left a comment

Choose a reason for hiding this comment

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

This PR is officially QA passed.

@jpcloureiro jpcloureiro mentioned this pull request Jun 29, 2023
3 tasks
@jpcloureiro jpcloureiro force-pushed the upgrade/react-native/0.71.6-hermes branch from 1d3c652 to 87b94b1 Compare June 29, 2023 22:47
Comment thread android/build.gradle
@jpcloureiro
Copy link
Copy Markdown
Contributor Author

This version bump happened when we had to regenerate yarn.lock

Hmm, why was this required? Regenerating the lockfile is a big change. If we could avoid this, we could reduce scope of this PR substantially and delay resolving the hexToBN issue described

Hey @Gudahtt we've revised yarn.lock to keep its changes to a minimum by running yarn on top of a yarn.lock file from main.

We also removed the hexToBN auxiliary function, leaving it as it was before.

Thanks for pointing that out!

Copy link
Copy Markdown
Contributor

@leotm leotm left a comment

Choose a reason for hiding this comment

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

great pairing and reviewing this pr today, lgtm :shipit:

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug C 3 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

13.5% 13.5% Coverage
0.0% 0.0% Duplication

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

QA Passed QA testing has been completed and passed release-7.3.0 Issue or pull request that will be included in release 7.3.0 team-mobile-platform Mobile Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.