metro 0.80.4 → 0.80.6

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 (149) hide show
  1. package/package.json +16 -17
  2. package/src/Assets.js +0 -35
  3. package/src/Bundler/util.js +1 -29
  4. package/src/Bundler.js +1 -20
  5. package/src/DeltaBundler/DeltaCalculator.js +0 -86
  6. package/src/DeltaBundler/Graph.js +0 -197
  7. package/src/DeltaBundler/Serializers/baseJSBundle.js +0 -13
  8. package/src/DeltaBundler/Serializers/getAllFiles.js +0 -11
  9. package/src/DeltaBundler/Serializers/getAssets.js +0 -11
  10. package/src/DeltaBundler/Serializers/getExplodedSourceMap.js +0 -11
  11. package/src/DeltaBundler/Serializers/getRamBundleInfo.js +0 -18
  12. package/src/DeltaBundler/Serializers/helpers/getInlineSourceMappingURL.js +0 -11
  13. package/src/DeltaBundler/Serializers/helpers/getSourceMapInfo.js +0 -11
  14. package/src/DeltaBundler/Serializers/helpers/getTransitiveDependencies.js +0 -14
  15. package/src/DeltaBundler/Serializers/helpers/js.js +0 -21
  16. package/src/DeltaBundler/Serializers/helpers/processModules.js +0 -11
  17. package/src/DeltaBundler/Serializers/hmrJSBundle.js +0 -23
  18. package/src/DeltaBundler/Serializers/sourceMapGenerator.js +0 -16
  19. package/src/DeltaBundler/Serializers/sourceMapObject.js +0 -11
  20. package/src/DeltaBundler/Serializers/sourceMapString.js +0 -11
  21. package/src/DeltaBundler/Transformer.js +0 -30
  22. package/src/DeltaBundler/Worker.flow.js +0 -26
  23. package/src/DeltaBundler/Worker.flow.js.flow +2 -2
  24. package/src/DeltaBundler/Worker.js +0 -14
  25. package/src/DeltaBundler/WorkerFarm.js +1 -21
  26. package/src/DeltaBundler/__fixtures__/hasteImpl.js +0 -14
  27. package/src/DeltaBundler/buildSubgraph.js +0 -24
  28. package/src/DeltaBundler/getTransformCacheKey.js +0 -13
  29. package/src/DeltaBundler/getTransformCacheKey.js.flow +1 -1
  30. package/src/DeltaBundler/mergeDeltas.js +0 -11
  31. package/src/DeltaBundler/types.flow.js +0 -11
  32. package/src/DeltaBundler.js +0 -21
  33. package/src/HmrServer.js +8 -39
  34. package/src/HmrServer.js.flow +8 -6
  35. package/src/IncrementalBundler/GraphNotFoundError.js +0 -11
  36. package/src/IncrementalBundler/ResourceNotFoundError.js +0 -11
  37. package/src/IncrementalBundler/RevisionNotFoundError.js +0 -11
  38. package/src/IncrementalBundler.js +0 -23
  39. package/src/ModuleGraph/test-helpers.js +0 -17
  40. package/src/ModuleGraph/worker/JsFileWrapping.js +1 -22
  41. package/src/ModuleGraph/worker/collectDependencies.js +1 -94
  42. package/src/ModuleGraph/worker/generateImportNames.js +0 -15
  43. package/src/Server/MultipartResponse.js +0 -13
  44. package/src/Server/symbolicate.js +2 -36
  45. package/src/Server.js +6 -83
  46. package/src/cli/parseKeyValueParamArray.js +0 -11
  47. package/src/cli-utils.js +0 -11
  48. package/src/cli.js +0 -13
  49. package/src/commands/build.js +0 -15
  50. package/src/commands/dependencies.js +1 -19
  51. package/src/commands/serve.js +0 -19
  52. package/src/index.flow.js +0 -31
  53. package/src/index.js +0 -14
  54. package/src/integration_tests/basic_bundle/AssetRegistry.js +0 -10
  55. package/src/integration_tests/basic_bundle/Bar.js +0 -10
  56. package/src/integration_tests/basic_bundle/ErrorBundle.js +0 -12
  57. package/src/integration_tests/basic_bundle/Foo.js +0 -10
  58. package/src/integration_tests/basic_bundle/TestBigInt.js +0 -12
  59. package/src/integration_tests/basic_bundle/TestBundle.js +0 -11
  60. package/src/integration_tests/basic_bundle/TestPolyfill.js +0 -10
  61. package/src/integration_tests/basic_bundle/build-errors/cannot-resolve-import.js +0 -14
  62. package/src/integration_tests/basic_bundle/build-errors/cannot-resolve-multi-line-import-with-escapes.js +0 -14
  63. package/src/integration_tests/basic_bundle/build-errors/cannot-resolve-multi-line-import.js +0 -14
  64. package/src/integration_tests/basic_bundle/build-errors/cannot-resolve-require-with-embedded-comment.js +1 -15
  65. package/src/integration_tests/basic_bundle/build-errors/cannot-resolve-require.js +0 -13
  66. package/src/integration_tests/basic_bundle/build-errors/cannot-resolve-specifier-with-escapes.js +0 -16
  67. package/src/integration_tests/basic_bundle/build-errors/inline-requires-cannot-resolve-import.js +0 -14
  68. package/src/integration_tests/basic_bundle/build-errors/inline-requires-cannot-resolve-require.js +0 -13
  69. package/src/integration_tests/basic_bundle/import-export/export-1.js +0 -10
  70. package/src/integration_tests/basic_bundle/import-export/export-2.js +0 -10
  71. package/src/integration_tests/basic_bundle/import-export/export-3.js +0 -10
  72. package/src/integration_tests/basic_bundle/import-export/export-4.js +0 -10
  73. package/src/integration_tests/basic_bundle/import-export/export-5.js +0 -10
  74. package/src/integration_tests/basic_bundle/import-export/export-6.js +0 -10
  75. package/src/integration_tests/basic_bundle/import-export/export-null.js +0 -10
  76. package/src/integration_tests/basic_bundle/import-export/export-primitive-default.js +0 -10
  77. package/src/integration_tests/basic_bundle/import-export/index.js +0 -10
  78. package/src/integration_tests/basic_bundle/loadBundleAsyncForTest.js +0 -10
  79. package/src/integration_tests/basic_bundle/polyfill.js +0 -12
  80. package/src/integration_tests/basic_bundle/require-context/conflict.js +0 -10
  81. package/src/integration_tests/basic_bundle/require-context/empty.js +0 -10
  82. package/src/integration_tests/basic_bundle/require-context/matching.js +0 -10
  83. package/src/integration_tests/basic_bundle/require-context/mode-eager.js +0 -10
  84. package/src/integration_tests/basic_bundle/require-context/mode-lazy-once.js +0 -10
  85. package/src/integration_tests/basic_bundle/require-context/mode-lazy.js +0 -10
  86. package/src/integration_tests/basic_bundle/require-context/mode-sync.js +0 -11
  87. package/src/integration_tests/basic_bundle/require-context/subdir/a.js +0 -10
  88. package/src/integration_tests/basic_bundle/require-context/subdir/b.js +0 -9
  89. package/src/integration_tests/basic_bundle/require-context/subdir/c.js +0 -10
  90. package/src/integration_tests/basic_bundle/require-context/subdir/nested/d.js +0 -10
  91. package/src/integration_tests/basic_bundle/require-context/subdir-conflict/index.js +0 -10
  92. package/src/integration_tests/basic_bundle/require-context/utils.js +0 -10
  93. package/src/integration_tests/basic_bundle/require-resolveWeak/import-and-resolveWeak.js +0 -15
  94. package/src/integration_tests/basic_bundle/require-resolveWeak/multiple.js +0 -10
  95. package/src/integration_tests/basic_bundle/require-resolveWeak/never-required.js +0 -10
  96. package/src/integration_tests/basic_bundle/require-resolveWeak/require-and-resolveWeak.js +0 -15
  97. package/src/integration_tests/basic_bundle/require-resolveWeak/subdir/counter-module.js +0 -10
  98. package/src/integration_tests/basic_bundle/require-resolveWeak/subdir/throwing-module.js +0 -10
  99. package/src/integration_tests/execBundle.js +0 -11
  100. package/src/integration_tests/metro.config.js +0 -10
  101. package/src/lib/BatchProcessor.js +0 -23
  102. package/src/lib/CountingSet.js +0 -35
  103. package/src/lib/JsonReporter.js +0 -17
  104. package/src/lib/RamBundleParser.js +0 -23
  105. package/src/lib/TerminalReporter.js +0 -68
  106. package/src/lib/bundleToString.js +1 -19
  107. package/src/lib/contextModule.js +1 -31
  108. package/src/lib/contextModuleTemplates.js +0 -36
  109. package/src/lib/countLines.js +0 -11
  110. package/src/lib/createModuleIdFactory.js +0 -11
  111. package/src/lib/createWebsocketServer.js +0 -24
  112. package/src/lib/debounceAsyncQueue.js +0 -13
  113. package/src/lib/formatBundlingError.js +0 -14
  114. package/src/lib/getAppendScripts.js +0 -11
  115. package/src/lib/getGraphId.js +0 -11
  116. package/src/lib/getMaxWorkers.js +0 -11
  117. package/src/lib/getPreludeCode.js +0 -18
  118. package/src/lib/getPrependedScripts.js +0 -13
  119. package/src/lib/logToConsole.js +0 -18
  120. package/src/lib/parseCustomResolverOptions.js +0 -11
  121. package/src/lib/parseCustomTransformOptions.js +0 -12
  122. package/src/lib/parseOptionsFromUrl.js +1 -17
  123. package/src/lib/relativizeSourceMap.js +0 -12
  124. package/src/lib/reporting.js +0 -30
  125. package/src/lib/splitBundleOptions.js +0 -14
  126. package/src/lib/transformHelpers.js +0 -20
  127. package/src/node-haste/DependencyGraph/ModuleResolution.js +5 -64
  128. package/src/node-haste/DependencyGraph/createFileMap.js +0 -16
  129. package/src/node-haste/DependencyGraph.js +6 -46
  130. package/src/node-haste/DependencyGraph.js.flow +7 -4
  131. package/src/node-haste/Module.js +0 -11
  132. package/src/node-haste/ModuleCache.js +0 -20
  133. package/src/node-haste/Package.js +0 -11
  134. package/src/node-haste/lib/AssetPaths.js +0 -16
  135. package/src/node-haste/lib/parsePlatformFilePath.js +0 -16
  136. package/src/shared/output/RamBundle/as-assets.js +6 -29
  137. package/src/shared/output/RamBundle/as-indexed-file.js +0 -44
  138. package/src/shared/output/RamBundle/buildSourcemapWithMetadata.js +0 -13
  139. package/src/shared/output/RamBundle/magic-number.js +0 -11
  140. package/src/shared/output/RamBundle/util.js +1 -17
  141. package/src/shared/output/RamBundle/write-sourcemap.js +0 -12
  142. package/src/shared/output/RamBundle.js +0 -14
  143. package/src/shared/output/bundle.flow.js +0 -13
  144. package/src/shared/output/bundle.flow.js.flow +1 -1
  145. package/src/shared/output/bundle.js +0 -14
  146. package/src/shared/output/meta.js +0 -11
  147. package/src/shared/output/unbundle.js +0 -13
  148. package/src/shared/output/writeFile.js +0 -11
  149. package/src/shared/types.flow.js +0 -11
