-
Notifications
You must be signed in to change notification settings - Fork 896
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: update react-native version in the template for versions >= 0.75. #2417
Conversation
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.
LGTM
2887f96
to
4e3eb5a
Compare
Discussed offline with @blakef: We also need all the deps inside |
Done. |
271bcc8
to
eb3d337
Compare
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.
LGTM but left a couple of nits
bdf287d
to
9e4131b
Compare
The new template handling in @react-native-community/template means that these are shipped with version 1000.0.0 for React Native. The CLI now owns this.
1. Allow using both of these, but only when the user specifies a version of react-native >= 0.75. Since templates are now detached there are valid use cases for developers and users to specify a template. Added a warning about this test(scope): title 2. Exit early for 0.75+ when we can't find a matching @react-native-community/template to the version of react-native. These should always be matching, but allow for users to remidy this by specifying a template. Clearly this should never happen though. I've also gone to some effort to use concrete versions in the code when tags are passed. E.g. --version next, currently maps to 0.75.0-rc0. We use the latter when looking up templates.
From 0.75 our @react-native/ dependencies must match the version of react-native. Updated init to perform this on @react-native-community/template.
9e4131b
to
fba1546
Compare
The new template handling in @react-native-community/template means that these are shipped with version 1000.0.0 for React Native. The CLI now owns having to update to the correct version.
NOTE: This will only apply if the template has a
react-native@1000.0.0
, i.e. is from@react-native-community/template
.Summary:
--template
and--version
when--version
is >= 0.75. Added a warning about doing this, but it's valid if the user gets into trouble or more advanced users want to do fun stuff.@react-native/
scoped dependencies must match the version ofreact-native
.init
now enforces this.@react-native-community/template
will release matching version for each React Native release. It's important to normalise version at the time of constructing the project otherwise the template will gradually become invalidate asreact-native@latest
(for example) moves.For example, now running:
Updated
react-native
version on templateAdded some logs for the version update in the template
Scoped Version Matching
Test Plan:
Checklist