foreman icon indicating copy to clipboard operation
foreman copied to clipboard

experimental - use pnpm

Open Ron-Lavi opened this issue 2 years ago • 3 comments

When using npm or Yarn, if you have 100 projects using a dependency, you will have 100 copies of that dependency saved on disk. With pnpm, the dependency will be stored in a content-addressable store, so:

  • If you depend on different versions of the dependency, only the files that differ are added to the store. For instance, if it has 100 files, and a new version has a change in only one of those files, pnpm update will only add 1 new file to the store, instead of cloning the entire dependency just for the singular change.
  • All the files are saved in a single place on the disk. When packages are installed, their files are hard-linked from that single place, consuming no additional disk space. This allows you to share dependencies of the same version across projects. As a result, you save a lot of space on your disk proportional to the number of projects and dependencies, and you have a lot faster installations!

Read more about pnpm on https://pnpm.io/motivation

Ron-Lavi avatar Jul 14 '22 06:07 Ron-Lavi

I tried doing something like this locally some time ago. What I couldn't figure out was how to run plugin js tests. Any pointers on that?

adamruzicka avatar Jul 14 '22 07:07 adamruzicka

@adamruzicka exactly where it fails, I see issues with peer deps

Ron-Lavi avatar Jul 14 '22 08:07 Ron-Lavi

and also some changes might be needed with the .bin scripts of foreman-js

Ron-Lavi avatar Jul 14 '22 08:07 Ron-Lavi