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

[template] switch from @types/jest to @jest/globals #36068

Closed
wants to merge 4 commits into from
Closed

[template] switch from @types/jest to @jest/globals #36068

wants to merge 4 commits into from

Conversation

UNIDY2002
Copy link
Contributor

Summary

Originally proposed in react-native-community/discussions-and-proposals#592

Main changes are:

  • Explicitly importing the global APIs in App.test.tsx
  • Drop @types/jest from the devDependency list

Benefits of these changes will be:

  • Keep in line with Jest's recommended practice
  • Remove a dev-dependency to make dependencies slimmer

References:

Changelog

[GENERAL] [CHANGED] - Switch from @types/jest to @jest/globals for new react-native projects

Test Plan

  1. Create a new RN project from the modified template
  2. Ensure yarn test passes
  3. Ensure IDEs do not complain about App.test.tsx

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 6, 2023
@analysis-bot
Copy link

analysis-bot commented Feb 6, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,474,720 +0
android hermes armeabi-v7a 7,796,363 +0
android hermes x86 8,950,597 +0
android hermes x86_64 8,808,262 +0
android jsc arm64-v8a 9,657,116 +0
android jsc armeabi-v7a 8,392,360 +0
android jsc x86 9,720,735 +0
android jsc x86_64 10,197,385 +0

Base commit: 5b8faae
Branch: main

@facebook-github-bot
Copy link
Contributor

@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Feb 7, 2023
@facebook-github-bot
Copy link
Contributor

@cortinico merged this pull request in 9af3c96.

@UNIDY2002 UNIDY2002 deleted the jest-types branch February 7, 2023 14:28
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
Originally proposed in react-native-community/discussions-and-proposals#592

Main changes are:
- Explicitly importing the global APIs in `App.test.tsx`
- Drop `types/jest` from the devDependency list

Benefits of these changes will be:
- Keep in line with Jest's recommended practice
- Remove a dev-dependency to make dependencies slimmer

References:
- jestjs/jest#13133
- DefinitelyTyped/DefinitelyTyped#62037

## Changelog

[GENERAL] [CHANGED] - Switch from `types/jest` to `jest/globals` for new react-native projects

Pull Request resolved: facebook#36068

Test Plan:
1. Create a new RN project from the modified template
2. Ensure yarn test passes
3. Ensure IDEs do not complain about `App.test.tsx`

Reviewed By: cipolleschi

Differential Revision: D43080151

Pulled By: cortinico

fbshipit-source-id: c9161cb930c78f3a1eaa08ccb6483aa38d52fa3c
Kudo added a commit to expo/expo that referenced this pull request Jun 7, 2023
# Why

upgrade react-native 0.72 for sdk 49
close ENG-8011

# How

- bump package versions
  - `react-native 0.71.3 -> 0.72.0-rc.5`
  - `metro-react-native-babel-preset 0.73.9 -> 0.76.5`
- [bare-expo][templates][fabric-tester] migrate template base on [upgrade-helper](https://react-native-community.github.io/upgrade-helper/?from=0.71.7&to=0.72.0-rc.5)
- [expo-template-tabs] remove the metro version overrides for expo-router.
- [core][dev-laucher][dev-menu][media-library][screen-orientation][splash-screen][updates-interface][updates] add the `install_modules_dependencies` to support new architecture + use_frameworks!
- [core][autolinking] fix some new architecture error on ios
- [react-native-lab] update our fork to 0.72.0-rc.5 based
- [go][tools] fix **react-native-lab/react-native/packages/react-native** path move because of react-native's repo monorepo changes
- [go][android] fix gradle 8 errors
- [go][ios] add `RCT_REMOTE_PROFILE=0` to fix the `RCT_ENABLE_INSPECTOR needs to be set to fulfill RCT_REMOTE_PROFILE` build error
- [ncl] remove `ProgressViewIOS` / `ProgressBarAndroid` since they are deprecated/removed in 0.72
- [dev-menu][dev-launcher] rebuild bundles

# Note

- react-native-web is not bumped because of the [issue](necolas/react-native-web#2523), so it's still react-native-web@~0.18.10.
- currently disable ci typecheck for @expo/cli because of upstream metro typescript support. i'll have another pr to fix those errors.
- updates e2e ci on android is broken at [here](https://github.com/expo/expo/blob/fada3d764957779fbfc3d7b723d185db1d933d95/packages/expo-updates/e2e/fixtures/Updates.e2e.ts#L518). i doubt if that's related to the react scheduler change. i'd disabled the failed test case.
- the react-native upstream [migrated away the `@types/jest`](facebook/react-native#36068). i was afraid that will be a breaking change to the existing jest test code since it requires the explicit `@jest/globals` import. i didn't do this in this upgrade.

# Test Plan

- ✅ fabric-tester (without expo-dev-client)
- ✅ ci passed. there are some errors which are known:
  - updates e2e on android: as mentioned above
  - ios expo go on eas build: versioned expo go are broken on eas build m1 worker. this is also happening on main.
  - android client: no space left on the ubuntu worker. this is also happening on main.
- ✅ bare-expo
- ✅ unversioned expo go + ncl

---------

Co-authored-by: Tomasz Sapeta <tomasz.sapeta@swmansion.com>
nahn20 pushed a commit to nahn20/expo-media-library that referenced this pull request Mar 4, 2024
# Why

upgrade react-native 0.72 for sdk 49
close ENG-8011

# How

- bump package versions
  - `react-native 0.71.3 -> 0.72.0-rc.5`
  - `metro-react-native-babel-preset 0.73.9 -> 0.76.5`
- [bare-expo][templates][fabric-tester] migrate template base on [upgrade-helper](https://react-native-community.github.io/upgrade-helper/?from=0.71.7&to=0.72.0-rc.5)
- [expo-template-tabs] remove the metro version overrides for expo-router.
- [core][dev-laucher][dev-menu][media-library][screen-orientation][splash-screen][updates-interface][updates] add the `install_modules_dependencies` to support new architecture + use_frameworks!
- [core][autolinking] fix some new architecture error on ios
- [react-native-lab] update our fork to 0.72.0-rc.5 based
- [go][tools] fix **react-native-lab/react-native/packages/react-native** path move because of react-native's repo monorepo changes
- [go][android] fix gradle 8 errors
- [go][ios] add `RCT_REMOTE_PROFILE=0` to fix the `RCT_ENABLE_INSPECTOR needs to be set to fulfill RCT_REMOTE_PROFILE` build error
- [ncl] remove `ProgressViewIOS` / `ProgressBarAndroid` since they are deprecated/removed in 0.72
- [dev-menu][dev-launcher] rebuild bundles

# Note

- react-native-web is not bumped because of the [issue](necolas/react-native-web#2523), so it's still react-native-web@~0.18.10.
- currently disable ci typecheck for @expo/cli because of upstream metro typescript support. i'll have another pr to fix those errors.
- updates e2e ci on android is broken at [here](https://github.com/expo/expo/blob/fada3d764957779fbfc3d7b723d185db1d933d95/packages/expo-updates/e2e/fixtures/Updates.e2e.ts#L518). i doubt if that's related to the react scheduler change. i'd disabled the failed test case.
- the react-native upstream [migrated away the `@types/jest`](facebook/react-native#36068). i was afraid that will be a breaking change to the existing jest test code since it requires the explicit `@jest/globals` import. i didn't do this in this upgrade.

# Test Plan

- ✅ fabric-tester (without expo-dev-client)
- ✅ ci passed. there are some errors which are known:
  - updates e2e on android: as mentioned above
  - ios expo go on eas build: versioned expo go are broken on eas build m1 worker. this is also happening on main.
  - android client: no space left on the ubuntu worker. this is also happening on main.
- ✅ bare-expo
- ✅ unversioned expo go + ncl

---------

Co-authored-by: Tomasz Sapeta <tomasz.sapeta@swmansion.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants