-
Notifications
You must be signed in to change notification settings - Fork 258
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
Considering Yarn Berry (2.0+) #651
Comments
Got a speedy reply from the yarn team:
So, key takeway—volta's detection of the latest yarn version can stay the same, but detection of available releases should be changed. As currently setup, when the yarn team officially switches the latest version to 2.x, volta will be unable to resolve the version and fail to install yarn. Perhaps instaling yarn should just use the existing package resolution? https://github.com/volta-cli/volta/blob/master/crates/volta-core/src/tool/package/resolve.rs |
We definitely should look at supporting Yarn 2.0. The resolution issues we'll need to be aware of, if needed we can use the package resolution, though that has its own issues since the package that comes from Ideally, Yarn will start providing a tarball again (their docs say that the "other" installers will be available soon), so if that's the case then we can start using that with whatever index Yarn provides. Additionally, it looks like we need to support Yarn Plug'n'Play, because it appears that Yarn 2.0 is fully built on that. I think that's a relatively simple change, but we'd need to test it to be sure. We already had supporting custom |
@zackkrida Thanks for compiling all of that documentation in the issue, and for checking with the Yarn team! That makes evaluating the changes a lot easier! |
Related: earlier discussion of Yarn Plug'n'Play occurred at #158. |
We should at least be able to install and use berry without issues related to volta, since running @zackkrida suggestion seems great 👍 Details:
And the recommended command won't run either:
|
Update on this: The core installation support for Yarn 2.0 should be fixed as of Volta 0.8.7. The Plug'n'Play issues outlined in #158 are still outstanding, and will cause globals that are trying to delegate to the local project to fail (since they look in |
@charlespierce yarn 2 installation is still not working... It looks like yarn has not been releasing 2.x to npm: https://www.npmjs.com/package/yarn |
@billyvg That's a good find, thanks! It looks like Yarn has silently changed their behavior with how they provide their binaries. We'll likely need to investigate deeper if there's a way we can download the packages from the same source that Yarn uses internally in order to provide the appropriate versions. To use Yarn 2 for the time being, I would recommend using Volta to set a 1.* version of Yarn as your default, and then not pinning Yarn in the |
I did what @charlespierce suggested on a recent project and it actually worked really well! Volta still manages the Yarn 1 installation but delegates all "real" operations to the local Yarn 2 install. The local experience and using the GitHub Action for Volta both work great this way! |
Hi, I installed yarn@berry with volta, but it says versino v2.0.0-rc27. I tried to run |
Hi @ishiijp, as mentioned above, it appears that Yarn has decided to not publish new versions in the npm registry, which is where Volta gets its information. As a result, we don't currently support Yarn 2 within Volta itself. The recommended way forward is to follow Yarn's installation instructions to install Yarn 1 globally (which will be managed by Volta), then use We may, at some point, support fetching Yarn 2 from whatever source they are using now, however since that method changed at least once without a major version bump, I'm a little wary of tying our implementation to details of Yarn that aren't considered pubic API. |
@charlespierce |
This upgrades to yarn2 (codename: berry). Does *NOT* use PnP as it will require some work to get working. We can not use volta because yarn2 is not fully supported, see volta-cli/volta#651
Update: I've just published |
@arcanis Awesome, thank you! Out of curiosity, is there any way to backport release the older Yarn 2 versions through that package as well? It's not a major issue if not, since Volta currently doesn't support directly pinning Yarn 2 at all, so we can say that 2.4.1 is the earliest that we support and it will still be an improvement over the status quo. |
You can also fetch the CLI from GitHub
|
@merceyz That's true! The concern we have with using GitHub directly (we actually initially did that for Yarn 1 in the early days of Volta) is the rate-limiting on GitHub API requests. We ran into that a lot, especially in CI / testing environments when we made multiple requests for information in quick succession. Another concern with fetching only the raw JS file is that we then need to duplicate some of the work that the package manager does to make sure that file is callable on every system (e.g. adding shims / scripts to Windows where the Actually looking at it @arcanis it looks like that |
Resolved in the sense of opening a ticket for yarn-3.x, right? |
@MichalBryxi Well, :D since v2 was never supported in Volta, there is a little point in supporting it since v3 should be better in every way. I guess this issue can really be closed and superseded by a new ticket for v3, as you suggest. From the discussion above, I got an impression that after v3 release, the actual problems blocking support of new Yarn versions will be gone, but maybe I misunderstood |
Yarn has been rewritten from scratch, and this effort was called "Yarn codename Berry". Their repo is called berry. Both Yarn v2 and v3 belong to the same Berry codebase. They have the same API. If I'm not mistaken, this issue can be renamed from "Yarn 2.0" to "Yarn Berry" without any changes to its description or conclusions. |
Just for my information, now with the latest Berry should everything be working, or is there something left to be done here? |
Not sure what's the status here but it seems to me:
Then I'm just not sure what this was for:
Is it so that support for this on Volta's side is still missing? |
As mentioned here #651 (comment), the shims are included in @yarnpkg/cli-dist 2.4.2 and up. So volta can support yarn v1.x.x using the package source it uses today, and yarn >= 2.4.2 using npm @yarnpkg/cli-dist Versions >=2 and <2.4.2 will be unsupported. Can this be implemented using hooks? I believe it will need to be |
@cspotcode Yes, as a short-term solution this can definitely be implemented using |
@charlespierce would you be able to provide an example of how to use yarn 3 using hooks? |
@charlespierce any updates on whether this is still being explored? |
I was trying to use Volta to handle my node versions but till this feature is not resolved I prefer to use nvm |
For the time being, is there a way I can have volta explicitly not manage I've read through many of these yarn related issues and it seems to me I cannot install yarn 3 alongside Volta (on Windows at least). The migration path for 1 -> 3 involves installing version 2, which can be installed but fails as expected on the symlinks. |
@jmathew This is actively being worked on right now. That said, in the interim, if you don't configure |
@charlespierce Could you elaborate on how to not configure I just installed Volta v1.0.8, ran
I understand I can work around the issue with |
@charlespierce I would love to use Volta but have a hard requirement for yarn v3. I am fine with a workaround if it exists though. Is yarn v3 in the pipeline to integrate? |
I like Volta and all the work the team does but I feel that you have not imagined how important it is for us to have yarn updated to v3+, it's the only reason why I don't use it in work-related projects or personal ones. It has been 2 years since this issue has been open... please do something I'll appreciate it. Regards |
@JanJakes previously mentioned this, but if you keep yarn pinned to the latest of the 1.x line with volta, and use |
@david2am I don't work on Volta, just a user like yourself. I also have no need for Yarn 2 support anymore so I'm going to unfollow this issue. Best of luck. |
Hey folks, Volta did actually recently implement Yarn 3 support: see volta-cli/rfcs#48 for background and #1193, #1204, and #1230 for implementation. We're in the process of doing a bunch of QA via rolling it out internally at LinkedIn at present. Also, a friendly reminder for folks like @david2am – we understand quite well and we’ve all wanted this for quite some time. But as with all open source work, it gets done either (a) on people's personal time, which is not great; or (b) when a company is able to fund it because it matters to that company, which is how this is eventually getting across the line. We also welcome contributions and are happy to provide input and guidance on things! That's how the |
Sorry for the pressure guys, my bad... 😓 @chriskrycho thanks for your comment 👍🏻 |
No worries! Just figured I'd help everyone understand why these things take so long from the other side—we all get it and experience it ourselves as well! |
I think this can be closed; we have had Yarn 3 support for two years now! 🎉 |
Hi all! Yarn's team lead just released a blog post outlining the first stable release of version 2.
The yarn docs have also switched over to 2.0, with the old site moved to https://legacy.yarnpkg.com.
As far as I can tell, this means a couple of things for Volta:
yarn@berry
and since Yarn 2 is developed in a separate repo on GitHub from 1.x (https://github.com/yarnpkg/berry vs. https://github.com/yarnpkg/yarn), Volta's current list of Yarn releases doesn't support the 2x versions, since it uses the releases list for theyarnpkg/yarn
repo:volta/crates/volta-core/src/tool/yarn/resolve.rs
Line 30 in 8357854
Depending on if/when Yarn intends on moving the 2.x versions into the
yarnpkg/yarn
repo, this will fix itself, but I'm not sure if that is planned.volta/crates/volta-core/src/tool/yarn/resolve.rs
Line 34 in 8357854
to get the latest version of yarn. That link now redirects to the legacy site. I do not know if Yarn intends to add this page to the new site.
Both of these issues would be resolved by switching to the parsing the npm registry url for both the latest version and enabling installation of beta releases: https://registry.npmjs.org/yarn
I'm not sure of potential downsides to this approach.
Again, all of these issues may be resolved depending on how Yarn manages the official launch of version 2, but not sure.
The text was updated successfully, but these errors were encountered: