es-tooling / ecosystem-cleanup

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

Replace fast-glob with alternative in NextJS #37

Open 43081j opened 6 months ago

43081j commented 6 months ago

fast-glob is used in a few places in nextjs. For example:

https://github.com/vercel/next.js/blob/7ef6c4eb17b92fac2a71f52c99a23a9794438c3a/packages/create-next-app/helpers/copy.ts#L25-L30

Two possible alternatives which are leaner and faster:

styfle commented 6 months ago

It looks like glob will be built-in starting with Node.js 22 so that would be ideal

43081j commented 6 months ago

it will be 🥳 though we don't know yet which versions will have it (i.e. will it be backported, and if so, how far?)

it probably isn't imminent so we could still get some gains meanwhile and move to the built-in later, though that decision is on each individual repo to make rather than us

styfle commented 6 months ago

From my experience, every glob implementation is slightly different.

So its easier to make the change 1 time rather than multiple times with different packages using different implementations that may introduce breaking changes.

43081j commented 6 months ago

From my experience, every glob implementation is slightly different.

So its easier to make the change 1 time rather than multiple times with different packages using different implementations that may introduce breaking changes.

true

i did run a pretty large test suite against fdir which people had already been running against fast-glob and all of them passed, that's partly why i settled on it

though if there's an option to move to the node built-in, i agree we 100% should. and if a maintainer doesn't want to have to move twice, we should wait