@atlaspack/core 2.16.2-canary.31 → 2.16.2-canary.33

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.
@@ -32,6 +32,13 @@ var _Dependency = _interopRequireWildcard(require("./Dependency"));
32
32
  var _Target = require("./Target");
33
33
  var _utils = require("../utils");
34
34
  var _BundleGroup = _interopRequireWildcard(require("./BundleGroup"));
35
+ function _featureFlags() {
36
+ const data = require("@atlaspack/feature-flags");
37
+ _featureFlags = function () {
38
+ return data;
39
+ };
40
+ return data;
41
+ }
35
42
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
36
43
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
37
44
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -263,11 +270,20 @@ class BundleGraph {
263
270
  }
264
271
  for (let bundle of bundles) {
265
272
  const conditions = bundleConditions.get(bundle.id) ?? new Map();
266
- conditions.set(cond.key, {
267
- bundle,
268
- ifTrueBundles,
269
- ifFalseBundles
270
- });
273
+ const currentCondition = conditions.get(cond.key);
274
+ if ((0, _featureFlags().getFeatureFlag)('conditionalBundlingReporterSameConditionFix')) {
275
+ conditions.set(cond.key, {
276
+ bundle,
277
+ ifTrueBundles: [...((currentCondition === null || currentCondition === void 0 ? void 0 : currentCondition.ifTrueBundles) ?? []), ...ifTrueBundles],
278
+ ifFalseBundles: [...((currentCondition === null || currentCondition === void 0 ? void 0 : currentCondition.ifFalseBundles) ?? []), ...ifFalseBundles]
279
+ });
280
+ } else {
281
+ conditions.set(cond.key, {
282
+ bundle,
283
+ ifTrueBundles,
284
+ ifFalseBundles
285
+ });
286
+ }
271
287
  bundleConditions.set(bundle.id, conditions);
272
288
  }
273
289
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/core",
3
- "version": "2.16.2-canary.31+e05252108",
3
+ "version": "2.16.2-canary.33+209692ffb",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -21,21 +21,21 @@
21
21
  "check-ts": "tsc --noEmit index.d.ts"
22
22
  },
23
23
  "dependencies": {
24
- "@atlaspack/build-cache": "2.13.3-canary.99+e05252108",
25
- "@atlaspack/cache": "3.1.1-canary.31+e05252108",
26
- "@atlaspack/diagnostic": "2.14.1-canary.99+e05252108",
27
- "@atlaspack/events": "2.14.1-canary.99+e05252108",
28
- "@atlaspack/feature-flags": "2.14.1-canary.99+e05252108",
29
- "@atlaspack/fs": "2.14.5-canary.31+e05252108",
30
- "@atlaspack/graph": "3.4.1-canary.99+e05252108",
31
- "@atlaspack/logger": "2.14.5-canary.31+e05252108",
32
- "@atlaspack/package-manager": "2.14.5-canary.31+e05252108",
33
- "@atlaspack/plugin": "2.14.5-canary.31+e05252108",
34
- "@atlaspack/profiler": "2.14.1-canary.99+e05252108",
35
- "@atlaspack/rust": "3.2.1-canary.31+e05252108",
36
- "@atlaspack/types": "2.14.5-canary.31+e05252108",
37
- "@atlaspack/utils": "2.14.5-canary.31+e05252108",
38
- "@atlaspack/workers": "2.14.5-canary.31+e05252108",
24
+ "@atlaspack/build-cache": "2.13.3-canary.101+209692ffb",
25
+ "@atlaspack/cache": "3.1.1-canary.33+209692ffb",
26
+ "@atlaspack/diagnostic": "2.14.1-canary.101+209692ffb",
27
+ "@atlaspack/events": "2.14.1-canary.101+209692ffb",
28
+ "@atlaspack/feature-flags": "2.14.1-canary.101+209692ffb",
29
+ "@atlaspack/fs": "2.14.5-canary.33+209692ffb",
30
+ "@atlaspack/graph": "3.4.1-canary.101+209692ffb",
31
+ "@atlaspack/logger": "2.14.5-canary.33+209692ffb",
32
+ "@atlaspack/package-manager": "2.14.5-canary.33+209692ffb",
33
+ "@atlaspack/plugin": "2.14.5-canary.33+209692ffb",
34
+ "@atlaspack/profiler": "2.14.1-canary.101+209692ffb",
35
+ "@atlaspack/rust": "3.2.1-canary.33+209692ffb",
36
+ "@atlaspack/types": "2.14.5-canary.33+209692ffb",
37
+ "@atlaspack/utils": "2.14.5-canary.33+209692ffb",
38
+ "@atlaspack/workers": "2.14.5-canary.33+209692ffb",
39
39
  "@mischnic/json-sourcemap": "^0.1.0",
40
40
  "@parcel/source-map": "^2.1.1",
41
41
  "base-x": "^3.0.8",
@@ -71,5 +71,5 @@
71
71
  "./src/serializerCore.js": "./src/serializerCore.browser.js"
72
72
  },
73
73
  "type": "commonjs",
74
- "gitHead": "e0525210850ed1606146eb86991049cf567c5dec"
74
+ "gitHead": "209692ffb11eae103a0d65c5e1118a5aa1625818"
75
75
  }
@@ -31,6 +31,7 @@ import Dependency, {
31
31
  import {targetToInternalTarget} from './Target';
32
32
  import {fromInternalSourceLocation} from '../utils';
33
33
  import BundleGroup, {bundleGroupToInternalBundleGroup} from './BundleGroup';
34
+ import {getFeatureFlag} from '@atlaspack/feature-flags';
34
35
 
35
36
  // Friendly access for other modules within this package that need access
36
37
  // to the internal bundle.
@@ -489,11 +490,27 @@ export default class BundleGraph<TBundle: IBundle>
489
490
  for (let bundle of bundles) {
490
491
  const conditions = bundleConditions.get(bundle.id) ?? new Map();
491
492
 
492
- conditions.set(cond.key, {
493
- bundle,
494
- ifTrueBundles,
495
- ifFalseBundles,
496
- });
493
+ const currentCondition = conditions.get(cond.key);
494
+
495
+ if (getFeatureFlag('conditionalBundlingReporterSameConditionFix')) {
496
+ conditions.set(cond.key, {
497
+ bundle,
498
+ ifTrueBundles: [
499
+ ...(currentCondition?.ifTrueBundles ?? []),
500
+ ...ifTrueBundles,
501
+ ],
502
+ ifFalseBundles: [
503
+ ...(currentCondition?.ifFalseBundles ?? []),
504
+ ...ifFalseBundles,
505
+ ],
506
+ });
507
+ } else {
508
+ conditions.set(cond.key, {
509
+ bundle,
510
+ ifTrueBundles,
511
+ ifFalseBundles,
512
+ });
513
+ }
497
514
 
498
515
  bundleConditions.set(bundle.id, conditions);
499
516
  }