3 ms·
Yarn 2 is fantastic. I run about ~30 JS repos, ~10 of them monorepos. Since I migrated everything to yarn 2 its been a breeze, my other contributors have been
by Normal_gaussian 5y ago
Yarn 2 is fantastic.
I run about ~30 JS repos, ~10 of them monorepos. Since I migrated everything to yarn 2 its been a breeze, my other contributors have been able to completely forget about it (as it just works) and I've been able to assert that everything that works today will work in six months and two years.
That is because I have not gone against the default of 0-config repos, that is saving the .yarn/cache folder (equiv of node_modules) to git (via git-lfs). The lockfiles work. Dependencies can have conflicting dependent packages. I've had a small number of packages have issues with the zip format, which is solved by setting unplugged (very well documented).
A user clones the repo and they are done. Yarn itself is saved into the repo, so the only external dependency is nodejs.
Things I haven't thought about or done since switching to yarn 2:
* I don't worry that the server is running something different to the dev machine
* I don't get breakage because I switched branches
* I don't have to teach other people how to look after their packages (because it 'just works')
* I don't have to chase people to update when a lib we use has a vuln
* I don't spend time installing
* I don't care about package compatibility
Things I have had to worry about:
* build systems. When you use webpack, esbuild, etc. then they need a little help resolving packages
* in the beginning it was hard to step into dependencies. That is all fixed now.
* Sometimes a package is broken because they don't specify peerDependencies properly (which is a security & reliability issue), so you have to add to a config file (surprising first time, easy from then on).
Yarn is a big win.
- throwaway284534 5y agoDoes this strategy work with node modules that use native extensions, such as node-gyp?
- crubier 5y agoYes completely. No problem with those.