chore: replace micromatch w/ picomatch (#60699)
The PR continues from #58038 aiming to reduce the installation size further, and **improve performance in doing so**. Most of `micromatch`'s APIs are essentially wrappers/alias of `picomatch`, supplemented with additional features facilitated by a transitive dependency `braces`. However, Next.js doesn't use those "extra features". Switching from `micromatch` to `picomatch` can avoid introducing the transitive dependency `braces`. The PR also improves some globs' performance by hoisting. - `micromatch.makeRe` is just an alias of `picomatch.makeRe` - https://github.com/micromatch/micromatch/blob/90dc0cd3e186b8ab4dd05bfc41e2b98f5067a49b/index.js#L387C30-L387C30 - `micromatch.isMatch(str, patterns, options)` equals `picomatch(patterns, options)(str)` - https://github.com/micromatch/micromatch/blob/90dc0cd3e186b8ab4dd05bfc41e2b98f5067a49b/index.js#L123 - `micromatch.matcher` is just an alias of `picomatch` - https://github.com/micromatch/micromatch/blob/90dc0cd3e186b8ab4dd05bfc41e2b98f5067a49b/index.js#L104C1-L104C40 --------- Co-authored-by:Sam Ko <sam@vercel.com>
Showing
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Please
register
or
sign in
to comment