Skip to content
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

Reduce reshims in global installs #197

Conversation

augustobmoura
Copy link
Member

@augustobmoura augustobmoura commented Jan 22, 2021

This PR restricts the reshimming in global installs to only the packages being installed (or removed). Kinda solves #46, is not perfect, it will reshim multiple times if installing multiples packages (npm i -g typescript tldr will reshim 2 times for example) but I think it is in a much more comfortable state now. It's a bit better than #118, because in #118 it would reshim for every dependency that has a script bin, even though you don't use the binaries (npm i -g tldr for example reshims 5 times and only provides 1 global command).

Installing tldr dropped from ~12s to ~6s (the baseline without reshims is ~5s), other packages might see a bigger reduction, specially those with a bigger dependency tree.

closes #89

also add the same hook as postinstall on postuninstall
@augustobmoura augustobmoura changed the title Amortize reshims in global installs Reduce reshims in global installs Jan 22, 2021
@augustobmoura augustobmoura marked this pull request as draft January 22, 2021 20:59
@augustobmoura augustobmoura marked this pull request as ready for review January 22, 2021 22:40
@CherryDT
Copy link

It would be really good if this were merged, any progress on the review?

@augustobmoura
Copy link
Member Author

Closed in favor of #232

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

npm global uninstall doesn't remove shims
2 participants