metro 0.80.6 → 0.80.8

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metro",
3
- "version": "0.80.6",
3
+ "version": "0.80.8",
4
4
  "description": "🚇 The JavaScript bundler for React Native.",
5
5
  "main": "src/index.js",
6
6
  "bin": "src/cli.js",
@@ -28,24 +28,24 @@
28
28
  "denodeify": "^1.2.1",
29
29
  "error-stack-parser": "^2.0.6",
30
30
  "graceful-fs": "^4.2.4",
31
- "hermes-parser": "0.19.1",
31
+ "hermes-parser": "0.20.1",
32
32
  "image-size": "^1.0.2",
33
33
  "invariant": "^2.2.4",
34
34
  "jest-worker": "^29.6.3",
35
35
  "jsc-safe-url": "^0.2.2",
36
36
  "lodash.throttle": "^4.1.1",
37
- "metro-babel-transformer": "0.80.6",
38
- "metro-cache": "0.80.6",
39
- "metro-cache-key": "0.80.6",
40
- "metro-config": "0.80.6",
41
- "metro-core": "0.80.6",
42
- "metro-file-map": "0.80.6",
43
- "metro-resolver": "0.80.6",
44
- "metro-runtime": "0.80.6",
45
- "metro-source-map": "0.80.6",
46
- "metro-symbolicate": "0.80.6",
47
- "metro-transform-plugins": "0.80.6",
48
- "metro-transform-worker": "0.80.6",
37
+ "metro-babel-transformer": "0.80.8",
38
+ "metro-cache": "0.80.8",
39
+ "metro-cache-key": "0.80.8",
40
+ "metro-config": "0.80.8",
41
+ "metro-core": "0.80.8",
42
+ "metro-file-map": "0.80.8",
43
+ "metro-resolver": "0.80.8",
44
+ "metro-runtime": "0.80.8",
45
+ "metro-source-map": "0.80.8",
46
+ "metro-symbolicate": "0.80.8",
47
+ "metro-transform-plugins": "0.80.8",
48
+ "metro-transform-worker": "0.80.8",
49
49
  "mime-types": "^2.1.27",
50
50
  "node-fetch": "^2.2.0",
51
51
  "nullthrows": "^1.1.1",
@@ -66,8 +66,8 @@
66
66
  "dedent": "^0.7.0",
67
67
  "jest-snapshot": "^29.6.3",
68
68
  "jest-snapshot-serializer-raw": "^1.2.0",
69
- "metro-babel-register": "0.80.6",
70
- "metro-memory-fs": "0.80.6",
69
+ "metro-babel-register": "0.80.8",
70
+ "metro-memory-fs": "0.80.8",
71
71
  "mock-req": "^0.2.0",
72
72
  "mock-res": "^0.6.0",
73
73
  "stack-trace": "^0.0.10"
package/src/Bundler.d.ts CHANGED
@@ -11,8 +11,8 @@
11
11
  import type {TransformResultWithSource} from './DeltaBundler';
12
12
  import type {TransformOptions} from './DeltaBundler/Worker';
13
13
  import type DependencyGraph from './node-haste/DependencyGraph';
14
- import type {ConfigT} from 'metro-config';
15
14
  import type {EventEmitter} from 'events';
15
+ import type {ConfigT} from 'metro-config';
16
16
 
