News for hackers. Stuff that matters.
Re:Yarn 4.0 by h1fra on Monday October 23, 2023 @01:58PM (#37989215)
On top of the really different API, you always get v1 when you install (which I never understood). You need to upgrade manually everywhere with a command line. If I had to bet: most user didn't even bother upgrading because they are not aware of this behavior.
Re:Yarn 4.0 by evtothedev on Monday October 23, 2023 @02:29PM (#37989638)
I am learning this just now from this comment, so I think you are right.
Re:Yarn 4.0 by sli on Monday October 23, 2023 @02:40PM (#37989796)
Same here. I haven't done frontend in a few years now but I was shocked when the top comment was saying most people don't even use Yarn 2. I had no idea Yarn was past 1.x.
Re:Yarn 4.0 by k__ on Monday October 23, 2023 @02:31PM (#37989663)
I like that Yarn 4 is installed into the project directory.

This way you always have the right version when cloning a random Yarn repo.

Re:Yarn 4.0 by orra on Monday October 23, 2023 @04:17PM (#37990971)
Always having the right version is nice. However, you can get similar benefits with a shorter bootstrap script. Personally I prefer this because there's less third party code duplicated directly to your own repo.
Re:Yarn 4.0 by orra on Monday October 23, 2023 @03:13PM (#37990224)
Yeah, they really wanted you to install yarn's source to your repo, which is why they don't let you `npm install` yarn v2 (or higher).

That's maybe great for monorepos, but personally I find it ugly.

Thankfully now you can use `npm corepack`. This way you can specify a version of yarn in packages.json, without committing yarn's source to your repo.