question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

🙋 Replace chokidar with fb-watchman

See original GitHub issue

Choose one: is this a 🐛 bug report or 🙋 feature request?

chokidar only supports native file-system notification for MacOS (a limitation because it relies on fsevents).

watchman provides efficient fs notification for all platforms. Watchaman is used by the react-native bundler, which seems to work pretty well.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

7reactions
DeMoorJaspercommented, Feb 22, 2018

I’m not sure it’s worth switching as installing watchman to enable the watcher would sort of defy the whole zero-config experience.

On the other side however, we could create a simple adapter in between our watcher code and chokidar and watchman, and switch according to what exactly is installed. If i’m not mistaken, watchman’s node mappings have a function that checks what version is installed. If no watchman is found we could always fallback to chokidar with polling to ensure 100% accuracy, but poor performance. (and add watchman install instructions to docs for optimal performance of the watcher)

I have not experimented enough with watchman to be able to say if it’s even that much better than chokidar in the first place (it might not be worth it)

3reactions
AndyOGocommented, Mar 20, 2018

Hey guys, that’s really annoying with watchman… Basically it is build as a service which you have to install at your OS first. Afterwards you can npm install fb-watchman to get the NodeJS client working, which consumes this service. Really no one wants out-of-npm installs for node apps to be working 😱

Node Sentinel File Watcher NSFW provides proper bindings and is a much better alternative to chokidar 🎉 https://github.com/Axosoft/nsfw/issues/18

Read more comments on GitHub >

github_iconTop Results From Across the Web

chokidar vs fb-watchman vs gaze vs watch - npm trends
Comparing trends for .
Read more >
fb-watchman - npm
Start using fb-watchman in your project by running `npm i fb-watchman`. There are 520 other projects in the npm registry using fb-watchman.
Read more >
<ForrigeUke uke=”19” år=”2020” /> | by Jonas Løchsen - Bekk
Rebuilding our tech stack for a new Facebook.com - Facebook Engineering ... Stor nyhet for alle Gatsby- og TypeScript-fans🙋‍♂️ Alt man slipper å...
Read more >
дэн on Twitter: "Has anyone tried to make Webpack use https ...
Yes but I've heard many reports about it being less than optimal in some cases. We use Watchman at FB on giant codebases....
Read more >
you might have mismatching versions of react and ... - OSCHINA
This renderer should currently be considered as experimental, is subject to change and will only work with React's latest version (17.x.x, using Fiber)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found