Skip to content

chore: Upgrade React Native to 0.76.6#13771

Merged
sethkfman merged 236 commits into
mainfrom
upgrade/react-native/0.76.6
Apr 30, 2025
Merged

chore: Upgrade React Native to 0.76.6#13771
sethkfman merged 236 commits into
mainfrom
upgrade/react-native/0.76.6

Conversation

@andrepimenta

@andrepimenta andrepimenta commented Feb 28, 2025

Copy link
Copy Markdown
Member

Description

This PR upgrades React Native from 0.72.15 to 0.76.6 and Expo from ^49.0.0 to ~52.0.27.

Changes

In general, we tried to change the code as less as possible to make it work with the new React Native and Expo versions.

There are 8 main changes:

1. React Native/Expo upgrade guide

I followed the guide: https://docs.expo.dev/bare/upgrade/?fromSdk=49&toSdk=52#packagejson to update to the new version of both React Native and Expo. Check the guide to see the files I needed to update.
It seemed like a more complete guide instead of the React Native one and it made more sense to me to follow this one since we are using Expo.

This is included in the first 2 commits. These commits also include other changes to ensure Android and iOS build and run locally.

Changes worth mentioning

Flipper Removal

All the changes related to Flipper are due to the removal of Flipper, long awaited change!

iPhone Deployment Target

The IPHONEOS_DEPLOYMENT_TARGET was updated from 13.0 to 15.1

Android NDK Version

The NDK version was updated from 24.0.8215888 to 26.1.10909125 (devs should install it within Android Studio)

2. [RN_ELEMENT].propTypes deprecated

[RN_ELEMENT].propTypes was deprecated by (RN 0.74)[https://reactnative.dev/blog/2024/04/22/release-0.74#removal-of-deprecated-proptypes].

There are components and patches applied to change the use of propTypes to be compatible with the new React Native version. Generally we used the propTypes deprecated-react-native-prop-types like ViewPropTypes and TextPropTypes to fix this without changing too much the code.

For example: app/components/Base/Keypad/components.js

3. *.test.tsx files updated

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

For example: app/components/UI/AccountApproval/index.test.tsx

4. *.test.tsx.snap files updated

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

For example: app/components/UI/AccountApproval/__snapshots__/index.test.tsx.snap

5. Typescript linting fixes

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

For example: app/component-library/components/Pickers/PickerAccount/PickerAccount.tsx

6. Icons names updated

There are some icons names that were updated to be compatible with the new Expo icons.

For example: app/components/Base/DetailsModal.js

7. Libs updates

  • react, react-native, expo, @react-native/metro-config: Updated to correspond to the RN upgrade
  • deprecated-react-native-prop-types: I had to use this lib to replace instances like Text.propTypes.style because RN deprecated all [Element].propTypes
  • react-native-scrollable-tab-view: This library is not maintained anymore, we should consider moving to another library, in the meanwhile I have updated to the latest commit there and had to do a patch on top (explained below).
  • flipper related libraries: Flipper is finally removed!
  • The rest of the libraries updates were due to incompatibilities with the new RN upgrade

8. Patches

  • Majority of patches were to fix the propTypes deprecation.
  • react-native-scrollable-tab-view: A lot of incompatibilities with the new RN version. The changes basically made it compatible without having to move to another lib (although this should be a task for the future).
  • Rest of patches: Basically making libraries work with the new RN

All other changes

All the other changes were either because of the Guide mentioned above or details here and there that had to be implemented in order for the app to build/run with the new upgrade. Happy to explain any change that I haven't mentioned here :)

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • 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.

@socket-security

socket-security Bot commented Feb 28, 2025

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert (click for details)
Warn Low
npm/@vscode/sudo-prompt@9.3.1 is a AI-detected potential code anomaly.

Notes: This package includes code that facilitates the execution of commands with elevated privileges on multiple operating systems (Linux, macOS, Windows). It contains an obfuscated base64-encoded applet (the APPLET variable) whose contents are not immediately clear without decoding. Additionally, the code sets an unusually large MAX_BUFFER size for child process execution, which could potentially lead to resource exhaustion or Denial of Service (DoS) if misused. While there is no evidence of malicious behavior, these unusual patterns and non-standard coding practices may pose security risks if not properly managed. Users are advised to decode and inspect the APPLET variable to ensure it does not contain malicious content and to review the code for proper input sanitization to prevent potential command injection or privilege escalation vulnerabilities.

Confidence: 1.00

Severity: 0.60

Source: yarn.lock

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@vscode/sudo-prompt@9.3.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Ignoring alerts on:

  • npm/@react-native/debugger-frontend@0.76.6
  • npm/@react-native/dev-middleware@0.76.6
  • npm/canvas@3.1.0
  • npm/@react-native/debugger-frontend@0.76.9
  • npm/@react-native/dev-middleware@0.76.9
  • npm/@react-native/community-cli-plugin@0.76.9
  • npm/@react-native-community/cli@15.0.1
  • npm/@segment/analytics-react-native@2.20.3
  • npm/react-native-svg@15.11.1
  • npm/@expo/image-utils@0.6.5
  • npm/react-native@0.76.9
  • npm/expo-manifests@0.15.8

View full report

Comment thread app/components/UI/Tokens/index.tsx Outdated

@FrederikBolding FrederikBolding left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Snaps changes LGTM!

darkwing
darkwing previously approved these changes Apr 30, 2025
ziad-saab
ziad-saab previously approved these changes Apr 30, 2025
@github-project-automation github-project-automation Bot moved this from Needs more work from the author to Review finalised - Ready to be merged in PR review queue Apr 30, 2025
leotm
leotm previously approved these changes Apr 30, 2025
OGPoyraz
OGPoyraz previously approved these changes Apr 30, 2025
owencraston
owencraston previously approved these changes Apr 30, 2025
@andrepimenta andrepimenta added the No QA Needed Apply this label when your PR does not need any QA effort. label Apr 30, 2025
@github-actions

github-actions Bot commented Apr 30, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: ade8145
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/5e0bf258-11d8-4b3a-88f7-365e9552166b

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@leotm

leotm commented Apr 30, 2025

Copy link
Copy Markdown
Contributor

@SocketSecurity ignore npm/@expo/image-utils@0.6.5
@SocketSecurity ignore npm/@react-native-community/cli@15.0.1
@SocketSecurity ignore npm/@react-native/community-cli-plugin@0.76.9
@SocketSecurity ignore npm/@react-native/debugger-frontend@0.76.6
@SocketSecurity ignore npm/@react-native/debugger-frontend@0.76.9
@SocketSecurity ignore npm/@react-native/dev-middleware@0.76.6
@SocketSecurity ignore npm/@react-native/dev-middleware@0.76.9
@SocketSecurity ignore npm/@segment/analytics-react-native@2.20.3
@SocketSecurity ignore npm/canvas@3.1.0
@SocketSecurity ignore npm/react-native-svg@15.11.1
@SocketSecurity ignore npm/react-native@0.76.9
@SocketSecurity ignore npm/expo-manifests@0.15.8

  • multiple versions of same package are because we have both native (no framework) and expo
  • @vscode/sudo-prompt warning is from rncli
  • canvas (network, native code) is from detox

@sethkfman sethkfman added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Apr 30, 2025
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
77.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@sethkfman sethkfman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template No QA Needed Apply this label when your PR does not need any QA effort. no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.47.0 Issue or pull request that will be included in release 7.47.0 skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-mobile-platform Mobile Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.