3 ms·
Some years back I got burned repeatedly by people chasing the "yarn is fast and is the future! NPM is dead!" trend. At one point it was a running joke that one
by yamtaddle 4y ago
Some years back I got burned repeatedly by people chasing the "yarn is fast and is the future! NPM is dead!" trend. At one point it was a running joke that one of our projects hadn't really started until we hit a bug or missing feature in Yarn the easiest fix for which was "run 'npm install' and stop using Yarn". This is well after the entire Internet had decided Yarn was a perfect drop-in replacement and declared NPM obsolete.
I'd be more interested in how many packages break on each one—at install, or when you try to actually use the package—than speed. Maybe that's zero for all contenders now, but it wasn't for Yarn back then. Doesn't take many hours lost to fighting your package manager before any time-savings from execution speed have been erased.
- rektide 4y agoYarn definitely shot themselves in the foot badly. PnP identified real problems & came up with a solution, but pnpm is doing a similar set of tricks but in a Node-ecosystem-compatible way, with next to no compatibility issues (versus package maintainers having to each individually support Yarn V2 PnP). Yarn V2 seemingly thought they could get the entire npm package world to switch to yarn, saw their growth & saw the thought-leaders & decided their winning was a fait-accompli. And they didn't really execute very well... v2 landed, there was controversy, and there's been so little visible or exciting good news about it. It over-played Yarns so hand they renamed Yarn v2 as Berry, just to re-gather the troops & make a staging point forward. But it's still an incredibly hard pill to swallow, and the "yarn (berry) is great, the ecosystem needs to change" attitude seemingly isn't gaining any traction and it's hard to tell where Yarn could go. In Yarn v3[1], they've introduced a modular "linker" system for how to install packages, that seemingly might get them able to experiment around/play around a little more & be less constrained than the hard-path they'd crusaded for. One thing I will say for Yarn, that makes me unbelievably happy versus npm (announced during the V2[2] announcement): > Yarn is first and foremost a Node API that can be used programmatically (via @yarnpkg/core) Npm is the premier tool for open-source javascript, but it itself is one of the least open-source efforts on the planet. I finally started digging around the npm package and it's underlying cacache cache-structure, and it's just infinitely unpleasant to get started with. There's maybe like 3 articles on the whole planet that have any guidance for what npm is inside, how it works, what you can do with it, how you can hack it. Yarn identifying that the package manager itself is something that developers need access to is a huge win & I want to thank them forever for putting that on their bullet list of great Yarn things. Pnpm by compare has a couple super simple things one can do with it as a library[3] - install, link, look at dependencies. But, like, looking at the cache & seeing whats there? Nope. Good luck. Like npm, it's a wonderful tool for open source but it's quite a poor showing as open source, doesn't make itself programmatically accessible. [1] https://dev.to/arcanis/yarn-3-0-performances-esbuild-better-patches-e07 https://dev.to/arcanis/yarn-3-0-performances-esbuild-better-... [2] "Yarn's Future - v2 and beyond" https://github.com/yarnpkg/yarn/issues/6953 https://github.com/yarnpkg/yarn/issues/6953 [3] https://github.com/pnpm/pnpm/blob/main/pkg-manager/core/src/api.ts https://github.com/pnpm/pnpm/blob/main/pkg-manager/core/src/...