-
Notifications
You must be signed in to change notification settings - Fork 45
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
verifying what backend is being used by watcher #172
Comments
You can explicitly pass the I am not aware that the watcher would fallback, I am not even sure what the fallback would be for macOS? |
thanks for the response @bpasero, I think the fallback will be 'brute-force', but I'm not sure how to verify that the backend is being used. Maybe there is an error message that watcher uses the fallback, but i in chokidar, i do something like this
just wary as I have improperly bundled fs-events into my electron build and the production build chokidar was not using fs-events. |
I am quite certain that parcel watcher would use |
It does. And it will use kqueue if FSEvents is not available. This is in the README.md, but the point is: how the application can tell in runtime which one the watcher is using? |
Ok, now I am curious as well. I was not aware that |
This function gets called with either a concrete (set via options) backend or with Line 26 in 8dfd994
All of these availability checks (apart from watchman) are really compile time checks, so it depends on what you compile for/against. Not really what is available at runtime (apart from watchman) Fore example, I think it will only use kqueue by default on FreeBSD. And never on macOS because fsevents is always available there and takes priority. |
this may be only an issue when it comes to electron because it is all packaged. I ran into this issue outlined by the blog in https://www.hendrik-erz.de/post/electron-chokidar-and-native-nodejs-modules-a-horror-story-from-integration-hell. Nonetheless, it would be nice to be able to verify the backend at runtime. I have 0 knowledge of C++, so I am unsure of the complexity of adding this functionality. |
Correct. Parcel doesn't use fsevents (the npm package), but fsevents (the C API). |
I found this in the log of
So, I suppose if you detect some files like this, then watchman is used as backend. Reference: facebook.github.io/watchman/docs/cookies |
Hi team,
I am considering switching from chokidar to watcher but need to be able to verify what backend watcher is using.
I have had issues where my final electron build ends up falling back to polling with chokidar, so I want to make sure that watcher is utilizing fs-events.
It is not immediately clear to me how to verify that watcher is using "fs-events" or if it is using the fallback.
Any help would be greatly appreciated! 🙇
Thanks
The text was updated successfully, but these errors were encountered: