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

[1/3] upgrade react-native 0.71 #20799

Merged
merged 33 commits into from Jan 17, 2023
Merged

[1/3] upgrade react-native 0.71 #20799

merged 33 commits into from Jan 17, 2023

Conversation

Kudo
Copy link
Contributor

@Kudo Kudo commented Jan 12, 2023

Why

upgrade react-native 0.71 for sdk 48
close ENG-7192

How

  • update package versions
    • react: 18.1.0 -> 18.2.0
    • react-native 0.70.5 -> 0.71.0
    • react-dom: 18.1.0 -> 18.2.0
    • react-test-renderer: 18.1.0 -> 18.2.0
    • react-native-web: 0.18.9 -> 0.18.10
    • babel-plugin-react-native-web: 0.18.9 -> 0.18.10
    • metro-react-native-babel-preset: 0.72.3 -> 0.73.5
  • upgrade three project templates based on upgrade-helper
    • bare-expo
    • expo-template-bare-minimum
    • fabric-tester (this is based on npx expo prebuild --clean --no-install --template /path/to/expo-template-bare-minimum.tgz) so it includes some inconsistent changes
  • [@expo/config-plugins]: support 0.71 template transform. the namespace in build.gradle and the files in release build variants
  • [fbjni] upgrade 0.3.0 to align 0.71 (also ndk version)
  • [expo-updates] move the EX_UPDATES_NATIVE_DEBUG bundleInDebug setup to templates. unfortunately, because RNGP setups the task dependencies pretty early. the original setup in expo-updates build.gradle is too late. note that the change doesn't reference any files from templates to expo-updates package. somehow it's not tightly coupled.
  • [native-tests / expo-modules-test-core / expo-modules-autolinking] fix ios unit test build error because jsc now in a dedicated podspec. in theory, the ios native unit test could now run on hermes as well.
  • for other details, please check commit histories one by one.

Note

Test Plan

  • bare-expo ios / android
  • fabric ios / android
  • ci passed (except test-suite ios as mentioned)

Checklist

@linear
Copy link

linear bot commented Jan 12, 2023

Base automatically changed from @kudo/sdk48/vendor-reanimated to main January 12, 2023 12:14
const pattern = new RegExp(`applicationId ['"].*['"]`);
return buildGradle.replace(pattern, `applicationId '${packageName}'`);
const pattern = new RegExp(`(applicationId|namespace) ['"].*['"]`, 'g');
return buildGradle.replace(pattern, `$1 '${packageName}'`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[@expo/config-plugins]: support 0.71 template transform. the namespace in build.gradle and the files in release build variants
cc @EvanBacon

Copy link
Contributor

Choose a reason for hiding this comment

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

A test would be good here but otherwise this looks good to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will follow up in separated pr 👍

appProjectExt.react.devDisabledInDebug = true
}
}
def ex_updates_native_debug = System.getenv("EX_UPDATES_NATIVE_DEBUG") == "1" ? "true" : "false"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[expo-updates] move the EX_UPDATES_NATIVE_DEBUG bundleInDebug setup to templates. unfortunately, because RNGP setups the task dependencies pretty early. the original setup in expo-updates build.gradle is too late. note that the change doesn't reference any files from templates to expo-updates package. somehow it's not tightly coupled.
cc @douglowder

@Kudo Kudo changed the title Upgrade react-native 0.71 [1/2] upgrade react-native 0.71 Jan 16, 2023
@Kudo Kudo mentioned this pull request Jan 16, 2023
3 tasks
Copy link
Member

@tsapeta tsapeta left a comment

Choose a reason for hiding this comment

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

🚀

fastlane/Fastfile Outdated Show resolved Hide resolved
@expo-bot
Copy link
Collaborator

Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines.

I've found some issues in your pull request that should be addressed (click on them for more details) 👇

⚠️ Suggestion: Missing changelog entries


Your changes should be noted in the changelog. Read Updating Changelogs guide and consider adding an appropriate entry to the following changelogs:


Generated by ExpoBot 🤖 against 8ec8807

@Kudo Kudo changed the title [1/2] upgrade react-native 0.71 [1/3] upgrade react-native 0.71 Jan 17, 2023
@Kudo
Copy link
Contributor Author

Kudo commented Jan 17, 2023

i'm going to merge this pr. if there's any feedback from post-review, please let me know, and i'll follow up separately.

@Kudo Kudo merged commit 84f418d into main Jan 17, 2023
@Kudo Kudo deleted the @kudo/rn071 branch January 17, 2023 17:25
Kudo added a commit that referenced this pull request Jan 17, 2023
# Why

follow up #20799 for react-native 0.71 upgrade. this pr aims for jest upgrade and fix all broken tests.
close ENG-7192

# How

- upgrade packages
  - `jest: ^26.0.24 -> ^29.2.1`
  - `jest-watch-typeahead: 0.6.4 -> 2.2.1`
  - `@types/jest: ^26.0.24 -> ^29.2.1`
  - `babel-jest: ^26.6.3 -> ^29.2.1`
  - `@jest/create-cache-key-function: ^27.0.1 -> ^29.2.1`
  - `@babel/preset-env: ^7.12.9 -> ^7.14.0`
  - `eslint: ^8.20.0 -> ^8.29.0`
  - add `jest-environment-jsdom` because new jest does not include it by default
- [core] fix `SyntheticPlatformEmitter` type error. originally it refers to `react-native/Libraries/EventEmitter/RCTDeviceEventEmitter` internal file which has incorrect type setup in 0.71. we could use the `react-native.DeviceEventEmitter` instead.
- [expo-linking]: remove the deprecated `Linking.removeEventListener` (which is also removed from upstream)
- [firebase-recaptcha] remove broken web test because firebase ESM which is not supported by jest. this pr simply remove the test case because the package is deprecated.
- [jest-expo-enzyme] remove this package and move to [the archived repo](https://github.com/expo/jest-expo-enzyme). enzyme cannot upgrade to jest 29.
- remove `@types/react-native` and the versioned cli package check. because 0.71 ships the types directly.
- [ncl] workaround `@react-native-community/slider`, `@react-native-segmented-control/segmented-control`, and `@react-native-masked-view/masked-view` type errors in the `react-native-71-fix.d.ts`.
- for other details, please check the commit histories one by one.

# Test Plan

- ci passed
- for test-suite ios ci error, i've mentioned in #20799
Kudo added a commit that referenced this pull request Jan 19, 2023
# Why

follow up #20799 (comment) to add unit test for build.gradle namespace updates

# How

add namespace unit test

# Test Plan

ci passed
Kudo added a commit that referenced this pull request Feb 2, 2023
follow up #20799 and #20832 to update meaningful changelogs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: suggestions ExpoBot has some suggestions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants