Tips on migrating from yarn3 to pnpm?

I've a couple of projects I'd like to try to get pnpm working with. I've not started yet, just wondering if there's any gotchas along the way that others have come across? It's not discussed much in the docs currently.

I've used it for some projects, I didn't get to use a lot of its advanced features, but I'm a big fan of it: it's really fast, it's not wasteful (it uses symlinks to a central repository of packages, rather then creating copies in the projects) and I love the fact that it doesn't use hoisting (lifting all packages to the root node_modules level) and instead properly includes all the dependencies packages in the node_modules of the packages that require them. This forces you to maintain good discipline in the declaration of dependencies (if your package doesn't declare a dependency, it won't find it, just because that dependency was hoisted by another package). Actually, I think that's my main reason for loving pnpm: it imposes good discipline.

In Volto I've had an initiative, at some point, to make pnpm work, complete with a working PR. There were some issues with project setup, and as with many other projects I've started, I got sidetracked. Don't get fooled by the "pnpm mode" of yarn, it's not the same thing. The quality is not there.

These are the same reasons I want to give it a try! That plus the ability to install directly from a lockfile should greatly reduce complexity when it comes to CI/CD with docker.
So is Volto not PNPM ready yet, I recall seeing a few PRs regarding it?

@JeffersonBledsoe Give it a try, I don't recall what's the latest status. In principle, since the move to yarn 3, all the stoppers should have been fixed. I recall a problem with husky when I've tried it in Volto, but that may not affect you.

1 Like