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

Test for creating file in subdirectories #103

Open
wants to merge 160 commits into
base: master
Choose a base branch
from

Conversation

floatdrop
Copy link

Hi. Turns out, that if you have empty subfolder - it will not be watched by gaze. Steps for manual reproducing are in this issue.

Test in patch actually hangs, because add event in not emitted.

shama added 30 commits March 19, 2014 21:14
These tests were for specific cases handled by private methods
that have now been removed and therefore these tests should be removed.
@shama
Copy link
Owner

shama commented Apr 21, 2014

This is a tricky one. Since the pattern **/*.js doesn't initially match folder/subfolder, the folder is not watched and therefore doesn't monitor valid added events from within that folder.

Some options we have:

  1. Keep this behavior. If you want to get added events for unmatched folders, you need to specifically watch them.
  2. Watch every potential folder. For the pattern **/*.js, we detect and watch all folders that match **/*. This is pretty wasteful though and not full proof.
  3. Utilize a different file watching mechanism, such as fsevent, either in tandem or instead of. This would require a bit of work to get working consistently.
  4. Another idea?

@lukehorvat
Copy link

Option 2 sounds most like the "expected behaviour" to me. Perhaps make it opt-in to alleviate the wastefulness?

gaze('**/*.js', { matchEmptyDirs: true }, function() { });

@DavidSouther
Copy link

I would like #2, with lukehorvat's suggestion if the wastefullness becomes an issue (this is happening in development environments, not production).

@thebuilder
Copy link

Option 2 sounds like the thing. You could use "!" in the glob to exclude specific subdirs.

@nmagerko
Copy link

I, too, would like to see the second option. It's rather impractical to use gulp tools such as gulp-watch without this functionality!

@demisx
Copy link

demisx commented Aug 31, 2014

👍 to see this merged.

@artch
Copy link

artch commented Oct 6, 2014

👍

@floatdrop
Copy link
Author

@demisx @artch this PR does not contains fix, so merging it will not solve this problem. Just to make it clear.

@artch
Copy link

artch commented Oct 6, 2014

@floatdrop Sure. This 👍 meant to go for option 2 in @shama's post above.

@pyronaur
Copy link

I agree with @nmagerko - watching for new files should be considered an essential feature...

@psi-4ward
Copy link

+1 especially annoying with gulp-watch

@YourDeveloperFriend
Copy link

+1 for option 2. I would expect / to match any files that could ever potentially match that pattern.

@dgieselaar
Copy link

@shama any progress on this? Can I help?

@shama
Copy link
Owner

shama commented Dec 3, 2014

Thanks for the offer! All my focus right now is on getting https://github.com/shama/navelgazer integrated as it will make implementing option 2 above much easier and fix a number of other issues.

Testing and reporting issues on navelgazer would be much appreciated.

hank7444 pushed a commit to hank7444/gulpFrontendMobileTasks that referenced this pull request Dec 5, 2014
// 所以在/js/vendor與js/lib/寫一個_.js來進行第一次觸發, 如果資料夾有檔案後就可以將此js刪除
// bug report: shama/gaze#103
@brian428
Copy link

Since it's been a while since this was last updated, just curious if any progress has been made on handling new files/directories?

@shama
Copy link
Owner

shama commented Feb 23, 2015

@brian428 Feel free to check out the navelgazer branch for progress. I'll be continuing to work on that branch until it's stable.

Although I think @floatdrop and eventually gulp are switching to chokidar. It uses fsevents which watches entire folder trees so it doesn't have this limitation. They've also just recently added file patterns. So definitely worth checking out if this issue is a big problem for you now.

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.

None yet