Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Suggestion: make AVA smaller on disk #1622

Closed
styfle opened this issue Dec 27, 2017 · 6 comments
Closed

Suggestion: make AVA smaller on disk #1622

styfle opened this issue Dec 27, 2017 · 6 comments

Comments

@styfle
Copy link

styfle commented Dec 27, 2017

Description

I saw that Why AVA says "Minimal and fast".
So I wanted to see how minimal it is.
It turns out AVA is 23 MB.
Is all of that necessary and truly minimal?

Steps to reproduce

The latest version of AVA reports 23 MB

mkdir ava-example
cd ava-example
npm init -y
npm install --save-dev ava
du -sh

Another minimal test framework, Tape, reports 2.4 MB, about 10x smaller.

mkdir tape-example
cd tape-example
npm init -y
npm install --save-dev tape
npm install --save-dev @types/tape
du -sh

And I made sure to include TypeScript definitions so it was fair comparison.

Environment

Node.js v9.1.0
win32 10.0.16299

@sindresorhus
Copy link
Member

sindresorhus commented Dec 27, 2017

"Minimal and fast" refers to the API. The main offender in our dependency tree is Babel, and it's hard to do anything about that. Maybe Babel 7 will improve the situation. We'll see when it's out.

We've done everything we possibly can to keep the size down. You could help out by making sure none of our dependencies include unnecessary files, and if they do, submit PRs to use the "files" property in package.json.

@sindresorhus
Copy link
Member

Duplicate of #369

@sindresorhus sindresorhus marked this as a duplicate of #369 Dec 27, 2017
@sindresorhus
Copy link
Member

chokidar, used for our watch mode, also takes up 8 MB.

Without Babel, Chokidar, and Emcore (For power-assert), AVA would only take up 5 MB, and I'm confident I could reduce it to 4 MB.

But in the end, making a great developer experience is more important than some megabytes. Although I truly wish we could reduce it more.

@styfle
Copy link
Author

styfle commented Dec 27, 2017

Without Babel, Chokidar, and Emcore (For power-assert), AVA would only take up 5 MB, and I'm confident I could reduce it to 4 MB.

I think 5 MB would be totally acceptable. 👍
Could these dependencies be marked as optional?
For example, someone using TypeScript would likely not need Babel.

@sindresorhus
Copy link
Member

I want remove the bundled Babel and just let users add it as a dependency if they need it instead, but that will require #1556.

@styfle
Copy link
Author

styfle commented Dec 27, 2017

That would be excellent 🎉
I will subscribe to that issue, thanks!


Update 2018: You can visualize the install size difference between ava@0.25.0 and tape@4.9.0 with my new tool, Package Phobia, which is much easier than installing yourself 😄

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

No branches or pull requests

2 participants