Ava: Suggestion: make AVA smaller on disk

Created on 27 Dec 2017  路  6Comments  路  Source: avajs/ava

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

Most helpful comment

"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.

All 6 comments

"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.

Duplicate of #369

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.

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.

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.

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


Update 2018: You can visualize the install size difference between [email protected] and [email protected] with my new tool, Package Phobia, which is much easier than installing yourself 馃槃

Was this page helpful?
0 / 5 - 0 ratings