-
Notifications
You must be signed in to change notification settings - Fork 905
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
fix: Drop @react-native/metro-config dep for RN 0.72 config fallback #1899
fix: Drop @react-native/metro-config dep for RN 0.72 config fallback #1899
Conversation
8032e95
to
19a07b6
Compare
"metro-react-native-babel-transformer": "0.76.0", | ||
"metro-resolver": "0.76.0", | ||
"metro-runtime": "0.76.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getPolyfills: () => | ||
require(path.join(ctx.reactNativePath, 'rn-get-polyfills'))(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deviates from @react-native/metro-config
, which references the standalone package @react-native/js-polyfills
(technically, this was/is the first circular dep edge case!). These are equivalent, but allows this repo to not reference the RN-hosted package (see removal in yarn.lock
).
"@react-native/js-polyfills@^0.73.0": | ||
version "0.73.0" | ||
resolved "https://registry.yarnpkg.com/@react-native/js-polyfills/-/js-polyfills-0.73.0.tgz#d1becae77740c705392122684a55b373e610ab63" | ||
integrity sha512-3/+q+l86xvV8xjx29On9/Dn0eWjo5MHYuuALHqyOlQIs3vLk/rQB4rn4izObiurhH3utXxqVnbOk+TB9yJo4ng== | ||
|
||
"@react-native/metro-config@^0.73.0": | ||
version "0.73.0" | ||
resolved "https://registry.yarnpkg.com/@react-native/metro-config/-/metro-config-0.73.0.tgz#7601d2f4ba2252a4e359f8fda21008daf5f31eb2" | ||
integrity sha512-b+q8Ot6nxPE2PXEua20Q0vhXYpVtVjUaTX/hv+7mL5hLzKeIWq/bIxF04GLWT93BBjGSlL0xaZ7iGIQNN75Hog== | ||
dependencies: | ||
"@react-native/js-polyfills" "^0.73.0" | ||
metro-config "0.76.0" | ||
metro-react-native-babel-transformer "0.76.0" | ||
metro-runtime "0.76.0" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All dependencies on packages published from facebook/react-native
are dropped.
Context
React Native Metro config → React Native repo (facebook/react-native#36502)
This is a follow up to #1896.
Unfortunately the most recent CLI release was auto-consumed in React Native's CI, exposing a blocker where we could not consume the (repo-)circular dependency
react-native
→@react-native-community/cli-plugin-metro
→@react-native/metro-config
— I 100% jumped the gun on this setup(!).While this is now mitigated by the new CLI release process, and possible in practice, we're opting to remove this circular setup as it would introduce maintenance headaches while we are working across two repos.
Changelog: Internal
This is an architectural simplification targeting React Native
main
(0.73). However it is also worth cherry picking this commit to RN CLI10.x
(targeting RN 0.72), so that we can once again bump all local Metro dependencies here (and replicate those bumps in both11.x
and10.x
). cc @robhogan @cipolleschiOpen as #1901.
Changes
@react-native/metro-config
dependency fromcli-plugin-metro
.@react-native/metro-config
default config withincli-plugin-metro
(to be used in the fallback case only).Note: An alternative approach for this is
peerDependencies
, but given the recent issues and how this might affect strict internal and open source CI, I'm opting for the absolutely bulletproof solution.Test Plan
(Repeats test plan instructions from #1896).
@react-native/metro-config
)@react-native/metro-config
)✅ Identical configs are produced
(With only path changes from
yarn link
)