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 Install size #734

Open
ai opened this issue Dec 21, 2021 · 5 comments
Open

Reduce Install size #734

ai opened this issue Dec 21, 2021 · 5 comments

Comments

@ai
Copy link
Collaborator

ai commented Dec 21, 2021

New version of astroturf has dependnecies for 18 MB. Of course, node_modules install size is less important resources than bundle size. But 18 MB is too big and will affect CI performance and FS performance of using node_modules (text editor will be very slow when you will try to open node_modules).

It happens because astroturf use 140 (!) subdependnecies.

Снимок экрана от 2021-12-21 22-10-12

Seems like this problem can be fixed without big changes. Just by using dependencies a little more careful:

  1. Replacing cosmiconf to lilconfig (the same API but less subdependencies, we moved in PostCSS too).
  2. Replacing chalk with picocolors Move from chalk to picocolors #732
  3. Remove PostCSS plugins without maintaince using very old PostCSS: postcss-atroot and postcss-strip-inline-comments
  4. Using specific lodash.X packages instead of all-in-one lodash
  5. Cleaning some type dependencies. I am not sure that we need all of them. For instance, seems like we need @types/fs-extra only for astroturf development, not to use it always.
@jquense
Copy link
Contributor

jquense commented Dec 21, 2021

Happy to take PR's that reduce size without removing features, or make maintaince harder. I'm honestly not that concerned with install size...assuming we did everything on the list here how much would that affect the install size? I suspect most of the bulk is from big tools like babel

@ai
Copy link
Collaborator Author

ai commented Dec 21, 2021

I'm honestly not that concerned with install size...assuming we did everything on the list here how much would that affect the install size?

Hard to say. I could put a task to Cult of Martians (our way to help people go into open source) and see the result.

@ai
Copy link
Collaborator Author

ai commented Dec 21, 2021

Here is a link to 1.0.0’s dependnecies https://npm.anvaka.com/#/view/2d/astroturf/1.0.0-beta.29

In 1.0.0 there is even more 140 → 204 subdependencies.

@ai
Copy link
Collaborator Author

ai commented Dec 21, 2021

The task was created https://cultofmartians.com/tasks/astroturf-deps.html#task

I think in a 2-3 week it will be a PR where we can see the result.

In my projects, I was able to make node_modules less than 30 MB. It improved DX a lot (a few seconds for CI, yarn upgrade in insanely fast, less work for dependencies maintainability).

@krutoo
Copy link

krutoo commented Mar 1, 2023

@jquense @ai PR is ready. When can it be merged?

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

3 participants