@@ -1,14 +1,3 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";
13
2
 
14
3
  var _path = _interopRequireDefault(require("path"));
@@ -1,23 +1,8 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";
13
2
 
14
3
  const Module = require("./Module");
15
4
  const Package = require("./Package");
16
5
  class ModuleCache {
17
- // Cache for "closest package.json" queries by module path.
18
-
19
- // The inverse of _packagePathByModulePath.
20
-
21
6
  constructor(options) {
22
7
  this._getClosestPackage = options.getClosestPackage;
23
8
  this._moduleCache = Object.create(null);
@@ -68,11 +53,8 @@ class ModuleCache {
68
53
  delete this._packageCache[filePath];
69
54
  }
70
55
  if (this._packagePathByModulePath[filePath]) {
71
- // filePath is a module inside a package.
72
56
  const packagePath = this._packagePathByModulePath[filePath];
73
57
  delete this._packagePathByModulePath[filePath];
74
- // This change doesn't invalidate any cached "closest package.json"
75
- // queries for the package's other modules. Clean up only this module.
76
58
  const modulePaths = this._modulePathsByPackagePath[packagePath];
77
59
  if (modulePaths) {
78
60
  modulePaths.delete(filePath);
@@ -82,8 +64,6 @@ class ModuleCache {
82
64
  }
83
65
  }
84
66
  if (this._modulePathsByPackagePath[filePath]) {
85
- // filePath is a package. This change invalidates all cached "closest
86
- // package.json" queries for modules inside this package.
87
67
  const modulePaths = this._modulePathsByPackagePath[filePath];
88
68
  for (const modulePath of modulePaths) {
89
69
  delete this._packagePathByModulePath[modulePath];
@@ -1,14 +1,3 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";
13
2
 
14
3
  const fs = require("fs");
@@ -1,14 +1,3 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";
13
2
 
14
3
  const parsePlatformFilePath = require("./parsePlatformFilePath");
@@ -34,11 +23,6 @@ function parseBaseName(baseName) {
34
23
  resolution: 1,
35
24
  };
36
25
  }
37
-
38
- /**
39
- * Return `null` if the `filePath` doesn't have a valid extension, required
40
- * to describe the type of an asset.
41
- */
42
26
  function tryParse(filePath, platforms) {
43
27
  const result = parsePlatformFilePath(filePath, platforms);
44
28
  const { dirPath, baseName, platform, extension } = result;
@@ -1,23 +1,7 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";
13
2
 
14
3
  const path = require("path");
15
4
  const PATH_RE = /^(.+?)(\.([^.]+))?\.([^.]+)$/;
16
-
17
- /**
18
- * Extract the components of a file path that can have a platform specifier: Ex.
19
- * `index.ios.js` is specific to the `ios` platform and has the extension `js`.
20
- */
21
5
  function parsePlatformFilePath(filePath, platforms) {
22
6
  const dirPath = path.dirname(filePath);
23
7
  const fileName = path.basename(filePath);
@@ -1,14 +1,3 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";
13
2
 
14
3
  const relativizeSourceMapInline = require("../../../lib/relativizeSourceMap");
@@ -19,17 +8,8 @@ const { joinModules } = require("./util");
19
8
  const writeSourceMap = require("./write-sourcemap");
20
9
  const fsPromises = require("fs").promises;
21
10
  const path = require("path");
22
- // must not start with a dot, as that won't go into the apk
23
11
  const MAGIC_RAM_BUNDLE_FILENAME = "UNBUNDLE";
24
12
  const MODULES_DIR = "js-modules";
25
-
26
- /**
27
- * Saves all JS modules of an app as single files
28
- * The startup code (prelude, polyfills etc.) are written to the file
29
- * designated by the `bundleOuput` option.
30
- * All other modules go into a 'js-modules' folder that in the same parent
31
- * directory as the startup file.
32
- */
33
13
  function saveAsAssets(bundle, options, log) {
34
14
  const {
35
15
  bundleOutput,
@@ -43,16 +23,13 @@ function saveAsAssets(bundle, options, log) {
43
23
  const startupCode = joinModules(startupModules);
44
24
  log("Writing bundle output to:", bundleOutput);
45
25
  const modulesDir = path.join(path.dirname(bundleOutput), MODULES_DIR);
46
- const writeUnbundle = createDir(modulesDir).then(
47
- // create the modules directory first
48
- () =>
49
- Promise.all([
50
- writeModules(lazyModules, modulesDir, encoding),
51
- writeFile(bundleOutput, startupCode, encoding),
52
- writeMagicFlagFile(modulesDir),
53
- ])
26
+ const writeUnbundle = createDir(modulesDir).then(() =>
27
+ Promise.all([
28
+ writeModules(lazyModules, modulesDir, encoding),
29
+ writeFile(bundleOutput, startupCode, encoding),
30
+ writeMagicFlagFile(modulesDir),
31
+ ])
54
32
  );
55
- // $FlowFixMe[unused-promise]
56
33
  writeUnbundle.then(() => log("Done writing unbundle output"));
57
34
  if (sourcemapOutput) {
58
35
  const sourceMap = buildSourcemapWithMetadata({
@@ -1,14 +1,3 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";
13
2
 
14
3
  const relativizeSourceMapInline = require("../../../lib/relativizeSourceMap");
@@ -18,14 +7,6 @@ const { joinModules } = require("./util");
18
7
  const writeSourceMap = require("./write-sourcemap");
19
8
  const fs = require("fs");
20
9
  const SIZEOF_UINT32 = 4;
21
-
22
- /**
23
- * Saves all JS modules of an app as a single file, separated with null bytes.
24
- * The file begins with an offset table that contains module ids and their
25
- * lengths/offsets.
26
- * The module id for the startup code (prelude, polyfills etc.) is the
27
- * empty string.
28
- */
29
10
  function saveAsIndexedFile(bundle, options, log) {
30
11
  const {
31
12
  bundleOutput,
@@ -84,41 +65,22 @@ function moduleToBuffer(id, code, encoding) {
84
65
  };
85
66
  }
86
67
  function entryOffset(n) {
87
- // 2: num_entries + startup_code_len
88
- // n * 2: each entry consists of two uint32s
89
68
  return (2 + n * 2) * SIZEOF_UINT32;
90
69
  }
91
70
  function buildModuleTable(startupCode, moduleBuffers, moduleGroups) {
92
- // table format:
93
- // - num_entries: uint_32 number of entries
94
- // - startup_code_len: uint_32 length of the startup section
95
- // - entries: entry...
96
- //
97
- // entry:
98
- // - module_offset: uint_32 offset into the modules blob
99
- // - module_length: uint_32 length of the module code in bytes
100
-
101
71
  const moduleIds = [...moduleGroups.modulesById.keys()];
102
72
  const maxId = moduleIds.reduce((max, id) => Math.max(max, id));
103
73
  const numEntries = maxId + 1;
104
74
  const table = Buffer.alloc(entryOffset(numEntries)).fill(0);
105
-
106
- // num_entries
107
75
  table.writeUInt32LE(numEntries, 0);
108
-
109
- // startup_code_len
110
76
  table.writeUInt32LE(startupCode.length, SIZEOF_UINT32);
111
-
112
- // entries
113
77
  let codeOffset = startupCode.length;
114
78
  moduleBuffers.forEach(({ id, buffer }) => {
115
79
  const group = moduleGroups.groups.get(id);
116
80
  const idsInGroup = group ? [id].concat(Array.from(group)) : [id];
117
81
  idsInGroup.forEach((moduleId) => {
118
82
  const offset = entryOffset(moduleId);
119
- // module_offset
120
83
  table.writeUInt32LE(codeOffset, offset);
121
- // module_length
122
84
  table.writeUInt32LE(buffer.length, offset + SIZEOF_UINT32);
123
85
  });
124
86
  codeOffset += buffer.length;
@@ -153,12 +115,6 @@ function buildModuleBuffers(modules, moduleGroups, encoding) {
153
115
  );
154
116
  }
155
117
  function buildTableAndContents(startupCode, modules, moduleGroups, encoding) {
156
- // file contents layout:
157
- // - magic number char[4] 0xE5 0xD1 0x0B 0xFB (0xFB0BD1E5 uint32 LE)
158
- // - offset table table see `buildModuleTables`
159
- // - code blob char[] null-terminated code strings, starting with
160
- // the startup code
161
-
162
118
  const startupCodeBuffer = nullTerminatedBuffer(startupCode, encoding);
163
119
  const moduleBuffers = buildModuleBuffers(modules, moduleGroups, encoding);
164
120
  const table = buildModuleTable(
@@ -1,14 +1,3 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";
13
2
 
14
3
  const {
@@ -33,8 +22,6 @@ module.exports = ({
33
22
  map: combineSourceMaps(startupModules, undefined, options),
34
23
  sourcePath: "",
35
24
  };
36
-
37
- // Add map of module id -> source to sourcemap
38
25
  const module_paths = [];
39
26
  startupModules.forEach((m) => {
40
27
  module_paths[m.id] = m.sourcePath;
@@ -1,14 +1,3 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";
13
2
 
14
3
  module.exports = 0xfb0bd1e5;
@@ -1,14 +1,3 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";
13
2
 
14
3
  var _countLines = _interopRequireDefault(require("../../../lib/countLines"));
@@ -17,11 +6,7 @@ function _interopRequireDefault(obj) {
17
6
  }
18
7
  const invariant = require("invariant");
19
8
  function lineToLineSourceMap(source, filename = "") {
20
- // The first line mapping in our package is the base64vlq code for zeros (A).
21
9
  const firstLine = "AAAA;";
22
-
23
- // Most other lines in our mappings are all zeros (for module, column etc)
24
- // except for the lineno mapping: curLineno - prevLineno = 1; Which is C.
25
10
  const line = "AACA;";
26
11
  return {
27
12
  file: filename,
@@ -76,7 +61,6 @@ function combineMaps(modules, offsets, moduleGroups, options) {
76
61
  let groupLines = 0;
77
62
  let { map } = moduleTransport;
78
63
  if (moduleGroups && moduleGroups.modulesInGroups.has(id)) {
79
- // this is a module appended to another module
80
64
  return;
81
65
  }
82
66
  if (offsets != null) {
@@ -85,7 +69,7 @@ function combineMaps(modules, offsets, moduleGroups, options) {
85
69
  const { modulesById } = moduleGroups;
86
70
  const otherModules = Array.from(group || [])
87
71
  .map((moduleId) => modulesById.get(moduleId))
88
- .filter(Boolean); // needed to appease flow
72
+ .filter(Boolean);
89
73
  otherModules.forEach((m) => {
90
74
  groupLines += (0, _countLines.default)(m.code);
91
75
  });
@@ -1,14 +1,3 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";
13
2
 
14
3
  const writeFile = require("../writeFile");
@@ -18,7 +7,6 @@ function writeSourcemap(fileName, contents, log) {
18
7
  }
19
8
  log("Writing sourcemap output to:", fileName);
20
9
  const writeMap = writeFile(fileName, contents, null);
21
- // $FlowFixMe[unused-promise]
22
10
  writeMap.then(() => log("Done writing sourcemap output"));
23
11
  return writeMap;
24
12
  }
@@ -1,14 +1,3 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";
13
2
 
14
3
  const Server = require("../../Server");
@@ -23,9 +12,6 @@ async function build(packagerClient, requestOptions) {
23
12
  return await packagerClient.getRamBundleInfo(options);
24
13
  }
25
14
  function save(bundle, options, log) {
26
- // We fork here depending on the platform: while Android is pretty good at
27
- // loading individual assets, iOS has a large overhead when reading hundreds
28
- // of assets from disk.
29
15
  return options.platform === "android" && !(options.indexedRamBundle === true)
30
16
  ? asAssets(bundle, options, log)
31
17
  : asIndexedFile(bundle, options, log);
@@ -1,14 +1,3 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";
13
2
 
14
3
  const relativizeSourceMapInline = require("../../lib/relativizeSourceMap");
@@ -52,8 +41,6 @@ async function saveBundleAndMap(bundle, options, log) {
52
41
  log("Done writing sourcemap output");
53
42
  });
54
43
  }
55
-
56
- // Wait until everything is written to disk.
57
44
  await Promise.all(writeFns.map((cb) => cb()));
58
45
  }
59
46
  exports.build = buildBundle;
@@ -37,7 +37,7 @@ function relativateSerializedMap(
37
37
  map: string,
38
38
  sourceMapSourcesRoot: string,
39
39
  ): string {
40
- const sourceMap = (JSON.parse(map): MixedSourceMap);
40
+ const sourceMap: MixedSourceMap = JSON.parse(map);
41
41
  relativizeSourceMapInline(sourceMap, sourceMapSourcesRoot);
42
42
  return JSON.stringify(sourceMap);
43
43
  }
@@ -1,19 +1,5 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";
13
2
 
14
- /*::
15
- export type * from './bundle.flow';
16
- */
17
3
  try {
18
4
  require("metro-babel-register").unstable_registerForMetroMonorepo();
19
5
  } catch {}
@@ -1,14 +1,3 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";
13
2
 
14
3
  const crypto = require("crypto");
@@ -1,16 +1,3 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";
13
2
 
14
- /* This is for retro-compatibility of React Native with older versions of
15
- * Metro. Use the `RamBundle` module directly. */
16
3
  module.exports = require("./RamBundle");
@@ -1,14 +1,3 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";
13
2
 
14
3
  const denodeify = require("denodeify");
@@ -1,12 +1 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- *
8
- * @format
9
- * @oncall react_native
10
- */
11
-
12
1
  "use strict";