Closed ficristo closed 8 years ago
Or this https://github.com/amasad/sane that can use watchman under the hood but it's not necessary.
Gaze is (yet another) option: https://github.com/shama/gaze (used by grunt-contrib-watch
for example)
I haven't done much research on this in a few months, but this https://github.com/paulmillr/chokidar was the better library I have seen around. It is used by watchify (browserify's watching plugin).
@ficristo I have not noticed performance issues... But perhaps that's due to the fact that it is part of build process where it is really hard to see where performance is lost. How did you go about testing this performance issues you saw? Can you share you test setup so that I can run them? I am really curious :)
@ficristo is the motivation purely about switching to a more actively maintained library? Curious to know if there are issues that you are trying to solve.
No, there aren't specific problems. I only think using up to date library is (almost) always a plus.
@ficristo sounds good to me. this will require quite a bit testing; you got different platforms that behave differently. If my memory serves me right, @peterflynn was one of the main dev involved in the current implementation. Perhaps he could chime in when he gets a sec.
You mentioned a really key point. chokidar will recursively add watchers and brackets does not. This is concerning. :)
Curious to know how does this works in Ubuntu... Have you tried it?
No, I didn't. I'm not really Linux friendly...
Let's continue further discussion in the actual PR https://github.com/adobe/brackets/pull/12190#issuecomment-183676768.
Another couple of interesting libs. https://github.com/atom/node-pathwatcher https://github.com/bevry/watchr
This PR https://github.com/adobe/brackets/pull/12647 is now using chokidar.
Now that #12647 has merged we are using https://github.com/Microsoft/vscode-filewatcher-windows on Windows and https://github.com/paulmillr/chokidar on Linux and macOS.
Right now we use an outdated version of fsevents and fsevents_win to watch files. I think using a library better maintained would be a nice alternative option. I tried once to use chokidar but I've had some performance problem: maybe because it watches file recursively and Brackets doesn't. I don't know. Another library could be https://github.com/facebook/watchman/tree/master/node