@atlaspack/core 2.12.1-canary.3448 → 2.12.1-canary.3450

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 (50) hide show
  1. package/lib/AssetGraph.js +5 -1
  2. package/package.json +16 -16
  3. package/src/AssetGraph.js +15 -13
  4. package/src/Atlaspack.js +2 -2
  5. package/src/AtlaspackConfig.js +11 -9
  6. package/src/AtlaspackConfig.schema.js +1 -1
  7. package/src/BundleGraph.js +83 -79
  8. package/src/CommittedAsset.js +1 -1
  9. package/src/PackagerRunner.js +4 -4
  10. package/src/ReporterRunner.js +4 -4
  11. package/src/RequestTracker.js +18 -18
  12. package/src/SymbolPropagation.js +26 -22
  13. package/src/Transformation.js +12 -12
  14. package/src/UncommittedAsset.js +2 -2
  15. package/src/Validation.js +5 -5
  16. package/src/applyRuntimes.js +2 -2
  17. package/src/atlaspack-v3/AtlaspackV3.js +1 -1
  18. package/src/atlaspack-v3/worker/compat/bitflags.js +3 -3
  19. package/src/dumpGraphToGraphViz.js +1 -1
  20. package/src/loadDotEnv.js +1 -1
  21. package/src/public/Asset.js +1 -1
  22. package/src/public/Bundle.js +3 -3
  23. package/src/public/BundleGraph.js +20 -20
  24. package/src/public/Config.js +1 -1
  25. package/src/public/MutableBundleGraph.js +8 -8
  26. package/src/requests/AssetGraphRequest.js +10 -10
  27. package/src/requests/AssetGraphRequestRust.js +3 -3
  28. package/src/requests/AssetRequest.js +3 -3
  29. package/src/requests/AtlaspackConfigRequest.js +5 -3
  30. package/src/requests/BundleGraphRequest.js +6 -6
  31. package/src/requests/ConfigRequest.js +4 -4
  32. package/src/requests/DevDepRequest.js +7 -7
  33. package/src/requests/EntryRequest.js +2 -2
  34. package/src/requests/TargetRequest.js +9 -8
  35. package/src/requests/ValidationRequest.js +2 -2
  36. package/src/requests/WriteBundleRequest.js +4 -4
  37. package/src/requests/WriteBundlesRequest.js +6 -6
  38. package/src/requests/asset-graph-diff.js +4 -4
  39. package/src/resolveOptions.js +3 -3
  40. package/src/serializer.js +2 -2
  41. package/src/serializerCore.browser.js +3 -2
  42. package/src/serializerCore.js +2 -2
  43. package/src/utils.js +2 -2
  44. package/test/AtlaspackConfigRequest.test.js +1 -1
  45. package/test/BundleGraph.test.js +3 -3
  46. package/test/PublicMutableBundleGraph.test.js +2 -2
  47. package/test/RequestTracker.test.js +6 -5
  48. package/test/SymbolPropagation.test.js +9 -9
  49. package/test/requests/ConfigRequest.test.js +1 -1
  50. package/test/utils.test.js +1 -1
package/lib/AssetGraph.js CHANGED
@@ -153,7 +153,11 @@ class AssetGraph extends _graph().ContentGraph {
153
153
  nodes.push(node);
154
154
  }
155
155
  } else if (assetGroups) {
156
- nodes.push(...assetGroups.map(assetGroup => nodeFromAssetGroup(assetGroup)));
156
+ for (const assetGroup of assetGroups) {
157
+ // Adding nodes individually ensures we do not encounter a range stack size exceeded error
158
+ // when there are >100000 asset groups
159
+ nodes.push(nodeFromAssetGroup(assetGroup));
160
+ }
157
161
  }
158
162
  this.replaceNodeIdsConnectedTo((0, _nullthrows().default)(this.rootNodeId), nodes.map(node => this.addNode(node)));
159
163
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/core",
3
- "version": "2.12.1-canary.3448+ea8d2373e",
3
+ "version": "2.12.1-canary.3450+d9092cb8e",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -20,20 +20,20 @@
20
20
  "check-ts": "tsc --noEmit index.d.ts"
21
21
  },
22
22
  "dependencies": {
23
- "@atlaspack/cache": "2.12.1-canary.3448+ea8d2373e",
24
- "@atlaspack/diagnostic": "2.12.1-canary.3448+ea8d2373e",
25
- "@atlaspack/events": "2.12.1-canary.3448+ea8d2373e",
26
- "@atlaspack/feature-flags": "2.12.1-canary.3448+ea8d2373e",
27
- "@atlaspack/fs": "2.12.1-canary.3448+ea8d2373e",
28
- "@atlaspack/graph": "3.2.1-canary.3448+ea8d2373e",
29
- "@atlaspack/logger": "2.12.1-canary.3448+ea8d2373e",
30
- "@atlaspack/package-manager": "2.12.1-canary.3448+ea8d2373e",
31
- "@atlaspack/plugin": "2.12.1-canary.3448+ea8d2373e",
32
- "@atlaspack/profiler": "2.12.1-canary.3448+ea8d2373e",
33
- "@atlaspack/rust": "2.12.1-canary.3448+ea8d2373e",
34
- "@atlaspack/types": "2.12.1-canary.3448+ea8d2373e",
35
- "@atlaspack/utils": "2.12.1-canary.3448+ea8d2373e",
36
- "@atlaspack/workers": "2.12.1-canary.3448+ea8d2373e",
23
+ "@atlaspack/cache": "2.12.1-canary.3450+d9092cb8e",
24
+ "@atlaspack/diagnostic": "2.12.1-canary.3450+d9092cb8e",
25
+ "@atlaspack/events": "2.12.1-canary.3450+d9092cb8e",
26
+ "@atlaspack/feature-flags": "2.12.1-canary.3450+d9092cb8e",
27
+ "@atlaspack/fs": "2.12.1-canary.3450+d9092cb8e",
28
+ "@atlaspack/graph": "3.2.1-canary.3450+d9092cb8e",
29
+ "@atlaspack/logger": "2.12.1-canary.3450+d9092cb8e",
30
+ "@atlaspack/package-manager": "2.12.1-canary.3450+d9092cb8e",
31
+ "@atlaspack/plugin": "2.12.1-canary.3450+d9092cb8e",
32
+ "@atlaspack/profiler": "2.12.1-canary.3450+d9092cb8e",
33
+ "@atlaspack/rust": "2.12.1-canary.3450+d9092cb8e",
34
+ "@atlaspack/types": "2.12.1-canary.3450+d9092cb8e",
35
+ "@atlaspack/utils": "2.12.1-canary.3450+d9092cb8e",
36
+ "@atlaspack/workers": "2.12.1-canary.3450+d9092cb8e",
37
37
  "@mischnic/json-sourcemap": "^0.1.0",
38
38
  "@parcel/source-map": "^2.1.1",
39
39
  "base-x": "^3.0.8",
@@ -57,5 +57,5 @@
57
57
  "browser": {
58
58
  "./src/serializerCore.js": "./src/serializerCore.browser.js"
59
59
  },
60
- "gitHead": "ea8d2373eeead6e3b0dc4326582800cd84addf38"
60
+ "gitHead": "d9092cb8efbaed752761ddba4d11603533e2e063"
61
61
  }
package/src/AssetGraph.js CHANGED
@@ -168,13 +168,15 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
168
168
  nodes.push(node);
169
169
  }
170
170
  } else if (assetGroups) {
171
- nodes.push(
172
- ...assetGroups.map(assetGroup => nodeFromAssetGroup(assetGroup)),
173
- );
171
+ for (const assetGroup of assetGroups) {
172
+ // Adding nodes individually ensures we do not encounter a range stack size exceeded error
173
+ // when there are >100000 asset groups
174
+ nodes.push(nodeFromAssetGroup(assetGroup));
175
+ }
174
176
  }
175
177
  this.replaceNodeIdsConnectedTo(
176
178
  nullthrows(this.rootNodeId),
177
- nodes.map(node => this.addNode(node)),
179
+ nodes.map((node) => this.addNode(node)),
178
180
  );
179
181
  }
180
182
 
@@ -213,7 +215,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
213
215
 
214
216
  this.replaceNodeIdsConnectedTo(
215
217
  entrySpecifierNodeId,
216
- resolved.map(file => this.addNode(nodeFromEntryFile(file))),
218
+ resolved.map((file) => this.addNode(nodeFromEntryFile(file))),
217
219
  );
218
220
  }
219
221
 
@@ -222,7 +224,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
222
224
  targets: Array<Target>,
223
225
  correspondingRequest: string,
224
226
  ) {
225
- let depNodes = targets.map(target => {
227
+ let depNodes = targets.map((target) => {
226
228
  let node = nodeFromDep(
227
229
  // The passed project path is ignored in this case, because there is no `loc`
228
230
  createDependency('', {
@@ -254,7 +256,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
254
256
 
255
257
  this.replaceNodeIdsConnectedTo(
256
258
  entryNodeId,
257
- depNodes.map(node => this.addNode(node)),
259
+ depNodes.map((node) => this.addNode(node)),
258
260
  );
259
261
  }
260
262
 
@@ -340,7 +342,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
340
342
  let traversedNode = nullthrows(this.getNode(traversedNodeId));
341
343
  if (traversedNode.type === 'asset') {
342
344
  let hasDeferred = this.getNodeIdsConnectedFrom(traversedNodeId).some(
343
- childNodeId => {
345
+ (childNodeId) => {
344
346
  let childNode = nullthrows(this.getNode(childNodeId));
345
347
  return childNode.hasDeferred == null
346
348
  ? false
@@ -417,7 +419,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
417
419
 
418
420
  let deps = this.getIncomingDependencies(resolvedAsset);
419
421
 
420
- return deps.every(d => {
422
+ return deps.every((d) => {
421
423
  // If this dependency has already been through this process, and we
422
424
  // know it's not deferrable, then there's no need to re-check
423
425
  if (this.undeferredDependencies.has(d)) {
@@ -428,7 +430,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
428
430
  d.symbols &&
429
431
  !(d.env.isLibrary && d.isEntry) &&
430
432
  !d.symbols.has('*') &&
431
- ![...d.symbols.keys()].some(symbol => {
433
+ ![...d.symbols.keys()].some((symbol) => {
432
434
  let assetSymbol = resolvedAsset.symbols?.get(symbol)?.local;
433
435
  return assetSymbol != null && symbols.has(assetSymbol);
434
436
  });
@@ -532,7 +534,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
532
534
  };
533
535
  }
534
536
  let dependentAsset = dependentAssets.find(
535
- a => a.uniqueKey === dep.specifier,
537
+ (a) => a.uniqueKey === dep.specifier,
536
538
  );
537
539
  if (dependentAsset) {
538
540
  depNode.complete = true;
@@ -593,7 +595,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
593
595
  startNodeId: ?NodeId,
594
596
  ): ?TContext {
595
597
  return this.filteredTraverse(
596
- nodeId => {
598
+ (nodeId) => {
597
599
  let node = nullthrows(this.getNode(nodeId));
598
600
  return node.type === 'asset' ? node.value : null;
599
601
  },
@@ -631,7 +633,7 @@ export default class AssetGraph extends ContentGraph<AssetGraphNode> {
631
633
 
632
634
  let hash = new Hash();
633
635
  // TODO: sort??
634
- this.traverse(nodeId => {
636
+ this.traverse((nodeId) => {
635
637
  let node = nullthrows(this.getNode(nodeId));
636
638
  if (node.type === 'asset') {
637
639
  hash.writeString(nullthrows(node.value.outputHash));
package/src/Atlaspack.js CHANGED
@@ -401,7 +401,7 @@ export default class Atlaspack {
401
401
  options,
402
402
  ),
403
403
  buildTime: Date.now() - startTime,
404
- requestBundle: async bundle => {
404
+ requestBundle: async (bundle) => {
405
405
  let bundleNode = bundleGraph._graph.getNodeByContentKey(bundle.id);
406
406
  invariant(bundleNode?.type === 'bundle', 'Bundle does not exist');
407
407
 
@@ -580,7 +580,7 @@ export default class Atlaspack {
580
580
  let res = await this.#requestTracker.runRequest(request, {
581
581
  force: true,
582
582
  });
583
- return res.map(asset =>
583
+ return res.map((asset) =>
584
584
  assetFromValue(asset, nullthrows(this.#resolvedOptions)),
585
585
  );
586
586
  }
@@ -154,7 +154,7 @@ export default class AtlaspackConfig {
154
154
  loadPlugins<T>(
155
155
  plugins: PureAtlaspackConfigPipeline,
156
156
  ): Promise<Array<LoadedPlugin<T>>> {
157
- return Promise.all(plugins.map(p => this.loadPlugin<T>(p)));
157
+ return Promise.all(plugins.map((p) => this.loadPlugin<T>(p)));
158
158
  }
159
159
 
160
160
  async getResolvers(): Promise<Array<LoadedPlugin<Resolver<mixed>>>> {
@@ -181,7 +181,7 @@ export default class AtlaspackConfig {
181
181
  getValidatorNames(filePath: ProjectPath): Array<string> {
182
182
  let validators: PureAtlaspackConfigPipeline =
183
183
  this._getValidatorNodes(filePath);
184
- return validators.map(v => v.packageName);
184
+ return validators.map((v) => v.packageName);
185
185
  }
186
186
 
187
187
  getValidators(
@@ -193,8 +193,8 @@ export default class AtlaspackConfig {
193
193
 
194
194
  getNamedPipelines(): $ReadOnlyArray<string> {
195
195
  return Object.keys(this.transformers)
196
- .filter(glob => glob.includes(':'))
197
- .map(glob => glob.split(':')[0]);
196
+ .filter((glob) => glob.includes(':'))
197
+ .map((glob) => glob.split(':')[0]);
198
198
  }
199
199
 
200
200
  async getTransformers(
@@ -278,7 +278,9 @@ export default class AtlaspackConfig {
278
278
  // Pipelines for bundles come from their entry assets, so the pipeline likely exists in transformers.
279
279
  if (pipeline) {
280
280
  let prefix = pipeline + ':';
281
- if (!Object.keys(this.optimizers).some(glob => glob.startsWith(prefix))) {
281
+ if (
282
+ !Object.keys(this.optimizers).some((glob) => glob.startsWith(prefix))
283
+ ) {
282
284
  pipeline = null;
283
285
  }
284
286
  }
@@ -294,7 +296,7 @@ export default class AtlaspackConfig {
294
296
 
295
297
  getOptimizerNames(filePath: FilePath, pipeline: ?string): Array<string> {
296
298
  let optimizers = this._getOptimizerNodes(filePath, pipeline);
297
- return optimizers.map(o => o.packageName);
299
+ return optimizers.map((o) => o.packageName);
298
300
  }
299
301
 
300
302
  getOptimizers(
@@ -435,7 +437,7 @@ export default class AtlaspackConfig {
435
437
  configsWithPlugin = new Set(getConfigPaths(this.options, plugins));
436
438
  } else {
437
439
  configsWithPlugin = new Set(
438
- Object.keys(plugins).flatMap(k =>
440
+ Object.keys(plugins).flatMap((k) =>
439
441
  Array.isArray(plugins[k])
440
442
  ? getConfigPaths(this.options, plugins[k])
441
443
  : [getConfigPath(this.options, plugins[k])],
@@ -451,7 +453,7 @@ export default class AtlaspackConfig {
451
453
 
452
454
  let seenKey = false;
453
455
  let codeFrames = await Promise.all(
454
- [...configsWithPlugin].map(async filePath => {
456
+ [...configsWithPlugin].map(async (filePath) => {
455
457
  let configContents = await this.options.inputFS.readFile(
456
458
  filePath,
457
459
  'utf8',
@@ -481,7 +483,7 @@ export default class AtlaspackConfig {
481
483
 
482
484
  function getConfigPaths(options, nodes) {
483
485
  return nodes
484
- .map(node => (node !== '...' ? getConfigPath(options, node) : null))
486
+ .map((node) => (node !== '...' ? getConfigPath(options, node) : null))
485
487
  .filter(Boolean);
486
488
  }
487
489
 
@@ -96,7 +96,7 @@ export default {
96
96
  },
97
97
  bundler: {
98
98
  type: 'string',
99
- __validate: (validatePluginName('bundler', 'bundler'): string => void),
99
+ __validate: (validatePluginName('bundler', 'bundler'): (string) => void),
100
100
  },
101
101
  resolvers: (pipelineSchema('resolver', 'resolvers'): SchemaEntity),
102
102
  transformers: (mapPipelineSchema(