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

Installation size has been increased by 380% #138

Open
6 of 7 tasks
SukkaW opened this issue Aug 29, 2024 · 6 comments
Open
6 of 7 tasks

Installation size has been increased by 380% #138

SukkaW opened this issue Aug 29, 2024 · 6 comments

Comments

@SukkaW
Copy link
Contributor

SukkaW commented Aug 29, 2024

Describe the bug

So [email protected] has an installation size of 5.06 MiB: https://packagephobia.com/[email protected]

And now [email protected] has an installation size of 24.4 MiB: https://packagephobia.com/[email protected]

Reproduction

https://packagephobia.com/[email protected]

System Info

System:
    OS: macOS 15.0
    CPU: (12) arm64 Apple M2 Max
    Memory: 3.47 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.5.1 - ~/.local/state/fnm_multishells/62578_1724618462120/bin/node
    npm: 10.8.2 - ~/.local/state/fnm_multishells/62578_1724618462120/bin/npm
    pnpm: 9.9.0 - ~/.local/state/fnm_multishells/62578_1724618462120/bin/pnpm

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Contributions

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)
@SukkaW
Copy link
Contributor Author

SukkaW commented Aug 29, 2024

https://npmgraph.js.org/[email protected]

So acorn is back, through unconfig -> importx -> mlly -> acorn.

I created a PR to drop mlly from unconfig before (antfu-collective/unconfig#27) and now it is back. This increases installation size by 500 KiB.

Also jiti (which bundles a full Babel inside the dist) has an installation size of 1.9 MiB, and has been required by taze through unconfig -> importx -> jiti.

Also esbuild (along with its binary) has also been required through unconfig -> import -> tsx -> esbuild.

@antfu
Copy link
Member

antfu commented Aug 29, 2024

What would you suggest? In a way they are "modern" dependencies that you are likely to have installed by some other packages, on the other way, there isn't really "smaller" alternative to solve the problem (see https://github.com/antfu-collective/importx). Until someday that Node.js supports loading TS files natively without cache, we might get rid of the complexity of importx, otherwise I see we still need esbuild/jiti for correctness.

@SukkaW
Copy link
Contributor Author

SukkaW commented Aug 29, 2024

What would you suggest?

Previously npm-registry-fetch and npm-package-args were bundled. After they were removed and brought back they became direct dependencies again.

Let's start with re-bundling them first. This should help a lot.

@SukkaW
Copy link
Contributor Author

SukkaW commented Aug 29, 2024

As we discussed before, when taze is installed as a devDependency inside projects it would be fine. Since npm i -g doesn't share dependencies, the installation size matters more when using taze as a globally available cli.

@SukkaW
Copy link
Contributor Author

SukkaW commented Sep 24, 2024

Google Chrome 2024-09-25 03 19 44

After my two PRs, the installation size of taze has dropped by nearly 50%. IMHO we could still do better.

@antfu
Copy link
Member

antfu commented Sep 26, 2024

I'll try to reduce the size of importx later as the JITI v2 release

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

No branches or pull requests

2 participants