metro 0.84.4 → 0.85.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/package.json +17 -17
  2. package/src/Assets.js +3 -1
  3. package/src/Assets.js.flow +31 -25
  4. package/src/Bundler.d.ts +1 -5
  5. package/src/DeltaBundler/DeltaCalculator.d.ts +1 -16
  6. package/src/DeltaBundler/DeltaCalculator.js.flow +1 -1
  7. package/src/DeltaBundler/Graph.d.ts +1 -102
  8. package/src/DeltaBundler/Graph.js.flow +7 -7
  9. package/src/DeltaBundler/Serializers/getAllFiles.js.flow +1 -1
  10. package/src/DeltaBundler/Serializers/getAssets.js.flow +1 -1
  11. package/src/DeltaBundler/Serializers/getExplodedSourceMap.js.flow +5 -5
  12. package/src/DeltaBundler/Serializers/helpers/getSourceMapInfo.js.flow +9 -9
  13. package/src/DeltaBundler/Serializers/hmrJSBundle.js.flow +3 -3
  14. package/src/DeltaBundler/Transformer.d.ts +2 -10
  15. package/src/DeltaBundler/Worker.flow.js.flow +1 -1
  16. package/src/DeltaBundler/WorkerFarm.d.ts +2 -47
  17. package/src/DeltaBundler/getTransformCacheKey.js.flow +3 -3
  18. package/src/DeltaBundler/types.js.flow +10 -10
  19. package/src/DeltaBundler.d.ts +1 -5
  20. package/src/HmrServer.d.ts +2 -45
  21. package/src/HmrServer.js.flow +10 -10
  22. package/src/IncrementalBundler.d.ts +1 -9
  23. package/src/IncrementalBundler.js.flow +9 -6
  24. package/src/ModuleGraph/worker/collectDependencies.d.ts +1 -2
  25. package/src/Server/symbolicate.js.flow +13 -13
  26. package/src/Server.d.ts +3 -179
  27. package/src/Server.js.flow +25 -23
  28. package/src/lib/BatchProcessor.d.ts +1 -21
  29. package/src/lib/CountingSet.js.flow +1 -1
  30. package/src/lib/JsonReporter.d.ts +1 -2
  31. package/src/lib/JsonReporter.js.flow +4 -2
  32. package/src/lib/RamBundleParser.d.ts +1 -6
  33. package/src/lib/TerminalReporter.d.ts +2 -78
  34. package/src/lib/TerminalReporter.js.flow +1 -1
  35. package/src/lib/bundleToString.js.flow +2 -2
  36. package/src/lib/createWebsocketServer.js.flow +4 -4
  37. package/src/lib/formatBundlingError.js.flow +1 -1
  38. package/src/lib/getPreludeCode.js.flow +5 -5
  39. package/src/node-haste/DependencyGraph/ModuleResolution.d.ts +1 -13
  40. package/src/node-haste/DependencyGraph/ModuleResolution.js.flow +1 -1
  41. package/src/node-haste/DependencyGraph/createFileMap.js +0 -1
  42. package/src/node-haste/DependencyGraph/createFileMap.js.flow +0 -1
  43. package/src/node-haste/DependencyGraph.d.ts +1 -30
  44. package/src/node-haste/DependencyGraph.js.flow +2 -2
  45. package/src/shared/output/RamBundle/util.js.flow +4 -2
  46. package/src/shared/types.js.flow +31 -31
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @noformat
8
8
  * @oncall react_native
9
- * @generated SignedSource<<5872ab26db1c8f4499c971170c5012c4>>
9
+ * @generated SignedSource<<44408f85f4340c918786727e30822c20>>
10
10
  *
11
11
  * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
12
  * Original file: packages/metro/src/lib/BatchProcessor.js
@@ -15,8 +15,6 @@
15
15
  * yarn run build-ts-defs (OSS)
16
16
  */
17
17
 
18
- import {setTimeout} from 'timers';
19
-
20
18
  type ProcessBatch<TItem, TResult> = (
21
19
  batch: Array<TItem>,
22
20
  ) => Promise<Array<TResult>>;
@@ -25,11 +23,6 @@ type BatchProcessorOptions = {
25
23
  maximumItems: number;
26
24
  concurrency: number;
27
25
  };
