-
Notifications
You must be signed in to change notification settings - Fork 100
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
Absolute paths in glob not working #229
Comments
Hey there, thanks for reporting this issue. As you may have noticed, the reasoning for that change was in #206 but it is no longer accessible due to the termination of the issue creator's account as per violation of GitHub's terms of service. (more info) So, I'll have to reconstruct the reasoning from memory. I believe that commit addresses two issues:
Now, onto what really matters. Although the first problem can be seen as a bug, there is certainly people depending on that behavior, so it should have been released as a breaking change (major version) instead of a patch. I'm willing to revert to the old directory path behavior and release a new patch version, so that anyone depending on So, I believe a good plan would be:
What do you people think? @szymonkups By the way, the solution you have suggested in the related issue seems to be the best, as it will work regardless of the direction we take here. |
I read through everything, you've given a pretty thorough overview thanks. I'm still getting caught up but your plan sounds good. I also looked at the code suggested in ckeditor/ckeditor5#181 (comment) and that also makes sense. |
Thanks for the fast answers and explanation. Maybe this issue:
can be resolved somehow by using chokidar's We will consider to use relative paths in our globs, thanks. |
This went a bit off my radar, my bad. Are you sure absolute paths are a problem? I believed the issue was just with implicitly watched directory contents. Can you please check whether removing the Our unit tests use absolute paths, so theoretically they shouldn't be a problem. |
Can you check if #233 fixes the issue? Do a |
My sample was just a way I think it could be fixed. Currently we are using: const glob = path.join( dirPath, '@(src|tests)', '**', '*' ); (without
These are details: Globs: {
"base": "/home/szymon/Projects/cksource/ckeditor5",
"nodir": true,
"read": true,
"buffer": true,
"cwd": "/home/szymon/Projects/cksource/ckeditor5/ckeditor5",
"dot": false,
"silent": true,
"nonull": false,
"cwdbase": false,
"events": [
"add",
"change",
"unlink"
],
"ignoreInitial": true,
"readDelay": 10
} |
Thanks for the feedback and testing! 😄 I may be short of time today but I'll take another look as soon as possible. |
By the way, are you using the |
I've managed to reproduce the issue and fixed it! 🎉 @szymonkups Can you please try this last fix?
|
Note my current patch has a relatively small breaking change: if you pass a |
Thanks for working on this. I've used changes from |
Yes, I just have to make sure that the implicit base behavior is correct to avoid another regression, and hopefully publish a new release tonight. |
Gah, looks like the universe conspires to foil my plans. I should have time to finish working on this now. There is just one remaining issue: with my proposed patch, the implicit base has changed in some cases. I believe this ideally should be treated as a breaking change, but I'm inclined to believe the new implicit base is a bug fix instead of a regression. The question is, is anyone actually depending on the old buggy behavior? If so, will the new behavior actually provide an improvement by fixing cases that they didn't cover or actually cause breakage? To be clear, the new behavior establishes symmetry between There are still issues with the implicit base behavior, mostly regarding implicit watching directory contents (depth) when a glob matches a directory. At least, these issues should be consistent independent of the Rants apart, let's see what options we have:
I believe the option 1 is the "less bad" approach. I'm mostly positive the implicit base changes can be seen as an improvement. Implicit bases have never been reliable for several cases; if the changes turn out to be a problem you can (and should!) set an explicit base to ensure that the relative paths are what you really expect. I'll reinforce again that these implicit base changes affect only certain edge cases that were quite unreliable to begin with. In any case, if it turns out to be a bigger problem than I'm anticipating, we can consider reverting the old behavior for the sake of backwards compatibility, although I believe the amount of effort to restore the buggy behavior would not be nearly worth it—from the user side, if the stars align and you happen to be affected by the implicit base changes, the simple fix (and recommended approach) is to just set an explicit |
Fixed by #233. |
Published gulp-watch@4.3.7! 🎉 |
There is an issue when using absolute paths as globs in
gulp-watch
.Example:
Gulpfile is located under:
/home/username/tmp/gulpfile.js
.This was working without problems in
4.3.5
, and was broken by this commit. After the change matching of absolute glob and relative file path is not correct andglob
is always-1
.Please provide more information about why this check is needed in that situation.
Thanks for the great work on the plugin.
The text was updated successfully, but these errors were encountered: