gaze
gaze copied to clipboard
event added firing incorrectly when files added
The following glob fires 'added' event when any directory is added: Given:
gaze = new Gaze 'src/templates/**/*.html'
gaze.on 'all', (evt, p) ->
switch evt
when 'added'
console.log 'added: ' + p
Then: the 'added' event will fire if a directory is added (e.g. src/templates/dir1) OS = OSX Mavericks
Which version of gaze and node.js? Thanks!
latest versions of both
On Fri, Dec 13, 2013 at 8:13 AM, Kyle Robinson Young < [email protected]> wrote:
Which version of gaze and node.js? Thanks!
— Reply to this email directly or view it on GitHubhttps://github.com/shama/gaze/issues/61#issuecomment-30521041 .
Yeah i've got the same issue here.
I got the following directory structure:
app
lib
- should only watch in here.
app.js
I instantiate a new Gaze watcher with the glob lib/**
and if I then log the watched files with this.relative()
, I get something like this:
{
'lib/':[
'base-styles/',
'boot/'
],
'.':[
'lib/'
],
'lib/base-styles/':[
'component.json',
'index.css'
],
'lib/boot/':[
'component.json',
'index.css',
'index.html',
'index.js'
]
}
Which seems completely right.
But as soon as I change something that is not in the lib
directory like adding a new directory outside of lib
in the app
folder, it fires the added
event anyways. But If I remove the directory nothings happening. There's something wrong with the added
event handler i guess.
PATH/app/newDirectory/ was added
Or am I doing something wrong here?
btw i'm using the latest version of gaze and node.js stable
Consistently having this issue. node 0.10.24, OSX
Just an update. This (and just about every other issue in the tracker) is fixed in the v0.5
branch. It is using quite a different approach then v0.4 but remains backwards compatible. The biggest difference is it will now only use native events then fall back to stat polling if EMFILE
is hit (but still reports the error in case you want to notify users to increase their limits). You can also force it into stat polling mode, if needed, such as with watching files on networked drives, etc. Also it is way more responsive; for most events, less than 1ms response time consistently.
Just needs a whole lot more testing, especially on Windows.
@shama Awesome! Thanks for keeping this library going strong. Do you have a gittip?
Yes I do but don't really advertise it. :)
Ok v0.5 stable on osx/windows but still some issues to resolve on linux.
Also a note, I don't really want to bother too much with node v0.8 so I'm just going to give users a bundled gaze v0.4 if they're still on node v0.8. Which should be fine, IMO, as gaze v0.5 is backwards compatible and were getting close to node v0.12.
@Contra Which versions of node does gulp currently target? I saw that glob-watcher says "node": ">= 0.4.0"
but I assumed that wasn't true. :)
@shama gulp is 0.9+ due to 0.8 streams being bad. The actual glob-watcher code is 0.4+ (or whatever the highest dependency version is so probably higher)