28
- type QueueItem<TItem, TResult> = {
29
- item: TItem;
30
- reject: (error: unknown) => unknown;
31
- resolve: (result: TResult) => unknown;
32
- };
33
26
  /**
34
27
  * We batch items together trying to minimize their processing, for example as
35
28
  * network queries. For that we wait a small moment before processing a batch.
@@ -38,23 +31,10 @@ type QueueItem<TItem, TResult> = {
38
31
  * processing right away.
39
32
  */
40
33
  declare class BatchProcessor<TItem, TResult> {
41
- _currentProcessCount: number;
42
- _options: BatchProcessorOptions;
43
- _processBatch: ProcessBatch<TItem, TResult>;
44
- _queue: Array<QueueItem<TItem, TResult>>;
45
- _timeoutHandle: null | undefined | ReturnType<typeof setTimeout>;
46
34
  constructor(
47
35
  options: BatchProcessorOptions,
48
36
  processBatch: ProcessBatch<TItem, TResult>,
49
37
  );
50
- _onBatchFinished(): void;
51
- _onBatchResults(
52
- jobs: Array<QueueItem<TItem, TResult>>,
53
- results: Array<TResult>,
54
- ): void;
55
- _onBatchError(jobs: Array<QueueItem<TItem, TResult>>, error: unknown): void;
56
- _processQueue(): void;
57
- _processQueueOnceReady(): void;
58
38
  queue(item: TItem): Promise<TResult>;
59
39
  getQueueLength(): number;
60
40
  }
@@ -11,7 +11,7 @@
11
11
 