17
17
  export interface BundlerOptions {
18
18
  readonly hasReducedPerformance?: boolean;
@@ -8,11 +8,11 @@
8
8
  * @oncall react_native
9
9
  */
10
10
 
11
+ import type {TransformResult} from './types';
11
12
  import type {
12
13
  JsTransformerConfig,
13
14
  JsTransformOptions,
14
15
  } from 'metro-transform-worker';
15
- import type {TransformResult} from './types';
16
16
 
17
17
  type LogEntry = unknown;
18
18
 
@@ -8,11 +8,11 @@
8
8
  * @oncall react_native
9
9
  */
10
10
 
11
- import type {JsTransformOptions} from 'metro-transform-worker';
12
- import type {RequireContextParams} from '../ModuleGraph/worker/collectDependencies';
13
11
  import type {RequireContext} from '../lib/contextModule';
14
12
  import type CountingSet from '../lib/CountingSet';
13
+ import type {RequireContextParams} from '../ModuleGraph/worker/collectDependencies';
15
14
  import type {Graph} from './Graph';
15
+ import type {JsTransformOptions} from 'metro-transform-worker';
16
16
 
17
17
  export interface MixedOutput {
18
18
  readonly data: {code: string};
@@ -8,16 +8,17 @@
8
8
  * @oncall react_native
9
9
  */
10
10
 
11
+ import type Bundler from './Bundler';
11
12
  import type {
12
13
  Options as DeltaBundlerOptions,
13
14
  ReadOnlyDependencies,
14
15
  TransformInputOptions,
15
16
  } from './DeltaBundler/types';
16
- import {ResolverInputOptions} from './shared/types';
17
- import type {ConfigT} from 'metro-config';
18
17
  import type {GraphId} from './lib/getGraphId';
18
+ import type {ConfigT} from 'metro-config';
19
+
19
20
  import DeltaBundler, {DeltaResult, Graph, Module} from './DeltaBundler';
20
- import type Bundler from './Bundler';
21
+ import {ResolverInputOptions} from './shared/types';
21
22
 
22
23
  export type RevisionId = string;
23
24
 
package/src/Server.d.ts CHANGED
@@ -10,7 +10,6 @@
10
10
 
11
11
  import type {AssetData} from './Asset';
12
12
  import type {RamBundleInfo} from './DeltaBundler/Serializers/getRamBundleInfo';
13
- import IncrementalBundler, {RevisionId} from './IncrementalBundler';
14
13
  import type {GraphId} from './lib/getGraphId';
15
14
  import type MultipartResponse from './Server/MultipartResponse';
16
15
  import type {
@@ -26,6 +25,8 @@ import type {
26
25
  import type {ConfigT, RootPerfLogger} from 'metro-config';
27
26
  import type {CustomResolverOptions} from 'metro-resolver';
28
27
 
28
+ import IncrementalBundler, {RevisionId} from './IncrementalBundler';
29
+
29
30
  export interface SegmentLoadData {
30
31
  [index: number]: [number[], number | null];
31
32
  }
package/src/index.d.ts CHANGED
@@ -14,22 +14,23 @@ export * from './ModuleGraph/worker/collectDependencies';
14
14
  export * from './Server';
15
15
  export * from './lib/reporting';
16
16
 
17
+ import type {ReadOnlyGraph} from './DeltaBundler/types';
18
+ import type {ServerOptions, default as MetroServer} from './Server';
19
+ import type {OutputOptions, RequestOptions} from './shared/types';
17
20
  import type {HandleFunction} from 'connect';
18
21
  import type {EventEmitter} from 'events';
19
22
  import type {IncomingMessage, Server as HttpServer} from 'http';
20
23
  import type {Server as HttpsServer} from 'https';
24
+ import type {CustomTransformOptions} from 'metro-babel-transformer';
21
25
  import type {
22
26
  ConfigT,
23
27
  InputConfigT,
24
28
  MetroConfig,
25
29
  Middleware,
26
30
  } from 'metro-config';
27
- import type {CustomTransformOptions} from 'metro-babel-transformer';
28
- import type {ReadOnlyGraph} from './DeltaBundler/types';
29
31
  import type {Duplex} from 'stream';
32
+
30
33
  import Yargs = require('yargs');
31
- import type {default as MetroServer, ServerOptions} from './Server';
32
- import type {OutputOptions, RequestOptions} from './shared/types';
33
34
 
34
35
  export {loadConfig, mergeConfig, resolveConfig} from 'metro-config';
35
36
  export {Terminal} from 'metro-core';
@@ -119,8 +119,8 @@ class TerminalReporter {
119
119
  phase === 'done'
120
120
  ? chalk.green
121
121
  : phase === 'failed'
122
- ? chalk.red
123
- : chalk.yellow;
122
+ ? chalk.red
123
+ : chalk.yellow;
124
124
  const progress =
125
125
  phase === 'in_progress'
126
126
  ? chalk.green.bgGreen(DARK_BLOCK_CHAR.repeat(filledBar)) +
@@ -31,8 +31,8 @@ module.exports = (
31
31
  level === 'error'
32
32
  ? chalk.inverse.red
33
33
  : level === 'warn'
34
- ? chalk.inverse.yellow
35
- : chalk.inverse.white;
34
+ ? chalk.inverse.yellow
35
+ : chalk.inverse.white;
36
36
 
37
37
  if (level === 'group') {
38
38
  groupStack.push(level);
@@ -8,13 +8,13 @@
8
8
  * @oncall react_native
9
9
  */
10
10
 
11
- import {EventEmitter} from 'events';
12
- import {ConfigT} from 'metro-config';
13
- import {ResolverInputOptions} from '../shared/types';
14
11
  import {
15
12
  BundlerResolution,
16
13
  TransformResultDependency,
17
14
  } from '../DeltaBundler/types';
15
+ import {ResolverInputOptions} from '../shared/types';
16
+ import {EventEmitter} from 'events';
17
+ import {ConfigT} from 'metro-config';
18
18
 
19
19
  export default class DependencyGraph extends EventEmitter {
20
20
  constructor(
@@ -38,7 +38,7 @@ function saveAsAssets(bundle, options, log) {
38
38
  moduleGroups: null,
39
39
  startupModules: startupModules.concat(),
40
40
  });
41
- if (sourcemapSourcesRoot !== undefined) {
41
+ if (sourcemapSourcesRoot != null) {
42
42
  relativizeSourceMapInline(sourceMap, sourcemapSourcesRoot);
43
43
  }
44
44
  const wroteSourceMap = writeSourceMap(
@@ -78,7 +78,7 @@ function saveAsAssets(
78
78
  ModuleTransportLike,
79
79
  >(),
80
80
  });
81
- if (sourcemapSourcesRoot !== undefined) {
81
+ if (sourcemapSourcesRoot != null) {
82
82
  relativizeSourceMapInline(sourceMap, sourcemapSourcesRoot);
83
83
  }
84
84
  const wroteSourceMap = writeSourceMap(
@@ -31,7 +31,7 @@ function saveAsIndexedFile(bundle, options, log) {
31
31
  moduleGroups,
32
32
  fixWrapperOffset: true,
33
33
  });
34
- if (sourcemapSourcesRoot !== undefined) {
34
+ if (sourcemapSourcesRoot != null) {
35
35
  relativizeSourceMapInline(sourceMap, sourcemapSourcesRoot);
36
36
  }
37
37
  const wroteSourceMap = writeSourceMap(
@@ -73,7 +73,7 @@ function saveAsIndexedFile(
73
73
  moduleGroups,
74
74
  fixWrapperOffset: true,
75
75
  });
76
- if (sourcemapSourcesRoot !== undefined) {
76
+ if (sourcemapSourcesRoot != null) {
77
77
  relativizeSourceMapInline(sourceMap, sourcemapSourcesRoot);
78
78
  }
79
79
 
@@ -8,8 +8,8 @@
8
8
  * @oncall react_native
9
9
  */
10
10
 
11
- import {OutputOptions, RequestOptions} from '../../shared/types';
12
11
  import Server from '../../Server';
12
+ import {OutputOptions, RequestOptions} from '../../shared/types';
13
13
 
14
14
  export function build(
15
15
  packagerClient: Server,
@@ -30,7 +30,7 @@ async function saveBundleAndMap(bundle, options, log) {
30
30
  });
31
31
  if (sourcemapOutput) {
32
32
  let { map } = bundle;
33
- if (sourcemapSourcesRoot !== undefined) {
33
+ if (sourcemapSourcesRoot != null) {
34
34
  log("start relativating source map");
35
35
  map = relativateSerializedMap(map, sourcemapSourcesRoot);
36
36
  log("finished relativating");
@@ -68,7 +68,7 @@ async function saveBundleAndMap(
68
68
 
69
69
  if (sourcemapOutput) {
70
70
  let {map} = bundle;
71
- if (sourcemapSourcesRoot !== undefined) {
71
+ if (sourcemapSourcesRoot != null) {
72
72
  log('start relativating source map');
73
73
  map = relativateSerializedMap(map, sourcemapSourcesRoot);
74
74
  log('finished relativating');
@@ -20,10 +20,10 @@ const constantFor = (encoding: 'ascii' | 'utf16le' | 'utf8') =>
20
20
  /^ascii$/i.test(encoding)
21
21
  ? 1
22
22
  : isUTF8(encoding)
23
- ? 2
24
- : /^(?:utf-?16(?:le)?|ucs-?2)$/.test(encoding)
25
- ? 3
26
- : 0;
23
+ ? 2
24
+ : /^(?:utf-?16(?:le)?|ucs-?2)$/.test(encoding)
25
+ ? 3
26
+ : 0;
27
27
 
28
28
  module.exports = function (
29
29
  code: Buffer | string,
@@ -8,9 +8,12 @@
8
8
  * @oncall react_native
9
9
  */
10
10
 
11
+ import type {
12
+ Options as DeltaBundlerOptions,
13
+ TransformInputOptions,
14
+ } from '../DeltaBundler/types';
11
15
  import type {TransformProfile} from 'metro-babel-transformer';
12
16
  import type {CustomResolverOptions} from 'metro-resolver';
13
-
14
17
  import type {
15
18
  MetroSourceMapSegmentTuple,
16
19
  MixedSourceMap,
@@ -19,10 +22,6 @@ import type {
19
22
  CustomTransformOptions,
20
23
  MinifierOptions,
21
24
  } from 'metro-transform-worker';
22
- import type {
23
- Options as DeltaBundlerOptions,
24
- TransformInputOptions,
25
- } from '../DeltaBundler/types';
26
25
 
27
26
  export type BundleType =
28
27
  | 'bundle'