berry: 🚀 Breaking changes for Yarn 4

This issue is just there to keep track of which changes we might want to do once we’ll get to the next major release. Doesn’t mean it’ll be anytime soon 🙂 Will be updated as time passes and we think about more things.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 91
  • Comments: 36 (15 by maintainers)

Most upvoted comments

This is a no-go for OSS devs. E.g. I run vite-plugin-ssr’s test suite against Node 12 to make sure vite-plugin-ssr works with Node 12.

We don’t intend to support Node versions that aren’t maintained anymore by Node themselves. Not only to make our life easier, but also because some of our dependencies do that too, and need to be kept updated (thus making such Node requirements a necessity).

Drop Node 12 support (EOL will be 2022-04-30)

This is a no-go for OSS devs. E.g. I run vite-plugin-ssr’s test suite against Node 12 to make sure vite-plugin-ssr works with Node 12.

Yarn 4.0 first rc release is now over 1 year old. And there’s been 43 rc releases since then. And the 4.0.0 milestone has no other opened issue.

Is there anything that is blocking a final release of Yarn 4.0.0 ? Is there a rough ETA of when this might happen ?

I am aware that we can use rc releases in the meantime, but it does look a bit unusual to have such a long period of time for rc. If it is stable, then it should probably be released, but if it isn’t, then we probably should populate the milestone to reflect what is missing, shouldn’t we ?

Myself I have a couple of things around JS constraints

Could you create issues assigned to 4.0.0 for those things ? then the community might be able to help, at least a bit ?

Where I can find waiting issues to be done? Milestone is the right place? Because there is only this issue present there. https://github.com/yarnpkg/berry/milestone/2

The default value change for enableGlobalCache should be well documented when yarn 4 is released. This tripped me up when switching since we sync our local cache folder into our docker dev environment and I was confused why docker didn’t work anymore. I expect this might happen to a few other people.

Ok makes sense. Even if v4 releases a couple of months earlier than 2022-04-30 that would be ok. Sorry for the noise.

Is there anything that is blocking a final release of Yarn 4.0.0 ?

Time! It’s always time. Most of the work is done, but there’s always a couple of smallish improvements we want to make around some “details”. Myself I have a couple of things around JS constraints, and @merceyz mentioned he’d like to close https://github.com/yarnpkg/berry/issues/4952 first to make the migration smoother. There’s also the website revamp, but it’ll likely be shipped separately.

Is there a rough ETA of when this might happen ?

Probably soon, but no ETA.

We will have a blog post tomorrow getting into the high level changes. I’ll keep the issue open until then (we just wanted to tag the release beforehand to avoid having to rush a fix if something broke during the deploy process).

This release made all of our builds to fail.

Here is an excerpt from one of our docker files:

FROM node:16.19.0-bullseye-slim

RUN yarn config set scripts-prepend-node-path true
RUN yarn set version 3.3.1

This image, seem to include the latest version of yarn (4 from several hours ago) and since we rely on 3.3.1 we try to set it.

This is the error that we see:

Step 7/18 : RUN yarn set version 3.3.1
 ---> Running in c2e50735b75c
Usage Error: This tool requires a Node version compatible with >=18.12.0 (got 16.19.0). Upgrade Node, or set `YARN_IGNORE_NODE=1` in your environment.
Yarn Package Manager - 4.0.0

Changing the line to RUN YARN_IGNORE_NODE=1 yarn set version 3.3.1 does fix the issue, just thought you should know about it

where can i find the change logs

@milesj Corepack is actually built into[^1] the NPM that ships with the official Node distributions. Also, custom Node builds can opt out of Corepack’s inclusion independently of NPM’s.

You’re right in that corepack should be available in the majority of environments, but it’s certainly not a given.

[^1]: You can see the files being added to the node_modules directory here: https://github.com/nodejs/node/blob/master/tools/install.py#L82-L121

I added an item to the list 👍

^ Just an update on the above, it was an oversight on my side that I eventually discovered - it was the difference between darwin & linux in the OS that was causing the replacement, not the key change.

I’ve set it in .yarnrc now, there’s no issue with dependabot.

@herzaso I think the error messages are clear enough. This is an expected behavior.

And do yourself a favor and upgrade Node.js to a version that has not reached end of life yet.

getting an overview of what breaking changes are relevant to different use cases of yarn would be nice, and not just a list of the commits

Since yarn 4.0 stable is released in https://github.com/yarnpkg/berry/releases/tag/%40yarnpkg%2Fcli%2F4.0.0, this issue can be closed.

Will they? From the look of it they use Corepack, so if your package manager is pinned via either packageManager or yarnPath, you should only get updated PR after you migrate to v4, right?

@arcanis It would have been nice, but my guess is they are still using v3 even with the above configured. This is the behaviour I’m seeing:

Screenshot 2023-08-28 at 19 16 47

With:

"packageManager": "yarn@4.0.0-rc.50" and yarnPath: .yarn/releases/yarn-4.0.0-rc.50.cjs

I will write an issue on their side.