New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore!: enable minification #7650
base: main
Are you sure you want to change the base?
Conversation
The broken stacktrace is a big issue |
Yeah, that's what I am also concerned about. But I am wondering how Yarn get a workaround about this as Yarn has been shipping a minified version of the bundle since Yarn 3. They are not using sourcemap either. |
Do they obfuscate function names? |
Yes they do. Both Yarn 3 and Yarn 4 have mangled function names: https://repo.yarnpkg.com/3.0.0/packages/yarnpkg-cli/bin/yarn.js |
I don't have objections, I guess. @pnpm/collaborators what do you think? |
I don't think it's worth the downsides (patching pnpm is already something useful that we do). |
About the stack trace, I tried to feed it over HTTP and found it does not work. I opened an issue at Node.js site. nodejs/node#51781 |
I've noticed this storage problem too, but I also have found stack traces to be valuable in diagnosing previous crashes on DT. It'd be nice if corepack had some sort of automatic cache clearing; since it's the one running each package manager via its shims, it should know when each download was last used and could drop ones that haven't been used in a while. It'll transparently download them again later if needed. |
So yeah, I think this issue should be raised with corepack (likely already has?). I think losing stacktraces in prod builds of pnpm will seriously hinder the project's ability to be debugged in the future. If you're accumulating corepack package managers and don't like it, you can always clean them periodically. |
The PR enables the modification of the
pnpm.cjs
file and theworker.js
file.I use pnpm through the corepack. When a requested version of pnpm is not available locally, corepack automatically downloads and caches pnpm locally. Currently, I have 20 copies of pnpm on my disk, each taking up about 15-20 MiB:
By enabling minification, the size of the
pnpm.cjs
file can be reduced from 8.1 MiB to 3.7 MiB, achieving a 53% reduction.Yarn also ships a minified version of a single
yarn.js
bundle, which has a size of 2.7 MiB (https://repo.yarnpkg.com/4.0.0/packages/yarnpkg-cli/bin/yarn.js).There are a few downsides though: