metro 0.73.1 → 0.73.2

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.73.1",
3
+ "version": "0.73.2",
4
4
  "description": "🚇 The JavaScript bundler for React Native.",
5
5
  "main": "src/index.js",
6
6
  "bin": "src/cli.js",
@@ -36,27 +36,27 @@
36
36
  "invariant": "^2.2.4",
37
37
  "jest-worker": "^27.2.0",
38
38
  "lodash.throttle": "^4.1.1",
39
- "metro-babel-transformer": "0.73.1",
40
- "metro-cache": "0.73.1",
41
- "metro-cache-key": "0.73.1",
42
- "metro-config": "0.73.1",
43
- "metro-core": "0.73.1",
44
- "metro-file-map": "0.73.1",
45
- "metro-hermes-compiler": "0.73.1",
46
- "metro-inspector-proxy": "0.73.1",
47
- "metro-minify-terser": "0.73.1",
48
- "metro-minify-uglify": "0.73.1",
49
- "metro-react-native-babel-preset": "0.73.1",
50
- "metro-resolver": "0.73.1",
51
- "metro-runtime": "0.73.1",
52
- "metro-source-map": "0.73.1",
53
- "metro-symbolicate": "0.73.1",
54
- "metro-transform-plugins": "0.73.1",
55
- "metro-transform-worker": "0.73.1",
39
+ "metro-babel-transformer": "0.73.2",
40
+ "metro-cache": "0.73.2",
41
+ "metro-cache-key": "0.73.2",
42
+ "metro-config": "0.73.2",
43
+ "metro-core": "0.73.2",
44
+ "metro-file-map": "0.73.2",
45
+ "metro-hermes-compiler": "0.73.2",
46
+ "metro-inspector-proxy": "0.73.2",
47
+ "metro-minify-terser": "0.73.2",
48
+ "metro-minify-uglify": "0.73.2",
49
+ "metro-react-native-babel-preset": "0.73.2",
50
+ "metro-resolver": "0.73.2",
51
+ "metro-runtime": "0.73.2",
52
+ "metro-source-map": "0.73.2",
53
+ "metro-symbolicate": "0.73.2",
54
+ "metro-transform-plugins": "0.73.2",
55
+ "metro-transform-worker": "0.73.2",
56
56
  "mime-types": "^2.1.27",
57
57
  "node-fetch": "^2.2.0",
58
58
  "nullthrows": "^1.1.1",
59
- "rimraf": "^2.5.4",
59
+ "rimraf": "^3.0.2",
60
60
  "serialize-error": "^2.1.0",
61
61
  "source-map": "^0.5.6",
62
62
  "strip-ansi": "^6.0.0",
@@ -70,10 +70,10 @@
70
70
  "babel-jest": "^29.0.3",
71
71
  "dedent": "^0.7.0",
72
72
  "jest-snapshot": "^26.5.2",
73
- "metro-babel-register": "0.73.1",
74
- "metro-memory-fs": "0.73.1",
75
- "metro-react-native-babel-preset": "0.73.1",
76
- "metro-react-native-babel-transformer": "0.73.1",
73
+ "metro-babel-register": "0.73.2",
74
+ "metro-memory-fs": "0.73.2",
75
+ "metro-react-native-babel-preset": "0.73.2",
76
+ "metro-react-native-babel-transformer": "0.73.2",
77
77
  "mock-req": "^0.2.0",
78
78
  "mock-res": "^0.6.0",
79
79
  "stack-trace": "^0.0.10"
@@ -10,7 +10,7 @@
10
10
  */
11
11
  "use strict";
12
12
 
13
- var _graphOperations = require("./graphOperations");
13
+ var _Graph = require("./Graph");
14
14
 
15
15
  const { EventEmitter } = require("events");
