Skip to content

Commit

Permalink
Update Metro to ^0.80.0 - don't pin to exact version (facebook#41219)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#41219

Bump to the latest Metro release. This includes minor breaking changes to Metro subpackages that should *not* be visible to RN users.

Metro release notes: https://github.com/facebook/metro/releases/tag/v0.80.0

## Moving to unpinned versioning
Metro is a multi-package project, and not pinning to an exact version means multiple versions of `metro*` packages may appear in an RN project.

This isn't unusual in the NPM ecosystem and *shouldn't* be a problem, but historically has caused issues (eg facebook#34714, facebook/metro#1017). The root cause of all of these issues, as far as we know, was fixed in facebook/metro@6d46078, a bug where Node hierarchical resolution was effectively sidestepped via a relative worker path, resulting in a mismatch between transformer and host process.

In addition, the fact that `react-refresh`, `metro-react-native-babel-transformer` and `metro-react-native-babel-preset` are now fully moved into the `react-native/` scope and versioned with React Native means there are no circular dependencies between React Native and Metro, explicit or implicit, and we're much more clearly decoupled.

So, we're moving to caret versioning to allow React Native users to pick up Metro fixes and features without requiring React Native releases and user upgrades.

Changelog:
[General][Changed] - Update Metro to ^v0.80.0, stop pinning to an exact version

Reviewed By: GijsWeterings

Differential Revision: D50731999

fbshipit-source-id: 57b07bf73c0b31f392c4d36376ca48b48a8bd598
  • Loading branch information
robhogan authored and Othinn committed Oct 30, 2023
1 parent 9b50ad4 commit 7b61be0
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 168 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@
"jest": "^29.6.3",
"jest-junit": "^10.0.0",
"jscodeshift": "^0.14.0",
"metro-babel-register": "0.79.1",
"metro-memory-fs": "0.79.1",
"metro-babel-register": "^0.80.0",
"metro-memory-fs": "^0.80.0",
"micromatch": "^4.0.4",
"mkdirp": "^0.5.1",
"mock-fs": "^5.1.4",
Expand Down
8 changes: 4 additions & 4 deletions packages/community-cli-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
"@react-native/metro-babel-transformer": "^0.74.0",
"chalk": "^4.0.0",
"execa": "^5.1.1",
"metro": "0.79.1",
"metro-config": "0.79.1",
"metro-core": "0.79.1",
"metro": "^0.80.0",
"metro-config": "^0.80.0",
"metro-core": "^0.80.0",
"node-fetch": "^2.2.0",
"readline": "^1.3.0"
},
"devDependencies": {
"metro-resolver": "0.79.1"
"metro-resolver": "^0.80.0"
},
"engines": {
"node": ">=18"
Expand Down
4 changes: 2 additions & 2 deletions packages/metro-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@react-native/metro-babel-transformer": "^0.74.0",
"@react-native/js-polyfills": "^0.74.0",
"metro-config": "0.79.1",
"metro-runtime": "0.79.1"
"metro-config": "^0.80.0",
"metro-runtime": "^0.80.0"
}
}
4 changes: 2 additions & 2 deletions packages/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@
"jest-environment-node": "^29.6.3",
"jsc-android": "^250231.0.0",
"memoize-one": "^5.0.0",
"metro-runtime": "0.79.1",
"metro-source-map": "0.79.1",
"metro-runtime": "^0.80.0",
"metro-source-map": "^0.80.0",
"mkdirp": "^0.5.1",
"nullthrows": "^1.1.1",
"pretty-format": "^26.5.2",
Expand Down
Loading

0 comments on commit 7b61be0

Please sign in to comment.