@atlaspack/reporter-conditional-manifest 2.14.5-canary.12 → 2.14.5-canary.121

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,101 @@
1
1
  # @atlaspack/reporter-conditional-manifest
2
2
 
3
+ ## 2.14.17
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - @atlaspack/plugin@2.14.17
9
+
10
+ ## 2.14.16
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`e8a60ff`](https://github.com/atlassian-labs/atlaspack/commit/e8a60ffbea41caef265786bbf73349771760081c)]:
15
+ - @atlaspack/feature-flags@2.18.4
16
+ - @atlaspack/plugin@2.14.16
17
+
18
+ ## 2.14.15
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [[`5ded263`](https://github.com/atlassian-labs/atlaspack/commit/5ded263c7f11b866e8885b81c73e20dd060b25be)]:
23
+ - @atlaspack/feature-flags@2.18.3
24
+ - @atlaspack/plugin@2.14.15
25
+
26
+ ## 2.14.14
27
+
28
+ ### Patch Changes
29
+
30
+ - Updated dependencies [[`644b157`](https://github.com/atlassian-labs/atlaspack/commit/644b157dee72a871acc2d0facf0b87b8eea51956)]:
31
+ - @atlaspack/feature-flags@2.18.2
32
+ - @atlaspack/plugin@2.14.14
33
+
34
+ ## 2.14.13
35
+
36
+ ### Patch Changes
37
+
38
+ - Updated dependencies [[`26aa9c5`](https://github.com/atlassian-labs/atlaspack/commit/26aa9c599d2be45ce1438a74c5fa22f39b9b554b), [`0501255`](https://github.com/atlassian-labs/atlaspack/commit/05012550da35b05ce7d356a8cc29311e7f9afdca)]:
39
+ - @atlaspack/feature-flags@2.18.1
40
+ - @atlaspack/plugin@2.14.13
41
+
42
+ ## 2.14.12
43
+
44
+ ### Patch Changes
45
+
46
+ - Updated dependencies [[`10fbcfb`](https://github.com/atlassian-labs/atlaspack/commit/10fbcfbfa49c7a83da5d7c40983e36e87f524a75), [`85c52d3`](https://github.com/atlassian-labs/atlaspack/commit/85c52d3f7717b3c84a118d18ab98cfbfd71dcbd2)]:
47
+ - @atlaspack/feature-flags@2.18.0
48
+ - @atlaspack/plugin@2.14.12
49
+
50
+ ## 2.14.11
51
+
52
+ ### Patch Changes
53
+
54
+ - Updated dependencies [[`73ea3c4`](https://github.com/atlassian-labs/atlaspack/commit/73ea3c4d85d4401fdd15abcbf988237e890e7ad3), [`b1b3693`](https://github.com/atlassian-labs/atlaspack/commit/b1b369317c66f8a431c170df2ebba4fa5b2e38ef)]:
55
+ - @atlaspack/feature-flags@2.17.0
56
+ - @atlaspack/plugin@2.14.11
57
+
58
+ ## 2.14.10
59
+
60
+ ### Patch Changes
61
+
62
+ - Updated dependencies []:
63
+ - @atlaspack/plugin@2.14.10
64
+
65
+ ## 2.14.9
66
+
67
+ ### Patch Changes
68
+
69
+ - [#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
70
+
71
+ - Updated dependencies [[`209692f`](https://github.com/atlassian-labs/atlaspack/commit/209692ffb11eae103a0d65c5e1118a5aa1625818), [`f4da1e1`](https://github.com/atlassian-labs/atlaspack/commit/f4da1e120e73eeb5e8b8927f05e88f04d6148c7b)]:
72
+ - @atlaspack/feature-flags@2.16.0
73
+ - @atlaspack/plugin@2.14.9
74
+
75
+ ## 2.14.8
76
+
77
+ ### Patch Changes
78
+
79
+ - Updated dependencies [[`30f6017`](https://github.com/atlassian-labs/atlaspack/commit/30f60175ba4d272c5fc193973c63bc298584775b)]:
80
+ - @atlaspack/feature-flags@2.15.1
81
+ - @atlaspack/plugin@2.14.8
82
+
83
+ ## 2.14.7
84
+
85
+ ### Patch Changes
86
+
87
+ - Updated dependencies [[`a1773d2`](https://github.com/atlassian-labs/atlaspack/commit/a1773d2a62d0ef7805ac7524621dcabcc1afe929)]:
88
+ - @atlaspack/feature-flags@2.15.0
89
+ - @atlaspack/plugin@2.14.7
90
+
91
+ ## 2.14.6
92
+
93
+ ### Patch Changes
94
+
95
+ - Updated dependencies [[`e0f5337`](https://github.com/atlassian-labs/atlaspack/commit/e0f533757bd1019dbd108a04952c87da15286e09)]:
96
+ - @atlaspack/feature-flags@2.14.4
97
+ - @atlaspack/plugin@2.14.6
98
+
3
99
  ## 2.14.5
4
100
 
5
101
  ### 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-canary.12+143753ba0",
3
+ "version": "2.14.5-canary.121+18a57cf8a",
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-canary.80+143753ba0",
19
- "@atlaspack/plugin": "2.14.5-canary.12+143753ba0",
18
+ "@atlaspack/feature-flags": "2.14.1-canary.189+18a57cf8a",
19
+ "@atlaspack/plugin": "2.14.5-canary.121+18a57cf8a",
20
20
  "nullthrows": "^1.1.1"
21
21
  },
22
22
  "type": "commonjs",
23
- "gitHead": "143753ba049078d59fbf1a8880f4c4caf2320311"
23
+ "gitHead": "18a57cf8a4789b2de5ad8e2676f317a26cc91417"
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