yarnpkg / berry

šŸ“¦šŸˆ Active development trunk for Yarn āš’
https://yarnpkg.com
BSD 2-Clause "Simplified" License
7.42k stars 1.11k forks source link

[Feature] nodeLinker: pnpm option ? #1845

Closed crubier closed 3 years ago

crubier commented 4 years ago

Describe the user story

Describe the solution you'd like

Describe the drawbacks of your solution

Describe alternatives you've considered

Additional context

We love yarn berry and everything it provides (plugins, constraints etc.). The only source of problems with it is pnp. On the other hand we recently tried pnpm and saw large runtime performance improvements.

arcanis commented 4 years ago

I don't think we have the resources to support three different linkers at the moment. It's very possible to implement a pnpm style install, and we would happily provide tips to do so, but I think it should come from the outside.

Note that, personally, I don't have the same assessment regarding PnP: applications that don't follow the semantic cause as many problems, but harder to find, and the runtime overhead doesn't look that significant - that is, in master, after fixing the regression you reported. In any case, the PnP runtime never got particularly optimized (priorities!), and I'm optimistic that there are low hanging fruits to find.

larixer commented 4 years ago

@crubier I would be interested to experiment with putting together proof of concept pnpm-like linker when I have time, probably after making pnp + nm linker hybrid mode working in the same monorepo. Full-blown investment into pnpm-like linker on everyday basis while supporting nm linker as well, would be probably too much for me.

zkochan commented 4 years ago

It might be better to call it something like nodeLinker: node-modules-symlinks because pnpm will soon also support PnP (https://github.com/pnpm/pnpm/pull/2908), so it might be confusing in the future, what nodeLinker: pnpm means.

(there's a funny typo in the issue: node-nodules)

larixer commented 4 years ago

@zkochan I don't think we have resources to recreate pnpm linker. I might just play with symlinks at some point in the future and explore what benefits we can gain from using them with node_modules installs. For sure such a linker that make some usage of symlinks will not be named pnpm.

borekb commented 3 years ago

Let's say we'd be fine having to install pnpm separately; would it then be possible to create a Yarn plugin that is a wrapper around the pnpm binary? I guess the main problem is that the lockfiles are different but if pnpm could read yarn.lock, are there any other major problems with this idea?

MarcCelani-at commented 3 years ago

Hi folks. Very excited to try out this new linker.

This plugin is missing from https://github.com/yarnpkg/berry/blob/master/plugins.yml . I'm assuming that is intentional but reporting just in case. When can we expect to see this new plugin released?

merceyz commented 3 years ago

It's a builtin plugin so nothing to import, it's currently in a canary release.

yarn set version berry && yarn set version canary