-
Notifications
You must be signed in to change notification settings - Fork 26.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
16 changed files
with
87 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ages/next/src/compiled/micromatch/LICENSE → packages/next/src/compiled/picomatch/LICENSE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name":"picomatch","main":"index.js","author":"Jon Schlinkert (https://github.com/jonschlinkert)","license":"MIT"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.