From 084ac308632c403a060d12f5bba88faac6de1789 Mon Sep 17 00:00:00 2001 From: Miguel Jimenez Esun Date: Fri, 20 Apr 2018 07:24:20 -0700 Subject: [PATCH] Clean buildBundle.js, index.js and Flow types Reviewed By: davidaurelio Differential Revision: D7628725 fbshipit-source-id: 3873e5c7a0c9b988335dcf9b8a11fcf0598a9f50 --- packages/metro/src/Server/__tests__/Server-test.js | 3 +-- packages/metro/src/index.js | 9 --------- packages/metro/src/shared/types.flow.js | 2 -- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/packages/metro/src/Server/__tests__/Server-test.js b/packages/metro/src/Server/__tests__/Server-test.js index 39f2fe6b..0779cca5 100644 --- a/packages/metro/src/Server/__tests__/Server-test.js +++ b/packages/metro/src/Server/__tests__/Server-test.js @@ -23,8 +23,7 @@ jest .mock('metro-core/src/Logger') .mock('../../lib/getAbsolutePath') .mock('../../lib/getPrependedScripts') - .mock('../../lib/transformHelpers') - .mock('../../lib/GlobalTransformCache'); + .mock('../../lib/transformHelpers'); const NativeDate = global.Date; diff --git a/packages/metro/src/index.js b/packages/metro/src/index.js index 9f42b307..b8597395 100644 --- a/packages/metro/src/index.js +++ b/packages/metro/src/index.js @@ -14,7 +14,6 @@ const Config = require('./Config'); const MetroHmrServer = require('./HmrServer'); const MetroServer = require('./Server'); const TerminalReporter = require('./lib/TerminalReporter'); -const TransformCaching = require('./lib/TransformCaching'); const attachWebsocketServer = require('./lib/attachWebsocketServer'); const defaults = require('./defaults'); @@ -33,8 +32,6 @@ const {Terminal} = require('metro-core'); import type {ConfigT} from './Config'; import type {Graph} from './DeltaBundler'; -import type {GlobalTransformCache} from './lib/GlobalTransformCache'; -import type {TransformCache} from './lib/TransformCaching'; import type {Reporter} from './lib/reporting'; import type {RequestOptions, OutputOptions} from './shared/types.flow.js'; import type {Options as ServerOptions} from './shared/types.flow'; @@ -51,12 +48,10 @@ type DeprecatedMetroOptions = {| type PublicMetroOptions = {| ...DeprecatedMetroOptions, config?: ConfigT, - globalTransformCache?: ?GlobalTransformCache, maxWorkers?: number, minifierPath?: string, port?: ?number, reporter?: Reporter, - transformCache?: TransformCache, |}; type PrivateMetroOptions = {| @@ -81,14 +76,12 @@ async function asyncRealpath(path): Promise { async function runMetro({ config, - globalTransformCache, resetCache = false, maxWorkers = getMaxWorkers(), minifierPath, // $FlowFixMe TODO t0 https://github.com/facebook/flow/issues/183 port = null, reporter = new TerminalReporter(new Terminal(process.stdout)), - transformCache = TransformCaching.useTempDir(), watch = false, }: PrivateMetroOptions): Promise { const normalizedConfig = config ? Config.normalize(config) : Config.DEFAULT; @@ -131,7 +124,6 @@ async function runMetro({ normalizedConfig.getModulesRunBeforeMainModule, getRunModuleStatement: normalizedConfig.getRunModuleStatement, getTransformOptions: normalizedConfig.getTransformOptions, - globalTransformCache, hasteImplModulePath: normalizedConfig.hasteImplModulePath, maxWorkers, minifierPath, @@ -145,7 +137,6 @@ async function runMetro({ sourceExts: normalizedConfig.assetTransforms ? sourceExts.concat(assetExts) : sourceExts, - transformCache, transformModulePath: normalizedConfig.getTransformModulePath(), watch, workerPath: diff --git a/packages/metro/src/shared/types.flow.js b/packages/metro/src/shared/types.flow.js index 8dc121d1..7741a898 100644 --- a/packages/metro/src/shared/types.flow.js +++ b/packages/metro/src/shared/types.flow.js @@ -19,7 +19,6 @@ import type { TransformedCode, } from '../JSTransformer/worker'; import type {DynamicRequiresBehavior} from '../ModuleGraph/worker/collectDependencies'; -import type {GlobalTransformCache} from '../lib/GlobalTransformCache'; import type {TransformCache} from '../lib/TransformCaching'; import type {Reporter} from '../lib/reporting'; import type {CacheStore} from 'metro-cache'; @@ -91,7 +90,6 @@ export type Options = {| getPolyfills: ({platform: ?string}) => $ReadOnlyArray, +getRunModuleStatement: (number | string) => string, getTransformOptions?: GetTransformOptions, - globalTransformCache?: ?GlobalTransformCache, hasteImplModulePath?: string, maxWorkers?: number, minifierPath?: string,