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

Replace fast-glob with fdir in NextJS #37

Open
43081j opened this issue Apr 13, 2024 · 4 comments
Open

Replace fast-glob with fdir in NextJS #37

43081j opened this issue Apr 13, 2024 · 4 comments

Comments

@43081j
Copy link
Owner

43081j commented Apr 13, 2024

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

We could replace this with fdir, a zero dependency alternative which may also be faster.

@styfle
Copy link

styfle commented Apr 16, 2024

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

@43081j
Copy link
Owner Author

43081j commented Apr 17, 2024

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
Copy link

styfle commented Apr 17, 2024

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
Copy link
Owner Author

43081j commented Apr 18, 2024

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

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

2 participants