@atlaspack/reporter-conditional-manifest 2.14.5-canary.13 → 2.14.5-canary.131

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,121 @@
1
1
  # @atlaspack/reporter-conditional-manifest
2
2
 
3
+ ## 2.15.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`13aef17`](https://github.com/atlassian-labs/atlaspack/commit/13aef177eea289a6e40d2113b5ec1ac9be18a33d)]:
8
+ - @atlaspack/feature-flags@2.19.1
9
+ - @atlaspack/plugin@2.14.19
10
+
11
+ ## 2.15.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#640](https://github.com/atlassian-labs/atlaspack/pull/640) [`dbb4072`](https://github.com/atlassian-labs/atlaspack/commit/dbb40721ebeb45990a14ba04e6b44e7f836fb32d) Thanks [@JakeLane](https://github.com/JakeLane)! - Clean up conditional bundling feature flags
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [[`dbb4072`](https://github.com/atlassian-labs/atlaspack/commit/dbb40721ebeb45990a14ba04e6b44e7f836fb32d), [`becf977`](https://github.com/atlassian-labs/atlaspack/commit/becf977f625d5ee46dae3d4c679f173bf5f40cc0), [`c4415a4`](https://github.com/atlassian-labs/atlaspack/commit/c4415a455543d984ca28452c2cb87a794d22497c), [`f0f7c71`](https://github.com/atlassian-labs/atlaspack/commit/f0f7c7168a1d3d18c6f30d2daed611275692b7c5), [`18a57cf`](https://github.com/atlassian-labs/atlaspack/commit/18a57cf8a4789b2de5ad8e2676f317a26cc91417)]:
20
+ - @atlaspack/feature-flags@2.19.0
21
+ - @atlaspack/plugin@2.14.18
22
+
23
+ ## 2.14.17
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies []:
28
+ - @atlaspack/plugin@2.14.17
29
+
30
+ ## 2.14.16
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies [[`e8a60ff`](https://github.com/atlassian-labs/atlaspack/commit/e8a60ffbea41caef265786bbf73349771760081c)]:
35
+ - @atlaspack/feature-flags@2.18.4
36
+ - @atlaspack/plugin@2.14.16
37
+
38
+ ## 2.14.15
39
+
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies [[`5ded263`](https://github.com/atlassian-labs/atlaspack/commit/5ded263c7f11b866e8885b81c73e20dd060b25be)]:
43
+ - @atlaspack/feature-flags@2.18.3
44
+ - @atlaspack/plugin@2.14.15
45
+
46
+ ## 2.14.14
47
+
48
+ ### Patch Changes
49
+
50
+ - Updated dependencies [[`644b157`](https://github.com/atlassian-labs/atlaspack/commit/644b157dee72a871acc2d0facf0b87b8eea51956)]:
51
+ - @atlaspack/feature-flags@2.18.2
52
+ - @atlaspack/plugin@2.14.14
53
+
54
+ ## 2.14.13
55
+
56
+ ### Patch Changes
57
+
58
+ - Updated dependencies [[`26aa9c5`](https://github.com/atlassian-labs/atlaspack/commit/26aa9c599d2be45ce1438a74c5fa22f39b9b554b), [`0501255`](https://github.com/atlassian-labs/atlaspack/commit/05012550da35b05ce7d356a8cc29311e7f9afdca)]:
59
+ - @atlaspack/feature-flags@2.18.1
60
+ - @atlaspack/plugin@2.14.13
61
+
62
+ ## 2.14.12
63
+
64
+ ### Patch Changes
65
+
66
+ - Updated dependencies [[`10fbcfb`](https://github.com/atlassian-labs/atlaspack/commit/10fbcfbfa49c7a83da5d7c40983e36e87f524a75), [`85c52d3`](https://github.com/atlassian-labs/atlaspack/commit/85c52d3f7717b3c84a118d18ab98cfbfd71dcbd2)]:
67
+ - @atlaspack/feature-flags@2.18.0
68
+ - @atlaspack/plugin@2.14.12
69
+
70
+ ## 2.14.11
71
+
72
+ ### Patch Changes
73
+
74
+ - Updated dependencies [[`73ea3c4`](https://github.com/atlassian-labs/atlaspack/commit/73ea3c4d85d4401fdd15abcbf988237e890e7ad3), [`b1b3693`](https://github.com/atlassian-labs/atlaspack/commit/b1b369317c66f8a431c170df2ebba4fa5b2e38ef)]:
75
+ - @atlaspack/feature-flags@2.17.0
76
+ - @atlaspack/plugin@2.14.11
77
+
78
+ ## 2.14.10
79
+
80
+ ### Patch Changes
81
+
82
+ - Updated dependencies []:
83
+ - @atlaspack/plugin@2.14.10
84
+
85
+ ## 2.14.9
86
+
87
+ ### Patch Changes
88
+
89
+ - [#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
90
+
91
+ - Updated dependencies [[`209692f`](https://github.com/atlassian-labs/atlaspack/commit/209692ffb11eae103a0d65c5e1118a5aa1625818), [`f4da1e1`](https://github.com/atlassian-labs/atlaspack/commit/f4da1e120e73eeb5e8b8927f05e88f04d6148c7b)]:
92
+ - @atlaspack/feature-flags@2.16.0
93
+ - @atlaspack/plugin@2.14.9
94
+
95
+ ## 2.14.8
96
+
97
+ ### Patch Changes
98
+
99
+ - Updated dependencies [[`30f6017`](https://github.com/atlassian-labs/atlaspack/commit/30f60175ba4d272c5fc193973c63bc298584775b)]:
100
+ - @atlaspack/feature-flags@2.15.1
101
+ - @atlaspack/plugin@2.14.8
102
+
103
+ ## 2.14.7
104
+
105
+ ### Patch Changes
106
+
107
+ - Updated dependencies [[`a1773d2`](https://github.com/atlassian-labs/atlaspack/commit/a1773d2a62d0ef7805ac7524621dcabcc1afe929)]:
108
+ - @atlaspack/feature-flags@2.15.0
109
+ - @atlaspack/plugin@2.14.7
110
+
111
+ ## 2.14.6
112
+
113
+ ### Patch Changes
114
+
115
+ - Updated dependencies [[`e0f5337`](https://github.com/atlassian-labs/atlaspack/commit/e0f533757bd1019dbd108a04952c87da15286e09)]:
116
+ - @atlaspack/feature-flags@2.14.4
117
+ - @atlaspack/plugin@2.14.6
118
+
3
119
  ## 2.14.5
4
120
 
5
121
  ### Patch Changes
@@ -28,13 +28,6 @@ function _plugin() {
28
28
  return data;
29
29
  }
30
30
  var _Config = require("./Config");
31
- function _featureFlags() {
32
- const data = require("@atlaspack/feature-flags");
33
- _featureFlags = function () {
34
- return data;
35
- };
36
- return data;
37
- }
38
31
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
39
32
  const manifestHashes = exports.manifestHashes = new Map();
40
33
  const updateManifest = async (outputFS, logger, conditionalManifestFilename, conditionalManifest) => {
@@ -63,16 +56,17 @@ async function report({
63
56
  const mapBundles = bundles => bundles.map(bundle => (0, _path().relative)(bundle.target.distDir, bundle.filePath));
64
57
  const manifest = {};
65
58
  for (const conditions of bundles.values()) {
66
- const bundleInfo = {};
67
59
  for (const [key, cond] of conditions) {
60
+ var _manifest$bundle$targ, _bundleInfo$key, _bundleInfo$key2;
68
61
  const bundle = cond.bundle;
62
+ const relativeBundlePath = (0, _path().relative)(bundle.target.distDir, bundle.filePath);
63
+ const bundleInfo = ((_manifest$bundle$targ = manifest[bundle.target.name]) === null || _manifest$bundle$targ === void 0 ? void 0 : _manifest$bundle$targ[relativeBundlePath]) ?? {};
69
64
  bundleInfo[key] = {
70
- // Reverse bundles so we load children bundles first
71
- ifTrueBundles: mapBundles(cond.ifTrueBundles).reverse(),
72
- ifFalseBundles: mapBundles(cond.ifFalseBundles).reverse()
65
+ ifTrueBundles: mapBundles(cond.ifTrueBundles).concat(((_bundleInfo$key = bundleInfo[key]) === null || _bundleInfo$key === void 0 ? void 0 : _bundleInfo$key.ifTrueBundles) ?? []).sort(),
66
+ ifFalseBundles: mapBundles(cond.ifFalseBundles).concat(((_bundleInfo$key2 = bundleInfo[key]) === null || _bundleInfo$key2 === void 0 ? void 0 : _bundleInfo$key2.ifFalseBundles) ?? []).sort()
73
67
  };
74
68
  manifest[bundle.target.name] ??= {};
75
- manifest[bundle.target.name][(0, _path().relative)(bundle.target.distDir, bundle.filePath)] = bundleInfo;
69
+ manifest[bundle.target.name][relativeBundlePath] = bundleInfo;
76
70
  }
77
71
  }
78
72
  const targets = new Set(event.bundleGraph.getBundles().map(bundle => bundle.target));
@@ -84,17 +78,7 @@ async function report({
84
78
  const conditionalManifest = JSON.stringify(
85
79
  // If there's no content, send an empty manifest so we can still map from it safely
86
80
  manifest[target.name] ?? {}, null, 2);
87
- if ((0, _featureFlags().getFeatureFlag)('conditionalBundlingReporterDuplicateFix')) {
88
- await updateManifest(options.outputFS, logger, conditionalManifestFilename, conditionalManifest);
89
- } else {
90
- await options.outputFS.mkdirp((0, _path().dirname)(conditionalManifestFilename));
91
- await options.outputFS.writeFile(conditionalManifestFilename, conditionalManifest, {
92
- mode: 0o666
93
- });
94
- logger.info({
95
- message: 'Wrote conditional manifest to ' + conditionalManifestFilename
96
- });
97
- }
81
+ await updateManifest(options.outputFS, logger, conditionalManifestFilename, conditionalManifest);
98
82
  }
99
83
  }
100
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/reporter-conditional-manifest",
3
- "version": "2.14.5-canary.13+e0f533757",
3
+ "version": "2.14.5-canary.131+75286ffe8",
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.81+e0f533757",
19
- "@atlaspack/plugin": "2.14.5-canary.13+e0f533757",
18
+ "@atlaspack/feature-flags": "2.14.1-canary.199+75286ffe8",
19
+ "@atlaspack/plugin": "2.14.5-canary.131+75286ffe8",
20
20
  "nullthrows": "^1.1.1"
21
21
  },
22
22
  "type": "commonjs",
23
- "gitHead": "e0f533757bd1019dbd108a04952c87da15286e09"
23
+ "gitHead": "75286ffe8068fae73afa5954a6d2a0f53fbf5e0d"
24
24
  }
@@ -12,7 +12,6 @@ import type {
12
12
  FilePath,
13
13
  } from '@atlaspack/types-internal';
14
14
  import {getConfig} from './Config';
15
- import {getFeatureFlag} from '@atlaspack/feature-flags';
16
15
 
17
16
  export const manifestHashes: Map<FilePath, string> = new Map();
18
17
 
@@ -60,18 +59,27 @@ export async function report({
60
59
 
61
60
  const manifest = {};
62
61
  for (const conditions of bundles.values()) {
63
- const bundleInfo = {};
64
62
  for (const [key, cond] of conditions) {
65
63
  const bundle = cond.bundle;
64
+ const relativeBundlePath = relative(
65
+ bundle.target.distDir,
66
+ bundle.filePath,
67
+ );
68
+
69
+ const bundleInfo =
70
+ manifest[bundle.target.name]?.[relativeBundlePath] ?? {};
71
+
66
72
  bundleInfo[key] = {
67
- // Reverse bundles so we load children bundles first
68
- ifTrueBundles: mapBundles(cond.ifTrueBundles).reverse(),
69
- ifFalseBundles: mapBundles(cond.ifFalseBundles).reverse(),
73
+ ifTrueBundles: mapBundles(cond.ifTrueBundles)
74
+ .concat(bundleInfo[key]?.ifTrueBundles ?? [])
75
+ .sort(),
76
+ ifFalseBundles: mapBundles(cond.ifFalseBundles)
77
+ .concat(bundleInfo[key]?.ifFalseBundles ?? [])
78
+ .sort(),
70
79
  };
80
+
71
81
  manifest[bundle.target.name] ??= {};
72
- manifest[bundle.target.name][
73
- relative(bundle.target.distDir, bundle.filePath)
74
- ] = bundleInfo;
82
+ manifest[bundle.target.name][relativeBundlePath] = bundleInfo;
75
83
  }
76
84
  }
77
85
 
@@ -90,26 +98,12 @@ export async function report({
90
98
  2,
91
99
  );
92
100
 
93
- if (getFeatureFlag('conditionalBundlingReporterDuplicateFix')) {
94
- await updateManifest(
95
- options.outputFS,
96
- logger,
97
- conditionalManifestFilename,
98
- conditionalManifest,
99
- );
100
- } else {
101
- await options.outputFS.mkdirp(dirname(conditionalManifestFilename));
102
- await options.outputFS.writeFile(
103
- conditionalManifestFilename,
104
- conditionalManifest,
105
- {mode: 0o666},
106
- );
107
-
108
- logger.info({
109
- message:
110
- 'Wrote conditional manifest to ' + conditionalManifestFilename,
111
- });
112
- }
101
+ await updateManifest(
102
+ options.outputFS,
103
+ logger,
104
+ conditionalManifestFilename,
105
+ conditionalManifest,
106
+ );
113
107
  }
114
108
  }
115
109
  }