-
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
breaking: Remove fallback flow for Metro config defaults (0.73) #1972
breaking: Remove fallback flow for Metro config defaults (0.73) #1972
Conversation
This ties the move of the |
@thymikee It does — I was aiming to stack a sequence of simplification changes, including this PR, here in the CLI repo first. This is to slightly reduce the surface area that we are migrating into the RN repo (and from TypeScript into Flow 🙈). A change like this also gets better visibility in this repo for now. |
added a mention here reactwg/react-native-releases#64 so that we/the 73 release crew won't forget that there's BC on this angle |
7b54f4e
to
054d6e6
Compare
@kelset Sidenote: I'm looking to merge this change ahead of work to migrate and collapse With some over-the-weekend reflection — the flow in this PR should probably hard-error (helpful in particular to pin down this error cause in CI) ➡️ update incoming. For the user, it might be better if we allowed the entire |
054d6e6
to
cb75678
Compare
Latest push
✅ Ready for review |
); | ||
From React Native 0.73, your project's Metro config should extend '@react-native/metro-config' | ||
or it will fail to build. Please copy the template at: | ||
https://github.com/facebook/react-native/blob/main/packages/react-native/template/metro.config.js |
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.
Wonder if this should be pinned (at least to a branch) so it remains accurate in the future.
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.
Yeah fair. We don't have 0.73-stable
yet — and the counter-risk is pointing to a stale copy. Will keep an eye on it.
Summary
This follows up the
@react-native/metro-config
setup added in React Native 0.72. It removes the fallback to a replicated internal copy of Metro config defaults incli-plugin-metro
, effectively reverting #1896.Rollout plan recap:
@react-native/metro-config
is recommended, but falls back if users have not updated theirmetro.config.js
, logging a warning.metro.config.js
to the new format is required — log warning and (later on) fail.Changelog: [Breaking] Remove fallback flow for Metro config defaults (React Native 0.73)
Test Plan
Using
rn-tester
configured with a locallyyarn link
ed copy of RN CLI.✅ Correct config logs no warning and builds successfully
✅ Incorrect config logs updated warning and fails
⬇️ FYI @cortinico @kelset, in case you have opinions for better DevX. It is marginally restrictive that we require a reference toAddressed with more visible warning.@react-native/metro-config
in the immediatemetro.config.js
file — perhaps if we detect this more strongly we can fail rather than warn. However I can't think of a simple way to do this — and we will have had the 0.72 release cycle for people to update their projects by this point.