@atlaspack/reporter-conditional-manifest 2.14.5-dev.14 → 2.14.5-dev.1c70d50f9.99

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/CHANGELOG.md CHANGED
@@ -1,5 +1,78 @@
1
1
  # @atlaspack/reporter-conditional-manifest
2
2
 
3
+ ## 2.14.14
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`644b157`](https://github.com/atlassian-labs/atlaspack/commit/644b157dee72a871acc2d0facf0b87b8eea51956)]:
8
+ - @atlaspack/feature-flags@2.18.2
9
+ - @atlaspack/plugin@2.14.14
10
+
11
+ ## 2.14.13
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [[`26aa9c5`](https://github.com/atlassian-labs/atlaspack/commit/26aa9c599d2be45ce1438a74c5fa22f39b9b554b), [`0501255`](https://github.com/atlassian-labs/atlaspack/commit/05012550da35b05ce7d356a8cc29311e7f9afdca)]:
16
+ - @atlaspack/feature-flags@2.18.1
17
+ - @atlaspack/plugin@2.14.13
18
+
19
+ ## 2.14.12
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies [[`10fbcfb`](https://github.com/atlassian-labs/atlaspack/commit/10fbcfbfa49c7a83da5d7c40983e36e87f524a75), [`85c52d3`](https://github.com/atlassian-labs/atlaspack/commit/85c52d3f7717b3c84a118d18ab98cfbfd71dcbd2)]:
24
+ - @atlaspack/feature-flags@2.18.0
25
+ - @atlaspack/plugin@2.14.12
26
+
27
+ ## 2.14.11
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies [[`73ea3c4`](https://github.com/atlassian-labs/atlaspack/commit/73ea3c4d85d4401fdd15abcbf988237e890e7ad3), [`b1b3693`](https://github.com/atlassian-labs/atlaspack/commit/b1b369317c66f8a431c170df2ebba4fa5b2e38ef)]:
32
+ - @atlaspack/feature-flags@2.17.0
33
+ - @atlaspack/plugin@2.14.11
34
+
35
+ ## 2.14.10
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies []:
40
+ - @atlaspack/plugin@2.14.10
41
+
42
+ ## 2.14.9
43
+
44
+ ### Patch Changes
45
+
46
+ - [#503](https://github.com/atlassian-labs/atlaspack/pull/503) [`209692f`](https://github.com/atlassian-labs/atlaspack/commit/209692ffb11eae103a0d65c5e1118a5aa1625818) Thanks [@JakeLane](https://github.com/JakeLane)! - Fix conditional bundling reporter when condition is reused
47
+
48
+ - Updated dependencies [[`209692f`](https://github.com/atlassian-labs/atlaspack/commit/209692ffb11eae103a0d65c5e1118a5aa1625818), [`f4da1e1`](https://github.com/atlassian-labs/atlaspack/commit/f4da1e120e73eeb5e8b8927f05e88f04d6148c7b)]:
49
+ - @atlaspack/feature-flags@2.16.0
50
+ - @atlaspack/plugin@2.14.9
51
+
52
+ ## 2.14.8
53
+
54
+ ### Patch Changes
55
+
56
+ - Updated dependencies [[`30f6017`](https://github.com/atlassian-labs/atlaspack/commit/30f60175ba4d272c5fc193973c63bc298584775b)]:
57
+ - @atlaspack/feature-flags@2.15.1
58
+ - @atlaspack/plugin@2.14.8
59
+
60
+ ## 2.14.7
61
+
62
+ ### Patch Changes
63
+
64
+ - Updated dependencies [[`a1773d2`](https://github.com/atlassian-labs/atlaspack/commit/a1773d2a62d0ef7805ac7524621dcabcc1afe929)]:
65
+ - @atlaspack/feature-flags@2.15.0
66
+ - @atlaspack/plugin@2.14.7
67
+
68
+ ## 2.14.6
69
+
70
+ ### Patch Changes
71
+
72
+ - Updated dependencies [[`e0f5337`](https://github.com/atlassian-labs/atlaspack/commit/e0f533757bd1019dbd108a04952c87da15286e09)]:
73
+ - @atlaspack/feature-flags@2.14.4
74
+ - @atlaspack/plugin@2.14.6
75
+
3
76
  ## 2.14.5
4
77
 
5
78
  ### Patch Changes
@@ -63,16 +63,29 @@ async function report({
63
63
  const mapBundles = bundles => bundles.map(bundle => (0, _path().relative)(bundle.target.distDir, bundle.filePath));
64
64
  const manifest = {};
65
65
  for (const conditions of bundles.values()) {
66
- const bundleInfo = {};
66
+ const oldBundleInfo = {};
67
67
  for (const [key, cond] of conditions) {
68
- const bundle = cond.bundle;
69
- bundleInfo[key] = {
70
- // Reverse bundles so we load children bundles first
71
- ifTrueBundles: mapBundles(cond.ifTrueBundles).reverse(),
72
- ifFalseBundles: mapBundles(cond.ifFalseBundles).reverse()
73
- };
74
- manifest[bundle.target.name] ??= {};
75
- manifest[bundle.target.name][(0, _path().relative)(bundle.target.distDir, bundle.filePath)] = bundleInfo;
68
+ if ((0, _featureFlags().getFeatureFlag)('conditionalBundlingReporterSameConditionFix')) {
69
+ var _manifest$bundle$targ, _bundleInfo$key, _bundleInfo$key2;
70
+ const bundle = cond.bundle;
71
+ const relativeBundlePath = (0, _path().relative)(bundle.target.distDir, bundle.filePath);
72
+ const bundleInfo = ((_manifest$bundle$targ = manifest[bundle.target.name]) === null || _manifest$bundle$targ === void 0 ? void 0 : _manifest$bundle$targ[relativeBundlePath]) ?? {};
73
+ bundleInfo[key] = {
74
+ ifTrueBundles: mapBundles(cond.ifTrueBundles).concat(((_bundleInfo$key = bundleInfo[key]) === null || _bundleInfo$key === void 0 ? void 0 : _bundleInfo$key.ifTrueBundles) ?? []).sort(),
75
+ ifFalseBundles: mapBundles(cond.ifFalseBundles).concat(((_bundleInfo$key2 = bundleInfo[key]) === null || _bundleInfo$key2 === void 0 ? void 0 : _bundleInfo$key2.ifFalseBundles) ?? []).sort()
76
+ };
77
+ manifest[bundle.target.name] ??= {};
78
+ manifest[bundle.target.name][relativeBundlePath] = bundleInfo;
79
+ } else {
80
+ const bundle = cond.bundle;
81
+ oldBundleInfo[key] = {
82
+ // Reverse bundles so we load children bundles first
83
+ ifTrueBundles: mapBundles(cond.ifTrueBundles).reverse(),
84
+ ifFalseBundles: mapBundles(cond.ifFalseBundles).reverse()
85
+ };
86
+ manifest[bundle.target.name] ??= {};
87
+ manifest[bundle.target.name][(0, _path().relative)(bundle.target.distDir, bundle.filePath)] = oldBundleInfo;
88
+ }
76
89
  }
77
90
  }
78
91
  const targets = new Set(event.bundleGraph.getBundles().map(bundle => bundle.target));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/reporter-conditional-manifest",
3
- "version": "2.14.5-dev.14+8c369e38c",
3
+ "version": "2.14.5-dev.1c70d50f9.99+1c70d50f9",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -15,10 +15,10 @@
15
15
  "node": ">= 16.0.0"
16
16
  },
17
17
  "dependencies": {
18
- "@atlaspack/feature-flags": "2.14.1-dev.82+8c369e38c",
19
- "@atlaspack/plugin": "2.14.5-dev.14+8c369e38c",
18
+ "@atlaspack/feature-flags": "2.14.1-dev.1c70d50f9.167+1c70d50f9",
19
+ "@atlaspack/plugin": "2.14.5-dev.1c70d50f9.99+1c70d50f9",
20
20
  "nullthrows": "^1.1.1"
21
21
  },
22
22
  "type": "commonjs",
23
- "gitHead": "8c369e38ccd428409811114aebd6044c27f90705"
23
+ "gitHead": "1c70d50f914cb662515b0b61053e51a06f3af234"
24
24
  }
@@ -60,18 +60,41 @@ export async function report({
60
60
 
61
61
  const manifest = {};
62
62
  for (const conditions of bundles.values()) {
63
- const bundleInfo = {};
63
+ const oldBundleInfo = {};
64
64
  for (const [key, cond] of conditions) {
65
- const bundle = cond.bundle;
66
- bundleInfo[key] = {
67
- // Reverse bundles so we load children bundles first
68
- ifTrueBundles: mapBundles(cond.ifTrueBundles).reverse(),
69
- ifFalseBundles: mapBundles(cond.ifFalseBundles).reverse(),
70
- };
71
- manifest[bundle.target.name] ??= {};
72
- manifest[bundle.target.name][
73
- relative(bundle.target.distDir, bundle.filePath)
74
- ] = bundleInfo;
65
+ if (getFeatureFlag('conditionalBundlingReporterSameConditionFix')) {
66
+ const bundle = cond.bundle;
67
+ const relativeBundlePath = relative(
68
+ bundle.target.distDir,
69
+ bundle.filePath,
70
+ );
71
+
72
+ const bundleInfo =
73
+ manifest[bundle.target.name]?.[relativeBundlePath] ?? {};
74
+
75
+ bundleInfo[key] = {
76
+ ifTrueBundles: mapBundles(cond.ifTrueBundles)
77
+ .concat(bundleInfo[key]?.ifTrueBundles ?? [])
78
+ .sort(),
79
+ ifFalseBundles: mapBundles(cond.ifFalseBundles)
80
+ .concat(bundleInfo[key]?.ifFalseBundles ?? [])
81
+ .sort(),
82
+ };
83
+
84
+ manifest[bundle.target.name] ??= {};
85
+ manifest[bundle.target.name][relativeBundlePath] = bundleInfo;
86
+ } else {
87
+ const bundle = cond.bundle;
88
+ oldBundleInfo[key] = {
89
+ // Reverse bundles so we load children bundles first
90
+ ifTrueBundles: mapBundles(cond.ifTrueBundles).reverse(),
91
+ ifFalseBundles: mapBundles(cond.ifFalseBundles).reverse(),
92
+ };
93
+ manifest[bundle.target.name] ??= {};
94
+ manifest[bundle.target.name][
95
+ relative(bundle.target.distDir, bundle.filePath)
96
+ ] = oldBundleInfo;
97
+ }
75
98
  }
76
99
  }
77
100