react-native/local-cli
Christoph Pojer 29d9c35e12 Add --maxWorkers flag and allow transformers to run in-band.
Summary:
This diff cleans up some cruft and adds some features:

* It removes the usage of an env variable to control workers.
* It removes the lazy and handwavy calculation on how many workers to use for jest-haste-map. Jest itself uses the maximum amount of workers available and it has never been reported as an issue – especially since it is a one-time startup cost of about 3 seconds on a cold cache only.
* It adds a `--max-workers` flag to replace the env variable. This one is able to control both the number of workers for `jest-haste-map` as well as the transformers.
* It makes the transformers run in the parent process if 1 or fewer workers are are specified. This should help with debugging.

Once you approve this diff, I will publish a new version of metro to npm and update the version used in RN and remove the use of the env variable altogether: https://our.intern.facebook.com/intern/biggrep/?corpus=xplat&filename=&case=false&view=default&extre=&s=REACT_NATIVE_MAX_WORKERS&engine=apr_strmatch&context=false&filter[uninteresting]=false&filter[intern]=false&filter[test]=false&grep_regex=

Note: the process of adding a CLI option is really broken. Commander also has a weird API. We should consider building a better public API for Metro and then consider how to build a new CLI on top of it and simplify our internal integration. I really don't like how Metro is integrated across pieces of the RN cli in ways that is hard to manage. But that is a larger task for another time :)

Reviewed By: jeanlauliac

Differential Revision: D5217726

fbshipit-source-id: 74efddbb87755a9e744c816fbc62efa21f6a79bf
2017-06-13 09:16:03 -07:00
..
__mocks__ Fix lint in local-cli 2016-11-14 11:13:42 -08:00
bundle Add --maxWorkers flag and allow transformers to run in-band. 2017-06-13 09:16:03 -07:00
core RN: Node v8 Workaround for `local-cli/core/__tests__` 2017-06-10 00:08:23 -07:00
dependencies Add --maxWorkers flag and allow transformers to run in-band. 2017-06-13 09:16:03 -07:00
eject Eject CLI command to re-create native folders 2017-02-03 12:58:46 -08:00
generator CLI: Add support for templates fetched from npm 2017-02-27 14:04:57 -08:00
init CLI: Add support for project templates 2017-02-06 12:31:25 -08:00
install Use Yarn for Install/Uninstall CLI if available 2017-02-02 05:13:33 -08:00
library Fix new-library to copy to current project 2017-05-29 12:46:08 -07:00
link Remove react-native/packager folder. 2017-06-07 07:30:32 -07:00
logAndroid Use native Promise in local-cli 2016-11-21 10:28:34 -08:00
logIOS Use native Promise in local-cli 2016-11-21 10:28:34 -08:00
runAndroid Move packager launcher scripts outside of `packager/` 2017-05-23 16:17:09 -07:00
runIOS disable automock by default in as many places as possible @bypass-lint 2017-06-08 07:45:54 -07:00
server Add --maxWorkers flag and allow transformers to run in-band. 2017-06-13 09:16:03 -07:00
templates disable automock by default in as many places as possible @bypass-lint 2017-06-08 07:45:54 -07:00
upgrade New upgrading process, relying on Git 2016-11-28 08:28:35 -08:00
util Add --maxWorkers flag and allow transformers to run in-band. 2017-06-13 09:16:03 -07:00
.eslintrc disable `no-alert` eslint rule for node code 2017-05-03 06:51:47 -07:00
cli.js packager: centralize babelRegisterOnly callsites 2017-01-06 06:13:54 -08:00
cliEntry.js Stronger config types 2017-05-03 06:51:47 -07:00
commands.js packager: server.js: @flow 2017-05-17 05:03:41 -07:00
setup_env.bat Fix comments on .bat file 2015-10-28 21:36:07 -04:00
setup_env.sh CLI: Adding shebang to setup_env.sh script 2017-05-31 02:46:23 -07:00
wrong-react-native.js Fix usage of react-native cli inside package.json scripts 2016-04-26 15:42:35 -07:00