metamask-mobile icon indicating copy to clipboard operation
metamask-mobile copied to clipboard

chore: Enable new architecture

Open andrepimenta opened this issue 5 months ago • 20 comments

Description

This PR enables the new architecture on React Native.

The new architecture brings multiple performance improvements out of the box and new guidelines as well, you can read more about it here: https://reactnative.dev/architecture/landing-page.

Changes

In general, we tried to change the code as less as possible to make it work with the new architecture.

1. *.test.tsx files updated

There are some test files that were updated to fix some E2E and unit tests errors.

2. *.test.tsx.snap files updated

There are some snapshot files that needed to be updated to be compatible with the new architecture version components.

3. Typescript linting fixes

There are some files where we had to fix typescript linting errors.

4. Libs updates

Upgraded Libraries: We’ve updated key dependencies to ensure compatibility and stability. Here’s what’s been bumped:

  • "@metamask/react-native-webview": "^14.1.0"
  • "react-native-gesture-handler": "^2.25.0"
  • "react-native-mmkv": "^3.2.0"
  • "react-native-safe-area-context": "^5.4.0"
  • Replace "react-native-camera" for "react-native-vision-camera"

5. Patches

We patched some libraries to ensure support for the new architecture.

  • react-native-modal (We needed to wrap with a View to work, more info here)
  • react-native-performance
  • react-native-gzip

6. Native changes

We changed the flag of the new architecture to true and had to make a few changes on the native side for the builds to compile.

7. Removal of RNTarTest

This was used to test the RNTar implementation to test local snaps, this was removed because it is not used anymore. It was using a library called mockito which was also removed as it is no longer used.

Note: We also identified a component worth to refactor for a better performance: Token search in Payment Request screen. Tracking here: #15996

Pre-merge author checklist

Pre-merge reviewer checklist

  • [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

andrepimenta avatar May 15 '25 15:05 andrepimenta