-
Notifications
You must be signed in to change notification settings - Fork 636
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add watch option to Server and disable file watchers for runBuild (#507)
Summary: **Summary** In this PR I am disabling file watching for bundle generation done through `runBuild`. A `watch` option is also added to `Server` in order to enable that (and also because `Server` is used by the React Native CLI instead of `runBuild`). The goal of this is to solve `ENOSPC` errors related to excessive file watcher use, particularly in CI environments. See: #355 Context: I previously attempted to fix this by resolving a regression in the existing `watch` config option: #491 Which was closed in favor of a similar PR: #497 Which was then re-created in: #503 (and landed) The above PR was modified to automatically set the `watch` value depending on whether it was built in a CI environment. There was a desire to remove the `watch` config option altogether. At the end, we concluded that there is still a need for a caller to turn off file watching explicitly, and not only through CI detection. Therefore, I'm threading it through the code as an option that is passed through programmatically and *not* through the config. Once/if this lands, I will update the React Native CLI to use this option. **Test plan** I used the rn-cli as a test harness of sorts. Invoked metro via `react-native start` - Observed that the `watch` flag was true through `console.log` Invoked metro via `react-native bundle` - Observed that `watch` was set to false. Relatively new to this project, so please let me know if I should be taking a look at anything else. Pull Request resolved: #507 Differential Revision: D19341662 Pulled By: cpojer fbshipit-source-id: d0430364d57fefe027f6b1f58f964d9765cda752
- Loading branch information
1 parent
6ee6285
commit 1a38e00
Showing
5 changed files
with
39 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters