Comments (12)
I think you're running into this nodejs/node-v0.x-archive#5463. Sometimes restarting helps. Also maybe you're watching more directories than you have to. How many are you watching? Otherwise it's fixed in v0.11
from sane.
Yep that's what it is. I thought the glob would only watch those files, but it was watching all the dirs in node_modules, related to this: #23
Tradeoff I guess between the feature add/remove and watching a bunch of directories.
from sane.
Maybe you could conditionally watch directories (for the add and remove feature):
sane(root, glob)
.watch('lib')
.on('change', fn)
.on('add', fn)
from sane.
Tradeoff I guess between the feature add/remove and watching a bunch of directories.
That's part of it but another problem is that sane will need to understand globs in order to safely ignore directories that will not produce a matching path. Example:
var glob = 'a/*.js';
var directory = 'a';
var file = 'a/a.js';
minimatch(directory, glob); // false
minimatch(file, glob); // true
Is there an easy way to do that?
It seems that minimatch does expose internal methods maybe we could use to do a partial match. If you want to work on it, I'd love to help.
from sane.
Also we can add a filter function to decide whether to watch a dir or not
from sane.
Reopening this to try and figure ways around it. Although this is fixed in v0.12 it seems like it's still some time away
from sane.
FYI 2d2b1a2 adds support for watchman which works really great on OS X and linux and doesn't suffer from this problem. I'd still want to find some time to make sane have better understanding of globs to lessen the severity of this bug
from sane.
@amasad sweet!
question: why not just make watchman the default, does it not do everything the default does?
from sane.
No windows support :/ But they're working on it but won't come until next year.
It also requires people to go install a native program which I feel most people wouldn't want to do when starting to use sane. However, all the APIs are the same (they run the same test suite) so it should be easy for clients of sane to programmatically select the mode (and programmatically install watchman as well) depending on the OS and node version. I wrote a section in the readme to help people decide https://github.com/amasad/sane#how-to-choose-a-mode
from sane.
Ahh gotcha. So fb-watchmen
is just a client into the C program? Would it make sense / do you know of anyone already node-gyp
'ing the C program?
I wrote a section in the readme to help people decide https://github.com/amasad/sane#how-to-choose-a-mode
Oops I missed that haha, thanks
from sane.
So fb-watchmen is just a client into the C program?
yes
Would it make sense / do you know of anyone already node-gyp'ing the C program?
I don't think anyone is working on it. We just added the "fb-watchman" client. Although it's designed to be a background daemon, I can't see why it wouldn't make sense to make it into an addont. If you're interested in that, open an issue https://github.com/facebook/watchman the folks running the project are very helpful in these things.
from sane.
I believe we can close this now. v0.12 is EOL, and watchman support is baked in
from sane.
Related Issues (20)
- Watch linked directories
- add utilize to "autodetect" best watcher.
- bump engine support to node version that are supported.
- bump engine support to node version that are supported.
- Update exec-sh dependency HOT 5
- Invalid tag name "[email protected]": Tags may not have any characters that encodeURIComponent encodes. HOT 1
- Why the [email protected] don't support node 9.*.* HOT 2
- Watching file recursively HOT 6
- Bundle size
- Renaming directories with childs on windows locked HOT 1
- Watchman does not understand micromatch globs HOT 9
- Multiple package locks HOT 1
- Support for more Node.js versions HOT 1
- Is there support for killing the currently running process? HOT 1
- Consider dropping `node@6`. HOT 2
- upgrade to v ^4.x.x of micromatch to avoid npm vulnerability 1490 in kind-of
- OS Command Injection in execa (execa@^1.0.0) HOT 4
- High severity vulnerability detected in sane dependencies HOT 1
- High Vulnerability is found in the dependency. HOT 1
- EMFILE: too many open files, watch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sane.