-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
Version 9
strips leading ./
#495
Comments
From the changelog:
The new algorithm no longer has the ability to track the use of extraneous dot and slash characters, because each path matched is an object in a tree, and patterns are optimized aggressively. This allows for much faster searching (like, 5-500x faster in many cases), but there's no way to know with certainty which form of the pattern matched any given path. |
Can you give examples of this?
This section seems focussed on path endings, not path prefixes. |
I never thought this package was slow, I did however like that it just worked :/ Webpack for example just doesn't work when the leading |
hi @romainmenke In my webpack configuration i needed to change that :
by this :
|
@msev Thank you :) I however know how to fix it but I first wanted to know if this was a bug or not. |
@msev maybe this can be |
If you want to get the absolute paths, you can do |
thanks @isaacs |
Ah, sorry, @romainmenke, I missed your other message:
So, in a nutshell, this means that the returned paths are the "normal" relative paths (or absolute paths if The reason for this is that it's not tracking the full string that it walked down to find the match, it's just doing a walk over the file system and hanging onto the parts of the pattern that are still relevant at any given point. In other words, it's doing a file search, not a string expansion. Doing it in this way is radically more efficient, and makes a lot of weird edge cases easier to handle, plus it makes deduplication tremendously easier, and allows for much more efficient handling of
This part in the middle:
|
@isaacs That's fair. The issue is also relatively simple to work around. That others are facing the exact same issue seems to indicate that the ecosystem depends on the old behavior. Webpack for example could handle Arguably it might have been better to publish such an extensive rewrite as a new package. Maybe good to call out this case in the changelog with an example? |
Yeah, as a maintainer, the thing about a community ossifying around your old code is that it's really hard to know when going into a massive overhaul like this exactly what can be discarded and what needs to be preserved, so long-coming much-needed semver major upgrades usually involve a bit of this back and forth. No matter how you try to get the word out there, sometimes the only real way to measure the importance of a feature is by ripping it out, lol I can see a couple of ways forward (not mutually exclusive).
|
Oh, another question, if the result starts with I'm assuming that the differentiation here stems from the fact that |
@romainmenke Care to try out #500 and see if it solves your issue?
And then:
|
I agree, and just did the same some weeks ago in
Running CI now, no errors have surfaced yet, so this is looking good! Edit : finished without issues 🎉 Thank you already for the super speedy action on this.
🙇
Yeah that sounds less than ideal. An option at least adds some friction on the users side.
That is also fine with me :) My main concern at first was knowing if this was a bug or not and trying to understand what changed and why.
It doesn't seem to require I tried :
becomes :
Webpack ran without issues. |
This is working perfectly on our end. Thank you for the fast updates here! |
In version 8 :
becomes
In version 9 :
becomes
Is this intentional?
I didn't find anything about it in the Changelog.
To me this seems like a bug because
find
does it like version 8The text was updated successfully, but these errors were encountered: