Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the use of watchman for react native?

Tags:

Can anybody describe clearly what the use of watchman available in npm library?

----Details I found---

npm - npm is the largest NodeJS package manager

NodeJS - Server-side Javascript runtime

Watchman - Simple utility that watches files/directories for changes and performs an action when they change(This is not clear for me/ what it deoes?/is there any example?)

like image 270
Lakshitha Kanchana Avatar asked Feb 14 '17 20:02

Lakshitha Kanchana


People also ask

Why We Need node JS for react native?

React Native ships with some tools that are written for Node. js. Node. js is an open source platform built on Chrome's JavaScript runtime; it offers a way to easily build fast, scalable programs.

How do I clear my watchman watch all Del?

This might be related to https://github.com/facebook/react-native/issues/4968 To resolve try the following: 1. Clear watchman watches: `watchman watch-del-all`. 2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.


1 Answers

React Native uses watchman to detect when you've made code changes and then automatically build and push the update to your device without you needing to manually refresh it.

https://facebook.github.io/watchman/ is the home page for the watchman used by React Native. Note that it is different and completely unrelated to https://www.npmjs.com/package/watchman which has some similar functionality.

The Facebook watchman service is designed to scale to very large filesystem trees and to aggregate watching resources across multiple projects. This allows us to re-use those system resources across React Native, Nuclide, Buck and Mercurial and keep them all running faster than they could without the aid of watchman.

You can read more about watchman in this blog post from when we released it: https://www.facebook.com/notes/facebook-engineering/watchman-faster-builds-with-large-source-trees/10151457195103920/

like image 107
Wez Furlong Avatar answered Oct 26 '22 01:10

Wez Furlong