12
12
  export interface ReadOnlyCountingSet<T> extends Iterable<T> {
13
13
  has(item: T): boolean;
14
- +size: number;
14
+ readonly size: number;
15
15
  count(item: T): number;
16
16
  forEach<ThisT>(
17
17
  callbackFn: (
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @noformat
8
8
  * @oncall react_native
9
- * @generated SignedSource<<e7173f8dc5e076fd37b9a1cecd581f58>>
9
+ * @generated SignedSource<<bfc4caf223ec55afbed87fbd905607ea>>
10
10
  *
11
11
  * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
12
  * Original file: packages/metro/src/lib/JsonReporter.js
@@ -33,7 +33,6 @@ export type SerializedEvent<
33
33
  declare class JsonReporter<
34
34
  TEvent extends {readonly [$$Key$$: string]: unknown},
35
35
  > {
36
- _stream: Writable;
37
36
  constructor(stream: Writable);
38
37
  /**
39
38
  * There is a special case for errors because they have non-enumerable fields.
@@ -19,7 +19,7 @@ export type SerializedError = {
19
19
  ...
20
20
  };
21
21
 
22
- export type SerializedEvent<TEvent extends {+[string]: unknown, ...}> =
22
+ export type SerializedEvent<TEvent extends {readonly [string]: unknown, ...}> =
23
23
  TEvent extends {
24
24
  error: Error,
25
25
  ...
@@ -31,7 +31,9 @@ export type SerializedEvent<TEvent extends {+[string]: unknown, ...}> =
31
31
  }
32
32
  : TEvent;
33
33
 
34
- export default class JsonReporter<TEvent extends {+[string]: unknown, ...}> {
34
+ export default class JsonReporter<
35
+ TEvent extends {readonly [string]: unknown, ...},
36
+ > {
35
37
  _stream: Writable;
36
38
 
37
39
  constructor(stream: Writable) {
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @noformat
8
- * @generated SignedSource<<ebddbde1dcdecbbee129fd96caaf3bb0>>
8
+ * @generated SignedSource<<7be940ed3f4c6dffc465780640e301ec>>
9
9
  *
10
10
  * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
11
11
  * Original file: packages/metro/src/lib/RamBundleParser.js
@@ -24,12 +24,7 @@
24
24
  * getModule(): returns the code for the specified module.
25
25
  */
26
26
  declare class RamBundleParser {
27
- _buffer: Buffer;
28
- _numModules: number;
29
- _startupCodeLength: number;
30
- _startOffset: number;
31
27
  constructor(buffer: Buffer);
32
- _readPosition(pos: number): number;
33
28
  getStartupCode(): string;
34
29
  getModule(id: number): string;
35
30
  }
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @noformat
8
8
  * @oncall react_native
9
- * @generated SignedSource<<8218e45d6b5186264c4bf9e54086708a>>
9
+ * @generated SignedSource<<14645ae49e4ed5ce74bdd181db9098d4>>
10
10
  *
11
11
  * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
12
  * Original file: packages/metro/src/lib/TerminalReporter.js
@@ -15,17 +15,9 @@
15
15
  * yarn run build-ts-defs (OSS)
16
16
  */
17
17
 
18
- import type {BundleDetails, ReportableEvent} from './reporting';
18
+ import type {ReportableEvent} from './reporting';
19
19
  import type {Terminal} from 'metro-core';
20
- import type {HealthCheckResult, WatcherStatus} from 'metro-file-map';
21
20
 
22
- type BundleProgress = {
23
- bundleDetails: BundleDetails;
24
- transformedFileCount: number;
25
- totalFileCount: number;
26
- ratio: number;
27
- isPrefetch?: boolean;
28
- };
29
21
  export type TerminalReportableEvent =
30
22
  | ReportableEvent
31
23
  | {
@@ -41,81 +33,13 @@ export type TerminalReportableEvent =
41
33
  }
42
34
  | {type: 'unstable_server_menu_updated'; message: string}
43
35
  | {type: 'unstable_server_menu_cleared'};
44
- type BuildPhase = 'in_progress' | 'done' | 'failed';
45
- interface SnippetError extends Error {
46
- code?: string;
47
- filename?: string;
48
- snippet?: string;
49
- }
50
36
  /**
51
37
  * We try to print useful information to the terminal for interactive builds.
52
38
  * This implements the `Reporter` interface from the './reporting' module.
53
39
  */
54
40
  declare class TerminalReporter {
55
- /**
56
- * The bundle builds for which we are actively maintaining the status on the
57
- * terminal, ie. showing a progress bar. There can be several bundles being
58
- * built at the same time.
59
- */
60
- _activeBundles: Map<string, BundleProgress>;
61
- _interactionStatus: null | undefined | string;
62
- _scheduleUpdateBundleProgress: {
63
- (data: {
64
- buildID: string;
65
- transformedFileCount: number;
66
- totalFileCount: number;
67
- }): void;
68
- cancel(): void;
69
- };
70
- _prevHealthCheckResult: null | undefined | HealthCheckResult;
71
41
  readonly terminal: Terminal;
72
42
  constructor(terminal: Terminal);
73
- /**
74
- * Construct a message that represents the progress of a
75
- * single bundle build, for example:
76
- *
77
- * BUNDLE path/to/bundle.js ▓▓▓▓▓░░░░░░░░░░░ 36.6% (4790/7922)
78
- */
79
- _getBundleStatusMessage(
80
- $$PARAM_0$$: BundleProgress,
81
- phase: BuildPhase,
82
- ): string;
83
- _logBundleBuildDone(buildID: string): void;
84
- _logBundleBuildFailed(buildID: string): void;
85
- _logInitializing(port: number, hasReducedPerformance: boolean): void;
86
- _logInitializingFailed(port: number, error: SnippetError): void;
87
- /**
88
- * This function is only concerned with logging and should not do state
89
- * or terminal status updates.
90
- */
91
- _log(event: TerminalReportableEvent): void;
92
- /**
93
- * We do not want to log the whole stacktrace for bundling error, because
94
- * these are operational errors, not programming errors, and the stacktrace
95
- * is not actionable to end users.
96
- */
97
- _logBundlingError(error: SnippetError): void;
98
- _logWorkerChunk(origin: 'stdout' | 'stderr', chunk: string): void;
99
- _updateBundleProgress($$PARAM_0$$: {
100
- buildID: string;
101
- transformedFileCount: number;
102
- totalFileCount: number;
103
- }): void;
104
- /**
105
- * This function is exclusively concerned with updating the internal state.
106
- * No logging or status updates should be done at this point.
107
- */
108
- _updateState(event: TerminalReportableEvent): void;
109
- /**
110
- * Return a status message that is always consistent with the current state
111
- * of the application. Having this single function ensures we don't have
112
- * different callsites overriding each other status messages.
113
- */
114
- _getStatusMessage(): string;
115
- _logHmrClientError(e: Error): void;
116
- _logWarning(message: string): void;
117
- _logWatcherHealthCheckResult(result: HealthCheckResult): void;
118
- _logWatcherStatus(status: WatcherStatus): void;
119
43
  /**
120
44
  * Single entry point for reporting events. That allows us to implement the
121
45
  * corresponding JSON reporter easily and have a consistent reporting.
@@ -100,7 +100,7 @@ export default class TerminalReporter {
100
100
  };
101
101
  _prevHealthCheckResult: ?HealthCheckResult;
102
102
 
103
- +terminal: Terminal;
103
+ readonly terminal: Terminal;
104
104
 
105
105
  constructor(terminal: Terminal) {
106
106
  this._activeBundles = new Map();
@@ -15,8 +15,8 @@ import type {Bundle, BundleMetadata} from 'metro-runtime/src/modules/types';
15
15
  * Serializes a bundle into a plain JS bundle.
16
16
  */
17
17
  export default function bundleToString(bundle: Bundle): {
18
- +code: string,
19
- +metadata: BundleMetadata,
18
+ readonly code: string,
19
+ readonly metadata: BundleMetadata,
20
20
  } {
21
21
  let code = bundle.pre.length > 0 ? bundle.pre + '\n' : '';
22
22
  const modules = [];
@@ -13,13 +13,13 @@ import {clearInterval, setInterval} from 'timers';
13
13
  import ws from 'ws';
14
14
 
15
15
  type WebsocketServiceInterface<T> = interface {
16
- +onClientConnect: (
16
+ readonly onClientConnect: (
17
17
  url: string,
18
18
  sendFn: (data: string) => void,
19
19
  ) => Promise<?T>,
20
- +onClientDisconnect?: (client: T) => unknown,
21
- +onClientError?: (client: T, e: Error) => unknown,
22
- +onClientMessage?: (
20
+ readonly onClientDisconnect?: (client: T) => unknown,
21
+ readonly onClientError?: (client: T, e: Error) => unknown,
22
+ readonly onClientMessage?: (
23
23
  client: T,
24
24
  message: string | Buffer | ArrayBuffer | Array<Buffer>,
25
25
  sendFn: (data: string) => void,
@@ -22,7 +22,7 @@ import serializeError from 'serialize-error';
22
22
 
23
23
  export type CustomError = Error &
24
24
  interface {
25
- +type?: string,
25
+ readonly type?: string,
26
26
  filename?: string,
27
27
  lineNumber?: number,
28
28
  errors?: Array<{
@@ -16,11 +16,11 @@ export default function getPreludeCode({
16
16
  requireCycleIgnorePatterns,
17
17
  unstable_forceFullRefreshPatterns,
18
18
  }: {
19
- +extraVars?: {[string]: unknown, ...},
20
- +isDev: boolean,
21
- +globalPrefix: string,
22
- +requireCycleIgnorePatterns: ReadonlyArray<RegExp>,
23
- +unstable_forceFullRefreshPatterns: ReadonlyArray<RegExp>,
19
+ readonly extraVars?: {[string]: unknown, ...},
20
+ readonly isDev: boolean,
21
+ readonly globalPrefix: string,
22
+ readonly requireCycleIgnorePatterns: ReadonlyArray<RegExp>,
23
+ readonly unstable_forceFullRefreshPatterns: ReadonlyArray<RegExp>,
24
24
  }): string {
25
25
  const vars = [
26
26
  // Ensure these variable names match the ones referenced in metro-runtime
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @noformat
8
8
  * @oncall react_native
9
- * @generated SignedSource<<0024fd05b95efe19a24f9acc84ff474b>>
9
+ * @generated SignedSource<<2948a6737474a8f5bd55952246f500d3>>
10
10
  *
11
11
  * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
12
  * Original file: packages/metro/src/node-haste/DependencyGraph/ModuleResolution.js
@@ -24,9 +24,7 @@ import type {ResolverInputOptions} from '../../shared/types';
24
24
  import type {
25
25
  CustomResolver,
26
26
  DoesFileExist,
27
- FileCandidates,
28
27
  FileSystemLookup,
29
- Resolution,
30
28
  ResolveAsset,
31
29
  } from 'metro-resolver';
32
30
  import type {PackageForModule, PackageJson} from 'metro-resolver/private/types';
@@ -68,11 +66,7 @@ type Options = Readonly<{
68
66
  unstable_incrementalResolution: boolean;
69
67
  }>;
70
68
  export declare class ModuleResolver {
71
- _options: Options;
72
- _projectRootFakeModulePath: string;
73
- _cachedEmptyModule: null | undefined | BundlerResolution;
74
69
  constructor(options: Options);
75
- _getEmptyModule(): BundlerResolution;
76
70
  resolveDependency(
77
71
  originModulePath: string,
78
72
  dependency: TransformResultDependency,
@@ -80,12 +74,6 @@ export declare class ModuleResolver {
80
74
  platform: string | null,
81
75
  resolverOptions: ResolverInputOptions,
82
76
  ): BundlerResolution;
83
- /**
84
- * TODO: Return Resolution instead of coercing to BundlerResolution here
85
- */
86
- _getFileResolvedModule(resolution: Resolution): BundlerResolution;
87
- _logWarning: (message: string) => void;
88
- _removeRoot(candidates: FileCandidates): FileCandidates;
89
77
  }
90
78
  export declare class UnableToResolveError extends Error {
91
79
  /**
@@ -291,7 +291,7 @@ export class UnableToResolveError extends Error {
291
291
  /**
292
292
  * Fixed type field in common with other Metro build errors.
293
293
  */
294
- +type: 'UnableToResolveError' = 'UnableToResolveError';
294
+ readonly type: 'UnableToResolveError' = 'UnableToResolveError';
295
295
 
296
296
  constructor(
297
297
  originModulePath: string,
@@ -114,7 +114,6 @@ function createFileMap(config, options) {
114
114
  ...config.watcher.additionalExts,
115
115
  ]),
116
116
  ),
117
- forceNodeFilesystemAPI: !config.resolver.useWatchman,
118
117
  healthCheck: config.watcher.healthCheck,
119
118
  ignorePattern: getIgnorePattern(config),
120
119
  maxWorkers: config.maxWorkers,
@@ -125,7 +125,6 @@ export default function createFileMap(
125
125
  ...config.watcher.additionalExts,
126
126
  ]),
127
127
  ),
128
- forceNodeFilesystemAPI: !config.resolver.useWatchman,
129
128
  healthCheck: config.watcher.healthCheck,
130
129
  ignorePattern: getIgnorePattern(config),
131
130
  maxWorkers: config.maxWorkers,
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @noformat
8
8
  * @oncall react_native
9
- * @generated SignedSource<<13f1483d2a732241f8d9eae463399b0e>>
9
+ * @generated SignedSource<<1cc985f3869f7db49aca7daeca848b82>>
10
10
  *
11
11
  * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
12
12
  * Original file: packages/metro/src/node-haste/DependencyGraph.js
@@ -21,32 +21,10 @@ import type {
21
21
  } from '../DeltaBundler/types';
22
22
  import type {ResolverInputOptions} from '../shared/types';
23
23
  import type {ConfigT} from 'metro-config';
24
- import type {
25
- ChangeEvent,
26
- FileSystem,
27
- HasteMap,
28
- HealthCheckResult,
29
- WatcherStatus,
30
- default as MetroFileMap,
31
- } from 'metro-file-map';
32
24
 
33
- import {ModuleResolver} from './DependencyGraph/ModuleResolution';
34
25
  import EventEmitter from 'events';
35
26
 
36
27
  declare class DependencyGraph extends EventEmitter {
37
- _config: ConfigT;
38
- _haste: MetroFileMap;
39
- _fileSystem: FileSystem;
40
- _hasteMap: HasteMap;
41
- _moduleResolver: ModuleResolver;
42
- _resolutionCache: Map<
43
- string | symbol,
44
- Map<
45
- string | symbol,
46
- Map<string | symbol, Map<string | symbol, BundlerResolution>>
47
- >
48
- >;
49
- _initializedPromise: Promise<void>;
50
28
  constructor(
51
29
  config: ConfigT,
52
30
  options?: {
@@ -54,14 +32,7 @@ declare class DependencyGraph extends EventEmitter {
54
32
  readonly watch?: boolean;
55
33
  },
56
34
  );
57
- _onWatcherHealthCheck(result: HealthCheckResult): void;
58
- _onWatcherStatus(status: WatcherStatus): void;
59
35
  ready(): Promise<void>;
60
- _onHasteChange($$PARAM_0$$: ChangeEvent): void;
61
- _createModuleResolver(): void;
62
- _getClosestPackage(
63
- absoluteModulePath: string,
64
- ): null | undefined | {packageJsonPath: string; packageRelativePath: string};
65
36
  getAllFiles(): Array<string>;
66
37
  /**
67
38
  * Used when watcher.unstable_lazySha1 is true
@@ -88,8 +88,8 @@ export default class DependencyGraph extends EventEmitter {
88
88
  constructor(
89
89
  config: ConfigT,
90
90
  options?: {
91
- +hasReducedPerformance?: boolean,
92
- +watch?: boolean,
91
+ readonly hasReducedPerformance?: boolean,
92
+ readonly watch?: boolean,
93
93
  },
94
94
  ) {
95
95
  super();
@@ -135,8 +135,10 @@ function combineMaps(
135
135
  return sections;
136
136
  }
137
137
 
138
- const joinModules = (modules: ReadonlyArray<{+code: string, ...}>): string =>
139
- modules.map((m: {+code: string, ...}) => m.code).join('\n');
138
+ const joinModules = (
139
+ modules: ReadonlyArray<{readonly code: string, ...}>,
140
+ ): string =>
141
+ modules.map((m: {readonly code: string, ...}) => m.code).join('\n');
140
142
 
141
143
  export {
142
144
  combineSourceMaps,
@@ -47,24 +47,24 @@ export type ReadonlySourceLocation = Readonly<{
47
47
  }>;
48
48
 
49
49
  export type BundleOptions = {
50
- +customResolverOptions: CustomResolverOptions,
50
+ readonly customResolverOptions: CustomResolverOptions,
51
51
  customTransformOptions: CustomTransformOptions,
52
52
  dev: boolean,
53
53
  entryFile: string,
54
- +excludeSource: boolean,
55
- +inlineSourceMap: boolean,
56
- +lazy: boolean,
54
+ readonly excludeSource: boolean,
55
+ readonly inlineSourceMap: boolean,
56
+ readonly lazy: boolean,
57
57
  minify: boolean,
58
- +modulesOnly: boolean,
58
+ readonly modulesOnly: boolean,
59
59
  onProgress: ?(doneCont: number, totalCount: number) => unknown,
60
- +platform: ?string,
61
- +runModule: boolean,
62
- +shallow: boolean,
60
+ readonly platform: ?string,
61
+ readonly runModule: boolean,
62
+ readonly shallow: boolean,
63
63
  sourceMapUrl: ?string,
64
64
  sourceUrl: ?string,
65
65
  createModuleIdFactory?: () => (path: string) => number,
66
- +unstable_transformProfile: TransformProfile,
67
- +sourcePaths: SourcePathsMode,
66
+ readonly unstable_transformProfile: TransformProfile,
67
+ readonly sourcePaths: SourcePathsMode,
68
68
  };
69
69
 
70
70
  export type BuildOptions = Readonly<{
@@ -77,18 +77,18 @@ export type ResolverInputOptions = Readonly<{
77
77
  }>;
78
78
 
79
79
  export type SerializerOptions = {
80
- +sourceMapUrl: ?string,
81
- +sourceUrl: ?string,
82
- +runModule: boolean,
83
- +excludeSource: boolean,
84
- +inlineSourceMap: boolean,
85
- +modulesOnly: boolean,
86
- +sourcePaths: SourcePathsMode,
80
+ readonly sourceMapUrl: ?string,
81
+ readonly sourceUrl: ?string,
82
+ readonly runModule: boolean,
83
+ readonly excludeSource: boolean,
84
+ readonly inlineSourceMap: boolean,
85
+ readonly modulesOnly: boolean,
86
+ readonly sourcePaths: SourcePathsMode,
87
87
  };
88
88
 
89
89
  export type GraphOptions = {
90
- +lazy: boolean,
91
- +shallow: boolean,
90
+ readonly lazy: boolean,
91
+ readonly shallow: boolean,
92
92
  };
93
93
 
94
94
  // Stricter representation of BundleOptions.
@@ -108,24 +108,24 @@ export type ModuleGroups = {
108
108
  };
109
109
 
110
110
  export type ModuleTransportLike = {
111
- +code: string,
112
- +id: number,
113
- +map: ?MetroSourceMapOrMappings,
114
- +name?: string,
115
- +sourcePath: string,
111
+ readonly code: string,
112
+ readonly id: number,
113
+ readonly map: ?MetroSourceMapOrMappings,
114
+ readonly name?: string,
115
+ readonly sourcePath: string,
116
116
  ...
117
117
  };
118
118
  export type ModuleTransportLikeStrict = {
119
- +code: string,
120
- +id: number,
121
- +map: ?MetroSourceMapOrMappings,
122
- +name?: string,
123
- +sourcePath: string,
119
+ readonly code: string,
120
+ readonly id: number,
121
+ readonly map: ?MetroSourceMapOrMappings,
122
+ readonly name?: string,
123
+ readonly sourcePath: string,
124
124
  };
125
125
  export type RamModuleTransport = {
126
126
  ...ModuleTransportLikeStrict,
127
- +source: string,
128
- +type: string,
127
+ readonly source: string,
128
+ readonly type: string,
129
129
  };
130
130
 
131
131
  export type OutputOptions = {