metamask-mobile
metamask-mobile copied to clipboard
chore: Enable new architecture
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
- [x] I’ve followed MetaMask Contributor Docs and MetaMask Mobile Coding Standards.
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using JSDoc format if applicable
- [x] I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
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.