16
16
  /**
@@ -29,7 +29,7 @@ class DeltaCalculator extends EventEmitter {
29
29
  super();
30
30
  this._options = options;
31
31
  this._changeEventSource = changeEventSource;
32
- this._graph = (0, _graphOperations.createGraph)({
32
+ this._graph = new _Graph.Graph({
33
33
  entryPoints,
34
34
  transformOptions: this._options.transformOptions,
35
35
  });
@@ -48,7 +48,7 @@ class DeltaCalculator extends EventEmitter {
48
48
 
49
49
  this.removeAllListeners(); // Clean up all the cache data structures to deallocate memory.
50
50
 
51
- this._graph = (0, _graphOperations.createGraph)({
51
+ this._graph = new _Graph.Graph({
52
52
  entryPoints: this._graph.entryPoints,
53
53
  transformOptions: this._options.transformOptions,
54
54
  });
@@ -101,7 +101,7 @@ class DeltaCalculator extends EventEmitter {
101
101
  // a clean traversal of the graph next time.
102
102
 
103
103
  if (this._graph.dependencies.size !== numDependencies) {
104
- this._graph.dependencies = new Map();
104
+ this._graph.dependencies.clear();
105
105
  }
106
106
 
107
107
  throw error;
@@ -110,9 +110,10 @@ class DeltaCalculator extends EventEmitter {
110
110
  } // Return all the modules if the client requested a reset delta.
111
111
 
112
112
  if (reset) {
113
- (0, _graphOperations.reorderGraph)(this._graph, {
113
+ this._graph.reorderGraph({
114
114
  shallow,
115
115
  });
116
+
116
117
  return {
117
118
  added: this._graph.dependencies,
118
119
  modified: new Map(),
@@ -206,8 +207,7 @@ class DeltaCalculator extends EventEmitter {
206
207
 
207
208
  async _getChangedDependencies(modifiedFiles, deletedFiles, addedFiles) {
208
209
  if (!this._graph.dependencies.size) {
209
- const { added } = await (0, _graphOperations.initialTraverseDependencies)(
210
- this._graph,
210
+ const { added } = await this._graph.initialTraverseDependencies(
211
211
  this._options
212
212
  );
213
213
  return {
@@ -240,11 +240,7 @@ class DeltaCalculator extends EventEmitter {
240
240
  // module as an inverse dependency, (2) modified files don't invalidate the contents
241
241
  // of the context module.
242
242
  addedFiles.forEach((filePath) => {
243
- (0, _graphOperations.markModifiedContextModules)(
244
- this._graph,
245
- filePath,
246
- modifiedFiles
247
- );
243
+ this._graph.markModifiedContextModules(filePath, modifiedFiles);
248
244
  });
249
245
  } // We only want to process files that are in the bundle.
250
246
 
@@ -261,10 +257,8 @@ class DeltaCalculator extends EventEmitter {
261
257
  };
262
258
  }
263
259
 
264
- const { added, modified, deleted } = await (0,
265
- _graphOperations.traverseDependencies)(
260
+ const { added, modified, deleted } = await this._graph.traverseDependencies(
266
261
  modifiedDependencies,
267
- this._graph,
268
262
  this._options
269
263
  );
270
264
  return {
@@ -11,14 +11,8 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- import {
15
- createGraph,
16
- initialTraverseDependencies,
17
- markModifiedContextModules,
18
- reorderGraph,
19
- traverseDependencies,
20
- } from './graphOperations';
21
- import type {DeltaResult, Graph, Options} from './types.flow';
14
+ import {Graph} from './Graph';
15
+ import type {DeltaResult, Options} from './types.flow';
22
16
 
23
17
  const {EventEmitter} = require('events');
24
18
 
@@ -49,7 +43,7 @@ class DeltaCalculator<T> extends EventEmitter {
49
43
  this._options = options;
50
44
  this._changeEventSource = changeEventSource;
51
45
 
52
- this._graph = createGraph({
46
+ this._graph = new Graph({
53
47
  entryPoints,
54
48
  transformOptions: this._options.transformOptions,
55
49
  });
@@ -69,7 +63,7 @@ class DeltaCalculator<T> extends EventEmitter {
69
63
  this.removeAllListeners();
70
64
 
71
65
  // Clean up all the cache data structures to deallocate memory.
72
- this._graph = createGraph({
66
+ this._graph = new Graph({
73
67
  entryPoints: this._graph.entryPoints,
74
68
  transformOptions: this._options.transformOptions,
75
69
  });
@@ -134,7 +128,7 @@ class DeltaCalculator<T> extends EventEmitter {
134
128
  // a weird state. As a safe net we clean the dependency modules to force
135
129
  // a clean traversal of the graph next time.
136
130
  if (this._graph.dependencies.size !== numDependencies) {
137
- this._graph.dependencies = new Map();
131
+ this._graph.dependencies.clear();
138
132
  }
139
133
 
140
134
  throw error;
@@ -144,7 +138,7 @@ class DeltaCalculator<T> extends EventEmitter {
144
138
 
145
139
  // Return all the modules if the client requested a reset delta.
146
140
  if (reset) {
147
- reorderGraph(this._graph, {shallow});
141
+ this._graph.reorderGraph({shallow});
148
142
 
149
143
  return {
150
144
  added: this._graph.dependencies,
@@ -237,8 +231,7 @@ class DeltaCalculator<T> extends EventEmitter {
237
231
  addedFiles: Set<string>,
238
232
  ): Promise<DeltaResult<T>> {
239
233
  if (!this._graph.dependencies.size) {
240
- const {added} = await initialTraverseDependencies(
241
- this._graph,
234
+ const {added} = await this._graph.initialTraverseDependencies(
242
235
  this._options,
243
236
  );
244
237
 
@@ -274,7 +267,7 @@ class DeltaCalculator<T> extends EventEmitter {
274
267
  // module as an inverse dependency, (2) modified files don't invalidate the contents
275
268
  // of the context module.
276
269
  addedFiles.forEach(filePath => {
277
- markModifiedContextModules(this._graph, filePath, modifiedFiles);
270
+ this._graph.markModifiedContextModules(filePath, modifiedFiles);
278
271
  });
279
272
  }
280
273
 
@@ -293,9 +286,8 @@ class DeltaCalculator<T> extends EventEmitter {
293
286
  };
294
287
  }
295
288
 
296
- const {added, modified, deleted} = await traverseDependencies(
289
+ const {added, modified, deleted} = await this._graph.traverseDependencies(
297
290
  modifiedDependencies,
298
- this._graph,
299
291
  this._options,
300
292
  );
301
293