Skip to content
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

Migrate to pnpm or Yarn 3 (from Yarn 1) #9487

Open
VSCodeTriageBot opened this issue Oct 6, 2022 · 0 comments
Open

Migrate to pnpm or Yarn 3 (from Yarn 1) #9487

VSCodeTriageBot opened this issue Oct 6, 2022 · 0 comments

Comments

@VSCodeTriageBot
Copy link
Owner

As the Yarn 1 repo says:

-- ℹ️ Important note

This repository holds the sources for Yarn 1.x (latest version at the time of this writing being 1.22). New releases (at this time the 3.2.3, although we're currently working on our next major) are tracked on the yarnpkg/berry repository, this one here being mostly kept for historical purposes and the occasional hotfix we publish to make the migration from 1.x to later releases easier.

If you hit bugs or - with Yarn 1.x, we strongly suggest you migrate to the latest release - at this point they have been maintained longer than 1.x, and many classes of problems have already been addressed there. By using the nodeLinker setting you'll also have the choice of how you want to install your packages: node_modules like npm, symlinks like pnpm, or manifest files via Yarn PnP.

Yarn timeline (partial):

  • January 2019: Work on Yarn 2 began.
  • January 2020: Yarn 2 released.
  • February 2020: Yarn v1.22.0 released.
  • July 2021: Yarn 3 released.
  • May 2022: Yarn v1.22.19 released. This is likely the last Yarn 1 release.

I realize this might be a big change, but it seems like one of those things that is better to tackle sooner rather than later.

-- pnpm

pnpm seems to be very popular nowadays, a lot of high-profile open source projects are using it.

Migrating to pnpm would likely require moving from dependabot to renovatebot (see dependabot/dependabot-core-1736).

Here are some yarn --> pnpm migration PRs:

yarn --> pnpm migration commits (couldn't locate PRs):

Microsoft open source projects using pnpm:

Also using pnpm:

-- Yarn 4

Yarn 4 hasn't quite made it to 4.0.0 status, but it is available to try via yarn set version canary. The official word is that it "may take a couple more months"), but also:

[...] what's in master is stable, and I'd recommend you to try it. The only notable difference with stable is that we reserve the right to land a couple more breaking changes in future RCs, but in terms of stability it's almost always better to use RCs than stable.

... according to https://github-com/yarnpkg/berry/discussions/4895

See https://github-com/yarnpkg/berry/-/3591 for v4 breaking changes. I've seen two mentions of people stumbling over enableGlobalCache default changing from false to true. (Google search: site:yarnpkg.com "enableGlobalCache")

If Yarn 2+ is chosen, to me it makes more sense to go straight to Yarn 4, rather than Yarn 3. It just seems like a better foundation from which to be prepared for the "ESM future".

PS: I clearly put a lot more time into sharing pnpm resources, if anyone wants to do the same for Yarn 4 (or 3), please do & I'm more than happy to edit the above accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant