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

npm package contains a lot of unnecessary things #2552

Closed
cztomsik opened this issue Dec 7, 2019 · 2 comments · Fixed by #2561
Closed

npm package contains a lot of unnecessary things #2552

cztomsik opened this issue Dec 7, 2019 · 2 comments · Fixed by #2561
Assignees
Labels
Area: Core For anything dealing with Mithril core itself Area: Workflow For anything dealing with Mithril's internal tooling, including the mocks and bundler, but not ospec Type: Bug For bugs and any other unexpected breakage Type: Meta/Feedback For high-level discussion around the project and/or community itself

Comments

@cztomsik
Copy link
Contributor

cztomsik commented Dec 7, 2019

I have no idea if this was intended or not (I hope it was not), but node_modules/mithril/dist/ takes 18M, mostly because of archive being there (with lots of *.md and *.html files)

You can verify easily here https://unpkg.com/browse/mithril@2.0.4/dist/archive/

@cztomsik cztomsik added the Type: Bug For bugs and any other unexpected breakage label Dec 7, 2019
@orbitbot
Copy link
Member

orbitbot commented Dec 7, 2019

I've noted that there was a lot of files around as well, but never that all that came with the default install. It should be a fairly simple fix with a files section in package.json, if someone feels like chipping in.

@dead-claudia
Copy link
Member

The bulk of npm download and install times come from dependency resolution (an NP-hard problem for even the most contrived case) combined with the large number of connections and requests it has to make because npm establishes a whole new connection for each request it makes to the server and all the data it has to parse to get that data. It doesn't come from install size.

Also, most of the size overhead from comes from duplicate versions - like people importing two different versions of Lodash. This doesn't happen nearly as much with Mithril for the same reason it's rare to see multiple React or Angular installations - you need exactly one source of truth, and libraries that depend on Mithril always list them as peer dependencies, instead of normal dependencies.

It's also worth noting that @angular/core itself is about as large as ours


That aside, I wouldn't be against stripping /archive/ from the bundle* - there's no valid reason to ship that on npm. Feel free to file a pull request adding that to our .npmignore - I wouldn't consider it breaking as it was never documented and there's no good reason to rely on it in the npm bundle itself. We've already removed other, larger things like the tests and their associated helpers, so I wouldn't be surprised if this was just an oversight at some point.

* I do want to keep the current /docs/ with it, for offline reference and in case the project ever goes defunct for whatever reason. This shouldn't amount to more than a few MB at most.

@dead-claudia dead-claudia added Area: Core For anything dealing with Mithril core itself Area: Workflow For anything dealing with Mithril's internal tooling, including the mocks and bundler, but not ospec Type: Meta/Feedback For high-level discussion around the project and/or community itself labels Dec 12, 2019
dead-claudia added a commit that referenced this issue Jan 5, 2020
* remove docs archive (fix #2552)

* Update docs/change-log.md

Co-Authored-By: Isiah Meadows <contact@isiahmeadows.com>

Co-authored-by: Isiah Meadows <contact@isiahmeadows.com>
StephanHoyer pushed a commit that referenced this issue May 16, 2022
* remove docs archive (fix #2552)

* Update docs/change-log.md

Co-Authored-By: Isiah Meadows <contact@isiahmeadows.com>

Co-authored-by: Isiah Meadows <contact@isiahmeadows.com>
@dead-claudia dead-claudia moved this to Closed in Triage/bugs Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Core For anything dealing with Mithril core itself Area: Workflow For anything dealing with Mithril's internal tooling, including the mocks and bundler, but not ospec Type: Bug For bugs and any other unexpected breakage Type: Meta/Feedback For high-level discussion around the project and/or community itself
Projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

3 participants