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

Switch to micromatch #2

Merged
merged 9 commits into from
Mar 23, 2015
Merged

Switch to micromatch #2

merged 9 commits into from
Mar 23, 2015

Conversation

es128
Copy link
Member

@es128 es128 commented Mar 19, 2015

@jonschlinkert would appreciate a review before I publish this

@jonschlinkert
Copy link
Member

Sure thing I'll be online in 30 min or so

Sent from my iPhone

On Mar 19, 2015, at 11:32 AM, Elan Shanker notifications@github.com wrote:

@jonschlinkert would appreciate a review before I publish this

You can view, comment on, or merge this pull request online at:

#2

Commit Summary

Switch to micromatch
Optimize with micromatch.matcher when possible
Use arrify
refactor default value assignment
Use micromatch.matcher on criteria arrays too
Fix currying test
Test curried matchers with individual criterion
Discuss switch to micromatch in readme
File Changes

M README.md (7)
M index.js (22)
M package.json (3)
M test.js (24)
Patch Links:

https://github.com/es128/anymatch/pull/2.patch
https://github.com/es128/anymatch/pull/2.diff

Reply to this email directly or view it on GitHub.

@jonschlinkert
Copy link
Member

sorry didn't have a chance to look earlier, will look over now.

@es128
Copy link
Member Author

es128 commented Mar 20, 2015

Thanks. There's no rush.

if (arguments.length === 1) {
return criteria.length === 1 ?
micromatch.matcher(criteria[0]) :
anymatch.bind(null, criteria.map(function(criterion) {
Copy link
Member Author

Choose a reason for hiding this comment

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

@jonschlinkert btw have you considered adding array support to micromatch.matcher? It would make it possible to simplify this bit.

@jonschlinkert
Copy link
Member

Just spent some time with it, there is nothing I would change in the code it looks great.

maybe consider doing a major bump though, even though the API isn't changing. I did a million unit tests for micromatch and tried to make sure there was parity, but just being realistic I still expect there to be some edge cases I didn't notice.

minimatch has a number of bugs, but people are used to them. obviously your call if you're okay with getting hit with an issue or two if that were to happen... on my end I'll make sure to fix whatever comes up right away. thanks!

@es128
Copy link
Member Author

es128 commented Mar 20, 2015

I'll think a bit more on whether to bump major.

Either way, I'm going to use latest in chokidar, so any issues will wind up affecting someone and we'll hear about them.

@jonschlinkert
Copy link
Member

so any issues will wind up affecting someone and we'll hear about them.

lol, well, on the upside there is no faster way for me to flesh out the bugs and improve micromatch :)

@jonschlinkert
Copy link
Member

... fwiw I use micromatch on everything now. I have projects that have been using if for a couple of months and I haven't had any issues. I'm just conservative.

it will be interesting to see if you notice a speed increase with chokidar. Micromatch spends more time on optimizing regexes, so it takes longer to build the regex, but once it's built the matching is much faster. I would expect that this approach would have the most obvious benefit in something chokidar, since the regex is cached and doesn't have to be re-built after the first time.

@es128
Copy link
Member Author

es128 commented Mar 20, 2015

Chokidar's glob support is new, but it isn't ever the bottleneck compared with all the fs operations. So I wouldn't expect a really noticeable impact. Still, every bit counts.

es128 added a commit that referenced this pull request Mar 23, 2015
@es128 es128 merged commit a5cc6ea into master Mar 23, 2015
@es128 es128 deleted the micromatch branch March 23, 2015 15:24
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants