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
v4.0 #137
Comments
@jonschlinkert great post! And I like the goals set forth for 4.0 ❤️ |
thanks @phated! |
You could reduce some more if you target node LTS versions meaning no more support for node < 6 for example: use |
The goal is for micromatch v4.0 to only have two dependencies: one for brace expansion, and one for parsing globs and creating regular expressions. The latter won't have any dependencies of its own. The brace expansion library ( |
Love it! |
@jonschlinkert I want to include v4.0 in readdirp. When do you want to release it? |
Nice! I’m almost finished moving to my new home, so probably in the next week. Is that soon enough? Honestly fwiw it’s probably ready to publish but I was planning on doing optimization first.
…Sent from my iPhone
On Sep 13, 2018, at 11:27 AM, Paul Miller ***@***.***> wrote:
@jonschlinkert I want to include v4.0 in readdirp. When do you want to release it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Yes sir. Please optimize first. |
Will do
…Sent from my iPhone
On Sep 13, 2018, at 1:09 PM, Paul Miller ***@***.***> wrote:
Yes sir. Please optimize first.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@jonschlinkert any news here? 🙏 |
Yes! I've spent quite a bit of time on unit tests and optimization. I'll try to get something pushed up to a branch this weekend. Then we can all agree on whether it's ready to publish. Thanks for the ping! |
Awesome news! Looking forward to land this in Jest 24 🙂 |
Quick update. I ran into some issues last night trying to push up changes, I haven’t had time to investigate why yet, but I think I saw something about GitHub having problems. I’ll try again tonight or tomorrow.
…Sent from my iPhone
On Oct 17, 2018, at 3:19 AM, Simen Bekkhus ***@***.***> wrote:
Awesome news! Looking forward to land this in Jest 24 🙂
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Yeah, GitHub has had a lot of issues for the last 20 hours (still ongoing, even though it's better https://status.github.com/messages) |
Oh ok, good to know. Thank you!
…Sent from my iPhone
On Oct 22, 2018, at 1:53 PM, Simen Bekkhus ***@***.***> wrote:
Yeah, GitHub has had a lot of issues for the last 20 hours (still ongoing, even though it's better https://status.github.com/messages)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@jonschlinkert sup |
@jonschlinkert ping. |
@paulmillr hey sorry I missed your last ping. I didn't forget, I've been porting tests. I'll just go ahead and push something up tonight for everyone to see. |
I just pushed up https://github.com/micromatch/picomatch, the matcher function that I'll be using in micromatch.
Why another matching lib? It was the fastest way for me to get micromatch upgraded, reduce deps, and get feedback on matching before we release the next version of micromatch. |
Nice! Thank you! |
Sorry to nag, but any updates here? Is it possible to release and land optimizations later, perhaps? 🙂 Really excited about the direction here! |
No worries, thanks for the reminder. Will do, I'll get something published ASAP. |
just wanted to mention that I haven't forgotten, I was stuck on a windows-related matching issue that I spent a great deal of time trying to figure out. Over the next few days, I'll finally have time to get this finished! |
Happy new years! 🎉 Any news on this? |
Jest 24 is out with micromatch v3 (so we upgraded from 2 to 3). From my understanding of the OP, we should be able to upgrade to v4 when it's released without it being a breaking change for consumers. Had to hack around the snapdragon dep for the browser builds though, so still looking forward to this 😀 |
Really sorry for the late reply. Thanks so much for your patience. I spent a lot of time on upgrading micromatch to use picomatch, 3 or 4 tests are still failing on Windows. And I found a couple of edge cases that I need to fix before we publish v4. I’ll keep working on it this week. Thanks for following up.
…Sent from my iPhone
On Jan 26, 2019, at 7:04 AM, Simen Bekkhus ***@***.***> wrote:
Jest 24 is out with micromatch v3 (so we upgraded from 2 to 3). From my understanding of the OP, we should be able to upgrade without it being a breaking change for consumers. Had to hack around the snapdragon dep for the browser builds though, so still looking forward to this 😀
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@jonschlinkert hey Jon, thanks for your work — do you think we can get the release ball rolling in February? We want to release chokidar v3 without node-gyp and radically decrease its bundle size before next nodejs v8.x release. That would be really useful! |
@paulmillr yes I think I can make that happen! |
Hey again! Sorry about the nagging, but the If you're working on edge cases, are they edge casey enough that you can maybe release an alpha? :) Thanks for your hard work at this, I don't mean to sound unappreciative |
Is there anything we can help with to make it happen? 🙂 |
No worries! I don't mind, and I appreciate that you care and have been so patient. I've actually been working on this for the past several hours. I finally figured out how to get around this windows issue!! I'm going to keep working on this until it's released! |
Awesome news, thanks @jonschlinkert! |
@SimenB I'm still working on it. Spent the last couple of days fixing a bug. I'll be pushing up something today, then I should be able to publish a beta. FWIW I know it seems like I'm probably not doing anything on this, but there was a bug that I had a really hard time figuring out for some reason. I ended up having to refactor the entire logic for stars and globstars. I finally have it working! |
Super exciting @jonschlinkert! Will there be anything you'd consider breaking changes in this release? |
Alright, I really had every intention of pushing this up on Friday, and now I've spent the last several days on it. This ended up being such a pain to fix that I started from scratch to get rid of some code debt. I'm glad I did, it helped me figure out a great parsing strategy that made picomatch faster by 200-400%, without caching! All of the unit tests are now passing, and I'm updating the docs! More importantly, the code is now much easier to maintain and understand, which means it will take me less time to fix bugs and make updates. I'll add a description of the parsing strategy to the readme.
Thank you! I'm starting to think so too now that I refactored :)
I'm going through commits and creating docs now. I'll have a better (more confident) answer for you once I get a little further. In the meantime, here is a preview of some of the new features that (IMHO) make this release worth the wait and really nice to use: const micromatch = require('micromatch');
const paths = [];
// custom function to modify each string before it's tested
const format = str => str.replace(/\\/g, '/').replace(/^\.\//, '');
// custom function that is called on each successful match
const onMatch = ({ pattern, regex, input, value }) => {
// pattern - the original glob
// regex - the regex created from the glob
// input - the unmodified input string to be matched
// value - the "formatted" input string to be returned
console.log({ pattern, regex, input, value });
};
// custom function that is called on each string that matches an ignore pattern
const onIgnore = ({ pattern, regex, input, value }) => {
console.log({ pattern, regex, input, value });
};
const options = { onMatch, onIgnore, format, ignore: ['*/baz'] };
const matches = micromatch(['foo\\bar', 'foo\\baz', './abc/xyz'], '**', options);
console.log(matches);
//=> ['foo/bar', 'abc/xyz'] ...and here are a few of the benchmarks with caching disabled! |
Woah, absolutely bonkers numbers on those benchmarks! Awesome job. The |
@jonschlinkert amazing work, those numbers look fantastic! |
Yes! That's exactly the kind of use case that I was hoping to address with
Thank you! Much appreciated! |
@jonschlinkert what's the plan for v4 in removing |
No. Braces are supported. |
@jonschlinkert I'm asking because We seem to have a way of optimizing micromatch (v4.0), but nothing for braces. |
I'm not sure how that was determined when micromatch v4.0 wasn't pushed up yet, but I'll look into it and see what we can do. |
I determined that because we are rewriting micromatch to use picomatch instead of nanomatch — but the braces module is staying the same, apparently. |
It's being refactored. The main cause of the size is two things:
I won't be taking any non-critical pull requests to the current versions of braces or snapdragon if anyone wants me to get updates released. I can either stay focused on releasing streamlined, faster versions, or we can keep playing whack-a-mole. |
@jonschlinkert Please take a look here, i've reduced braces/snapdragon size twice in no time: here-be/snapdragon#23 |
The snapdragon API changed a lot between the current version and the version that braces uses. I appreciate the PR, and I'll merge it in, but the amount of time it would take to update braces to use the newer API wouldn't be worth it. I'd rather just refactor braces completely to not use snapdragon. |
@paulmillr micromatch/braces#24 It's fast as hell. we have that going for us, which is nice. Also wanted to mention that we can't use the same parsing strategy with braces as with other globs. It's a lot more complicated. We need a real parser with an AST that allows us to handle nested expressions correctly. Assuming we want to continue avoiding the DDoS issues that have plagued minimatch |
@jonschlinkert that's pretty huge. Please release this before micromatch v4. |
Alright, it's published! I'll be out of the office until this afternoon. If any regressions happen I can triage then. Any help from team members would be appreciated too! |
v4.0
Goals for 4.0
v3.0 post-mortem
What we did well in 3.0
What needs to be improved
Thoughts on the approach I used in 3.0, what I liked about it, and what I didn't like...
braces
I think) would take more time to upgrade than we anticipated. I had to decide whether or not it was worthwhile spending time to make this upgrades versus a complete overhaul. This is ultimately what made me strongly dislike the approach I took to "building up the matchers" in 3.0. It started out as a neat idea, and made it easier to get the accuracy I wanted, but it has the horrible side effect of multiplying dependencies when version mismatches happen.The text was updated successfully, but these errors were encountered: