oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.07k stars 2.76k forks source link

Support Yarn Plug and Play Zero Install #3124

Open gtamas opened 1 year ago

gtamas commented 1 year ago

What is the problem this feature would solve?

Apps using Yarn's zero install cannot be started with bun, because it cannot find modules.

bun run ./build/src/main.js

Cannot find module "..." from...`

What is the feature you are proposing to solve the problem?

Apps using Yarn Plug n Play zero install would work with bun

What alternatives have you considered?

None

jwoo0122 commented 1 year ago

yarn's .pnp.cjs and .pnp.loader.mjs use node's internal behavior, which is not implemented yet in bun. Looks like we should make a plugin for bun or suggest to yarn to support bun environment...

Related: #3852, #3546

seivan commented 1 year ago

Second this. It's hard to go back after plug and play and having the entire system being reproducible. Cloning a project or switching branches doesn't need to fetch any dependencies. Keep in mind there are two things that helps with that, compressing them and allowing for a arch matrix for native modules.

arcanis commented 1 year ago

Note that PnP actually has a formal spec, not tied to a specific implementation (ie you don't actually need to evaluate the .pnp.cjs file). For instance, I implemented it in Rust here: https://github.com/arcanis/pnp-rust. It's relatively easy!

rtritto commented 2 months ago

Any update?

Related #13632