@atlaspack/packager-js 2.14.5-dev.93 → 2.14.5-dev.95

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.
@@ -144,7 +144,7 @@ class ScopeHoistingPackager {
144
144
  res += content + '\n';
145
145
  lineCount += lines + 1;
146
146
  };
147
- if ((0, _featureFlags().getFeatureFlag)('inlineConstOptimisationFix')) {
147
+ if ((0, _featureFlags().getFeatureFlag)('inlineConstOptimisationFix') || (0, _featureFlags().getFeatureFlag)('applyScopeHoistingImprovement')) {
148
148
  // Write out all constant modules used by this bundle
149
149
  for (let asset of constantAssets) {
150
150
  if (!this.seenAssets.has(asset.id)) {
@@ -288,7 +288,7 @@ class ScopeHoistingPackager {
288
288
  if (!asset.meta.isConstantModule || this.bundleGraph.getIncomingDependencies(asset).some(dep => dep.priority === 'lazy')) {
289
289
  this.wrappedAssets.add(asset.id);
290
290
  wrapped.push(asset);
291
- } else if ((0, _featureFlags().getFeatureFlag)('inlineConstOptimisationFix') && asset.meta.isConstantModule) {
291
+ } else if (((0, _featureFlags().getFeatureFlag)('inlineConstOptimisationFix') || (0, _featureFlags().getFeatureFlag)('applyScopeHoistingImprovement')) && asset.meta.isConstantModule) {
292
292
  constant.push(asset);
293
293
  }
294
294
  }
@@ -305,7 +305,7 @@ class ScopeHoistingPackager {
305
305
  actions.skipChildren();
306
306
  return;
307
307
  }
308
- if (assignedAssets.has(asset) || this.isReExported(asset)) {
308
+ if (!asset.meta.isConstantModule && (assignedAssets.has(asset) || this.isReExported(asset))) {
309
309
  wrapped.push(asset);
310
310
  this.wrappedAssets.add(asset.id);
311
311
  actions.skipChildren();
@@ -526,7 +526,7 @@ class ScopeHoistingPackager {
526
526
  // assets referenced by this asset will also be wrapped. Otherwise, inline the
527
527
  // asset content where the import statement was.
528
528
  if ((0, _featureFlags().getFeatureFlag)('applyScopeHoistingImprovement')) {
529
- if (!this.wrappedAssets.has(resolved.id)) {
529
+ if (!resolved.meta.isConstantModule && !this.wrappedAssets.has(resolved.id)) {
530
530
  let [depCode, depMap, depLines] = this.visitAsset(resolved);
531
531
  res = depCode + '\n' + res;
532
532
  lines += 1 + depLines;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/packager-js",
3
- "version": "2.14.5-dev.93+207d003c0",
3
+ "version": "2.14.5-dev.95+d8e35a83e",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -15,16 +15,16 @@
15
15
  "node": ">= 16.0.0"
16
16
  },
17
17
  "dependencies": {
18
- "@atlaspack/diagnostic": "2.14.1-dev.161+207d003c0",
19
- "@atlaspack/feature-flags": "2.14.1-dev.161+207d003c0",
20
- "@atlaspack/plugin": "2.14.5-dev.93+207d003c0",
21
- "@atlaspack/rust": "3.2.1-dev.93+207d003c0",
22
- "@atlaspack/types": "2.14.5-dev.93+207d003c0",
23
- "@atlaspack/utils": "2.14.5-dev.93+207d003c0",
18
+ "@atlaspack/diagnostic": "2.14.1-dev.163+d8e35a83e",
19
+ "@atlaspack/feature-flags": "2.14.1-dev.163+d8e35a83e",
20
+ "@atlaspack/plugin": "2.14.5-dev.95+d8e35a83e",
21
+ "@atlaspack/rust": "3.2.1-dev.95+d8e35a83e",
22
+ "@atlaspack/types": "2.14.5-dev.95+d8e35a83e",
23
+ "@atlaspack/utils": "2.14.5-dev.95+d8e35a83e",
24
24
  "@parcel/source-map": "^2.1.1",
25
25
  "globals": "^13.2.0",
26
26
  "nullthrows": "^1.1.1"
27
27
  },
28
28
  "type": "commonjs",
29
- "gitHead": "207d003c0f1d4ffa6a1c52d2f8841d998616c523"
29
+ "gitHead": "d8e35a83e480e0811b63a319e88ffe9a2cd509e6"
30
30
  }
@@ -166,7 +166,10 @@ export class ScopeHoistingPackager {
166
166
  lineCount += lines + 1;
167
167
  };
168
168
 
169
- if (getFeatureFlag('inlineConstOptimisationFix')) {
169
+ if (
170
+ getFeatureFlag('inlineConstOptimisationFix') ||
171
+ getFeatureFlag('applyScopeHoistingImprovement')
172
+ ) {
170
173
  // Write out all constant modules used by this bundle
171
174
  for (let asset of constantAssets) {
172
175
  if (!this.seenAssets.has(asset.id)) {
@@ -396,7 +399,8 @@ export class ScopeHoistingPackager {
396
399
  this.wrappedAssets.add(asset.id);
397
400
  wrapped.push(asset);
398
401
  } else if (
399
- getFeatureFlag('inlineConstOptimisationFix') &&
402
+ (getFeatureFlag('inlineConstOptimisationFix') ||
403
+ getFeatureFlag('applyScopeHoistingImprovement')) &&
400
404
  asset.meta.isConstantModule
401
405
  ) {
402
406
  constant.push(asset);
@@ -419,7 +423,10 @@ export class ScopeHoistingPackager {
419
423
  return;
420
424
  }
421
425
 
422
- if (assignedAssets.has(asset) || this.isReExported(asset)) {
426
+ if (
427
+ !asset.meta.isConstantModule &&
428
+ (assignedAssets.has(asset) || this.isReExported(asset))
429
+ ) {
423
430
  wrapped.push(asset);
424
431
  this.wrappedAssets.add(asset.id);
425
432
 
@@ -707,7 +714,10 @@ export class ScopeHoistingPackager {
707
714
  // assets referenced by this asset will also be wrapped. Otherwise, inline the
708
715
  // asset content where the import statement was.
709
716
  if (getFeatureFlag('applyScopeHoistingImprovement')) {
710
- if (!this.wrappedAssets.has(resolved.id)) {
717
+ if (
718
+ !resolved.meta.isConstantModule &&
719
+ !this.wrappedAssets.has(resolved.id)
720
+ ) {
711
721
  let [depCode, depMap, depLines] =
712
722
  this.visitAsset(resolved);
713
723
  res = depCode + '\n' + res;