Skip to content

Commit

Permalink
Remove watch parameter from config
Browse files Browse the repository at this point in the history
Reviewed By: mjesun

Differential Revision: D10033101

fbshipit-source-id: 0976e3b676b404ade46fe9e0b1680adfc39bc844
  • Loading branch information
rafeca authored and facebook-github-bot committed Sep 27, 2018
1 parent 9116b35 commit 0d6c135
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ Object {
"workerPath": "metro/src/DeltaBundler/Worker",
},
"transformerPath": "",
"watch": false,
"watchFolders": Array [
"/",
],
Expand Down Expand Up @@ -197,7 +196,6 @@ Object {
"workerPath": "metro/src/DeltaBundler/Worker",
},
"transformerPath": "",
"watch": false,
"watchFolders": Array [
"/",
],
Expand Down
1 change: 0 additions & 1 deletion packages/metro-config/src/__tests__/convertConfig-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ describe('convertConfig', () => {
minifierPath: DEFAULT_METRO_MINIFIER_PATH,
port: 8080,
reporter: new TerminalReporter(new Terminal(process.stdout)),
watch: false,
});

expect(prettyFormat(convertedConfig)).toEqual(prettyFormat(defaultConfig));
Expand Down
1 change: 0 additions & 1 deletion packages/metro-config/src/configTypes.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ type MetalConfigT = {
transformerPath: string,
reporter: Reporter,
resetCache: boolean,
watch: boolean,
watchFolders: Array<string>,
};

Expand Down
1 change: 0 additions & 1 deletion packages/metro-config/src/convertConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ async function convertOldToNew({
watchFolders,
transformerPath: defaultConfig.transformerPath,
resetCache,
watch,
maxWorkers,
};
}
Expand Down
1 change: 0 additions & 1 deletion packages/metro-config/src/defaults/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ const getDefaultValues = (projectRoot: ?string): IntermediateConfigT => ({
// node_modules/metro/
projectRoot: projectRoot || path.resolve(__dirname, '../../..'),
watchFolders: [],
watch: false,
transformerPath: require.resolve('metro/src/JSTransformer/worker.js'),
maxWorkers: getMaxWorkers(),
resetCache: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ describe('Transformer', function() {
projectRoot: '/root',
resetCache: false,
transformerPath: '/path/to/transformer.js',
watch: false,
watchFolders: ['/root'],
};

Expand Down
3 changes: 1 addition & 2 deletions packages/metro/src/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ class Server {

constructor(config: ConfigT) {
this._config = config;
// TODO(ives): Add config as a CLI param instead
this._config.watch = true;

if (this._config.resetCache) {
this._config.cacheStores.forEach(store => store.clear());
this._config.reporter.update({type: 'transform_cache_reset'});
Expand Down
2 changes: 1 addition & 1 deletion packages/metro/src/node-haste/DependencyGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class DependencyGraph extends EventEmitter {
roots: config.watchFolders,
throwOnModuleCollision: true,
useWatchman: config.resolver.useWatchman,
watch: config.watch,
watch: true,
});
}

Expand Down

0 comments on commit 0d6c135

Please sign in to comment.