-
Notifications
You must be signed in to change notification settings - Fork 39
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
Conversation
should pre-optimize globs by retaining their converted regexes
wasn’t actually testing the bound matcher function before
Sure thing I'll be online in 30 min or so Sent from my iPhone
|
sorry didn't have a chance to look earlier, will look over now. |
Thanks. There's no rush. |
if (arguments.length === 1) { | ||
return criteria.length === 1 ? | ||
micromatch.matcher(criteria[0]) : | ||
anymatch.bind(null, criteria.map(function(criterion) { |
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.
@jonschlinkert btw have you considered adding array support to micromatch.matcher
? It would make it possible to simplify this bit.
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! |
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. |
lol, well, on the upside there is no faster way for me to flesh out the bugs and improve micromatch :) |
... 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. |
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. |
@jonschlinkert would appreciate a review before I publish this