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

cleanup(core): move esbuild to use fdir/picomatch #28037

Closed
wants to merge 3 commits into from

Conversation

43081j
Copy link
Contributor

@43081j 43081j commented Sep 22, 2024

Migrates away from fast-glob to fdir and picomatch.

this'll improve performance a fair amount (fdir is much faster than fast-glob) and should reduce the install size (picomatch and fdir are both very small).

fast-glob uses micromatch, while this uses picomatch. the difference seems to be that more advanced bash brace expansion isn't supported in picomatch. if that's important to you, its possible we could use micromatch or zeptomatch

@43081j 43081j requested review from a team as code owners September 22, 2024 05:58
Copy link

vercel bot commented Sep 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Oct 19, 2024 6:01pm

Copy link
Collaborator

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a conflict from one of your other PRs, and possibly some legit e2e failures

@43081j
Copy link
Contributor Author

43081j commented Sep 23, 2024

No worries, I'll have a look soon 👍

Will catch the branch up too

@JamesHenry
Copy link
Collaborator

JamesHenry commented Sep 25, 2024

Please ignore the react rspack module federation e2e error, it will be resolved when you sync with latest master. The others might be legit though

@JamesHenry
Copy link
Collaborator

@43081j I pulled in latest again after all the recent merges just in case

@JamesHenry
Copy link
Collaborator

I think there might be some flake in the e2e results, but the should support non-bundle builds e2e failure for esbuild might be worth trying to reproduce locally

@43081j
Copy link
Contributor Author

43081j commented Oct 1, 2024

That same test seems to fail locally for me too

Haven't managed to figure out why yet though. It seems to expect a file to exist which doesn't. That suggests the way we compute the input glob is broken or changed but I'm not sure why/how yet

Migrates away from fast-glob to `fdir` and `picomatch`, a faster and
smaller combination.
@43081j
Copy link
Contributor Author

43081j commented Oct 9, 2024

I fixed the failure but now it seems something to do with the angular e2e is failing. I can't see an error in the logs so I'm not sure what's going on

Some install command fails it seems but there's no error as far as I can see

@43081j
Copy link
Contributor Author

43081j commented Oct 20, 2024

Oh wow, whatever got merged in from master seems to have fixed the tests!

Any chance I can get a re-review? 🙏

@JamesHenry
Copy link
Collaborator

@43081j Yeah there was a peer dep issue with the Angular stack that was fixed so I was hoping that would be it. Thanks a lot for your patience in getting this green!

With that said, this is a more significant change than previous ones under this umbrella, so will need some more eyes.

I am also curious about seeing a resolution to this issue I saw when investigating picomatch: micromatch/picomatch#136

@43081j
Copy link
Contributor Author

43081j commented Oct 21, 2024

I agree

Other projects we have migrated to picomatch didn't make use of the extra edge cases minimatch supported, so they were fairly easy to move. We also moved a few to zeptomatch which is even smaller and often faster than picomatch, but possibly missing some rarely used pattern types.

Anyhow, let me know when we have more reviews, if we want to change something 👍

@benmccann
Copy link
Contributor

You might consider tinyglobby, which uses fdir/picomatch, but could be better performing as it does some optimizations to avoid having fdir crawl folders that are under the ignore pattern. It would also make it so that there are minimal code changes here needing review as tinyglobby and fast-glob are nearly API compatible. Plus tinyglobby is already a dependency via @nx/js.

I am also curious about seeing a resolution to this issue I saw when investigating picomatch: micromatch/picomatch#136

I'm not sure that issue is going to have an effect. fast-glob uses picomatch and doesn't use minimatch, so I don't think anything will change there

@43081j
Copy link
Contributor Author

43081j commented Dec 10, 2024

If you want to open a branch which uses tinyglobby instead, I'd be happy to close this

Especially since we already have it in another package of the monorepo. Probably makes sense to use the same one

43081j added a commit to 43081j/nx that referenced this pull request Dec 21, 2024
An alternative to nrwl#28037, switches the esbuild package to use
`tinyglobby` instead of `fast-glob`.

This improves performance a fair chunk and reduces install
complexity/size.
43081j added a commit to 43081j/nx that referenced this pull request Dec 30, 2024
An alternative to nrwl#28037, switches the esbuild package to use
`tinyglobby` instead of `fast-glob`.

This improves performance a fair chunk and reduces install
complexity/size.
@43081j
Copy link
Contributor Author

43081j commented Jan 11, 2025

Closing because we are going ahead with #29453 instead

@43081j 43081j closed this Jan 11, 2025
@43081j 43081j deleted the esbuild-fdir branch January 11, 2025 13:15
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants