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) #162803

Closed
mrienstra opened this issue Oct 6, 2022 · 2 comments
Closed

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

mrienstra opened this issue Oct 6, 2022 · 2 comments
Assignees

Comments

@mrienstra
Copy link
Contributor

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 issues 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 yarnpkg/berry#4895

See 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.

@joaomoreno
Copy link
Member

joaomoreno commented Oct 7, 2022

Thanks for the highly detailed recommendations. We'll keep this in mind, but we're not touching something which works just fine for now.

@joaomoreno joaomoreno closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2022
@jasonwilliams
Copy link
Contributor

jasonwilliams commented Nov 18, 2022

In an effort to reduce friction for new contributors I would like to recommend returning to npm. It's already pre-installed with Nodejs so devs can be up and running without needing to configure corepack or install an additional package manager.

I don't believe this project does anything yarn specific or uses any features npm doesn't support.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants