-
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
feat: use Yarn v3 with nodeLinker: node-modules
for new projects
#2134
Conversation
9afaa54
to
4457c77
Compare
One note here is that Yarn v4 was released few days ago, and it is working with React Native properly. With this change we're aiming for 0.74 so until that time it will be tested well in various production environments. Also Yarn v4 had 53 releases so we can assume that team tested it well 😅 So let''s wait for some minor fixes that probably will be released, and then will finally bump to Yarn v4 in CLI - with current setup it is just changing number. |
c3bbbb5
to
b9fb423
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
71f3dce
to
a04a792
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.
Couple of questions/suggestions but LGTM in principle
await executeCommand('yarn', ['set', 'version', YARN_VERSION], { | ||
root, | ||
silent, | ||
}); |
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.
Just to check my understanding here - this will install the requested version via corepack if it isn't currently on the machine? What if corepack isn't enabled?
a8af0aa
to
1b47345
Compare
667da6d
to
bc0dc7d
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.
Seems to be working fine on my machine. Code also seems to be LGTMT +1
86ccccf
to
8f96a0e
Compare
8f96a0e
to
fac59f2
Compare
Summary: Recently inside React Native Community CLI we added bumping Yarn version inside `init` command, more information here: react-native-community/cli#2134. In this Pull Request I added required rules in `.gitignore` for new projects created. ## Changelog: [GENERAL] [ADDED] - Add Yarn files to `.gitignore` in template Pull Request resolved: #42313 Test Plan: 1. Follow [Contributing guide](https://github.com/react-native-community/cli/blob/main/CONTRIBUTING.md) from React Native Community CLI repository to setup locally newest version of CLI. 2. Run this command: ```sh node /path/to/react-native-cli/packages/cli/build/bin.js init --template path/to/template ``` 3. Appropriate should be ignored. Reviewed By: NickGerleman Differential Revision: D52907962 Pulled By: cortinico fbshipit-source-id: f12dce8836e7e94257f8c690434b11227aa46446
Summary: Recently inside React Native Community CLI we added bumping Yarn version inside `init` command, more information here: react-native-community/cli#2134. In this Pull Request I added required rules in `.gitignore` for new projects created. ## Changelog: [GENERAL] [ADDED] - Add Yarn files to `.gitignore` in template Pull Request resolved: facebook/react-native#42313 Test Plan: 1. Follow [Contributing guide](https://github.com/react-native-community/cli/blob/main/CONTRIBUTING.md) from React Native Community CLI repository to setup locally newest version of CLI. 2. Run this command: ```sh node /path/to/react-native-cli/packages/cli/build/bin.js init --template path/to/template ``` 3. Appropriate should be ignored. Reviewed By: NickGerleman Differential Revision: D52907962 Pulled By: cortinico fbshipit-source-id: f12dce8836e7e94257f8c690434b11227aa46446 Original: facebook/react-native@965f2eb
Summary: Recently inside React Native Community CLI we added bumping Yarn version inside `init` command, more information here: react-native-community/cli#2134. In this Pull Request I added required rules in `.gitignore` for new projects created. ## Changelog: [GENERAL] [ADDED] - Add Yarn files to `.gitignore` in template Pull Request resolved: facebook/react-native#42313 Test Plan: 1. Follow [Contributing guide](https://github.com/react-native-community/cli/blob/main/CONTRIBUTING.md) from React Native Community CLI repository to setup locally newest version of CLI. 2. Run this command: ```sh node /path/to/react-native-cli/packages/cli/build/bin.js init --template path/to/template ``` 3. Appropriate should be ignored. Reviewed By: NickGerleman Differential Revision: D52907962 Pulled By: cortinico fbshipit-source-id: f12dce8836e7e94257f8c690434b11227aa46446 Original-Commit: facebook/react-native@965f2eb
Summary: Recently inside React Native Community CLI we added bumping Yarn version inside `init` command, more information here: react-native-community/cli#2134. In this Pull Request I added required rules in `.gitignore` for new projects created. ## Changelog: [GENERAL] [ADDED] - Add Yarn files to `.gitignore` in template Pull Request resolved: facebook/react-native#42313 Test Plan: 1. Follow [Contributing guide](https://github.com/react-native-community/cli/blob/main/CONTRIBUTING.md) from React Native Community CLI repository to setup locally newest version of CLI. 2. Run this command: ```sh node /path/to/react-native-cli/packages/cli/build/bin.js init --template path/to/template ``` 3. Appropriate should be ignored. Reviewed By: NickGerleman Differential Revision: D52907962 Pulled By: cortinico fbshipit-source-id: f12dce8836e7e94257f8c690434b11227aa46446 Original-Commit: facebook/react-native@965f2eb
Sorry if this is not the right forum or if this is too much of a qualitative judgement, but I'd like to share my thoughts. Yarn Modern is less popular than Yarn Classic. While Yarn Classic is deprecated (and to be fair, subtly broken in different ways), Yarn Modern hasn't shown enough resiliency and it's long term success is far from guaranteed. Forcing new projects to start with Yarn v3 may send them on a path where they may end up with an unmaintained package manager few years down the track. Is it a prudent decision to switch new projects to Yarn Modern, especially for users who are just starting out with React Native? NPM would be a much sure choice. |
Summary:
Closes #1931
When creating new project we'll try to bump Yarn version to v3. We'll only do this if:
and the Yarn version in the location is Yarn Classicbc8aaaaTest Plan:
Checklist