-
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: improve flow in init
command on higher Yarn versions
#1931
fix: improve flow in init
command on higher Yarn versions
#1931
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.
blocking for merging until the yarn v3 concern is addressed
node-modules
as nodeLinker
in init
commandinit
command on higher Yarn versions
The ideal approach would be to set the Yarn version in the project itself than relying on global Yarn. There being fundamental differences and breaking changes between the Yarn versions, this approach allows users to work on multiple projects needing different Yarn versions. This is also recommended workflow for Yarn >= 2 - if people want to use newer Yarn, then they need to run However we can do similar for Yarn 1 too, something like: |
I would like to renew discussion under this pull request, because it is getting a little bit stale. @satya164 Thanks for feedback! I think your point is very interesting, but it may be hard to implement. The current implementation is more flexible to me. I think we cannot specify Yarn version in template, and we actually don't know what version user wants to use because it depends on preferences, what Yarn version project is using etc. |
Why is it hard to implement? It's just running one command one in the project. It is also recommended workflow for Yarn 2. We can add
IMO trying to support multiple versions of Yarn means more effort maintaining it. is there a reason anyone actually would want to stay on old version of Yarn? I have only seen people stay on Yarn 1 because they thought that Yarn >= 2 doesn't work with React Native. |
After some internal discussion with @satya164, we came to conclusion that actually it would be better and easier in long term to provide default Yarn version in React Native template, but are there any blockers from providing default Yarn version >=2 (of course with |
Not quite a blocker, but can still be annoying, is that Yarn >= 2 always patches TypeScript, regardless of whether you use PnP. This might break if your TypeScript version is ahead. If we really are going down this path, I would recommend v3 over v2. |
There hasn't been any activity on this pull request in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
There hasn't been any activity on this pull request in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
Summary:
Closes #1637
Closes #1912
This PR improves flow creating project when user has higher Yarn version.
Test Plan:
It should ask to create
.yarnrc.yml
inside project or to use Yarn Classic.4. Install yarn at version 3.x.x.
5. Run this command:
It should detect your
.yarnrc.yml
and check whatnodeLinker
is specified. If it isn'tnode-modules
, CLI should ask to change it.6. Install yarn at version 1.x.x.
7. Run this command:
It should create project correctly.