-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Consider using micromatch #1158
Conversation
Thanks for the PR. The reason we use minimatch is because npm does, meaning we can share a copy with it and make the installer a little smaller. I wouldn't object to removing minimatch altogether if size of the standalone install is your motivation for doing this. It's not like we are doing anything fancy with it; a simple regex probably suffices. |
No, it was more that I use micromatch often and I recognized a quick optimization that may be useful since almost any time I do an
It probably does. I can update this PR with a regex change if you'd like. I know that micromatch expands the glob pattern into a more thorough regex than I would probably think of and there may be something additional done because of the |
@bnoordhuis I updated this to just use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks. CI: https://ci.nodejs.org/job/nodegyp-test-pull-request/31/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
PR-URL: #1158 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
Thanks Brian, landed in d70513a. |
PR-URL: #1158 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
Hi,
This PR is doing two things:
When the glob pattern is updated to
'*.{h,gypi}'
,micromatch
will create one regexp pattern that will only do one pass over the file being checked. This differs fromminimatch
that creates 2 different regexp patterns and will check the file twice if the pattern doesn't match'*.h'
.Thanks for considering this.