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.
[ Parent
| on HN ]
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.
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.
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.
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.
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.