nx icon indicating copy to clipboard operation
nx copied to clipboard

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

Open 43081j opened this issue 1 year ago • 9 comments

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 avatar Sep 22 '24 05:09 43081j

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

vercel[bot] avatar Sep 22 '24 05:09 vercel[bot]

No worries, I'll have a look soon 👍

Will catch the branch up too

43081j avatar Sep 23 '24 19:09 43081j

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 avatar Sep 25 '24 13:09 JamesHenry

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

JamesHenry avatar Oct 01 '24 12:10 JamesHenry

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

JamesHenry avatar Oct 01 '24 13:10 JamesHenry

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

43081j avatar Oct 01 '24 17:10 43081j

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 avatar Oct 09 '24 10:10 43081j

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

Any chance I can get a re-review? 🙏

43081j avatar Oct 20 '24 03:10 43081j

@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: https://github.com/micromatch/picomatch/issues/136

JamesHenry avatar Oct 20 '24 13:10 JamesHenry

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 👍

43081j avatar Oct 21 '24 07:10 43081j

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: https://github.com/micromatch/picomatch/issues/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

benmccann avatar Dec 10 '24 17:12 benmccann

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 avatar Dec 10 '24 17:12 43081j

Closing because we are going ahead with #29453 instead

43081j avatar Jan 11 '25 13:01 43081j

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[bot] avatar Jan 17 '25 00:01 github-actions[bot]