es-tooling / ecosystem-cleanup

A place to keep track of ongoing efforts to clean up the JS ecosystem
405 stars 2 forks source link

Replace `execa` in `vitest` #57

Closed benmccann closed 2 months ago

benmccann commented 4 months ago

execa pulls in quite a few dependencies and vitest is heavily used - especially among this community

benmccann commented 4 months ago

Here's what astro did as an alternative:

https://github.com/withastro/astro/blob/main/packages/create-astro/src/shell.ts

AbhiPrasad commented 4 months ago

I think the windows support + error handling makes this pretty hard to replace for a lot of users.

Looking at the dep graph, there is probably a good opportunity to modernize node-cross-spawn though.

43081j commented 4 months ago

in the tinylibs org we're also working on a lighter alternative, but isn't quite ready yet just FYI

TheDevMinerTV commented 4 months ago
Package size report
===================

Package info for "vitest@2.0.3": 33 MB
  Released: 2024-07-15 10:03:50.134 +0000 UTC (1d ago)
  Downloads last week: 46,096 (0.89%)
  Estimated traffic last week: 1.5 TB
  Subdependencies: 101

Removed dependencies:
  - execa@8.0.1: 308 kB (0.94%)
    Downloads last week: 11,322,011 (13.88%)
    Downloads last week from "vitest@2.0.3": 46,096 (0.41%)
    Estimated traffic last week: 3.5 TB
    Estimated traffic from "vitest@2.0.3": 14 GB (0.41%)
    Subdependencies: 18 (17.82%)

(didn't calculate in new dependencies)

Estimated package size: 33 MB → 32 MB (99.06%)
Estimated traffic over a week: 1.5 TB → 1.5 TB (14 GB saved)
Estimated traffic over a week @ 100% downloads: 170 TB → 168 TB (1.6 TB saved)
43081j commented 4 months ago

tinyexec now exists too which could slot in nicely

Worth taking a look

benmccann commented 3 months ago

There is agreement to use tinyexec if anyone would like to take a stab at it: https://github.com/vitest-dev/vitest/pull/5713

ziebam commented 2 months ago

Submitted a PR for this change: https://github.com/vitest-dev/vitest/pull/6454.

TheDevMinerTV commented 2 months ago

Submitted a PR for this change: vitest-dev/vitest#6454.

Got merged, we can close this issue.

benmccann commented 2 months ago

Woohoo!