@atlaspack/packager-html 2.14.5-dev.1c70d50f9.99 → 2.14.5-dev.69
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 +0 -42
- package/lib/HTMLPackager.js +1 -24
- package/package.json +5 -6
- package/src/HTMLPackager.js +8 -41
package/CHANGELOG.md
CHANGED
|
@@ -1,47 +1,5 @@
|
|
|
1
1
|
# @atlaspack/packager-html
|
|
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/utils@2.15.2
|
|
10
|
-
- @atlaspack/types@2.15.4
|
|
11
|
-
- @atlaspack/plugin@2.14.14
|
|
12
|
-
|
|
13
|
-
## 2.14.13
|
|
14
|
-
|
|
15
|
-
### Patch Changes
|
|
16
|
-
|
|
17
|
-
- Updated dependencies [[`26aa9c5`](https://github.com/atlassian-labs/atlaspack/commit/26aa9c599d2be45ce1438a74c5fa22f39b9b554b), [`0501255`](https://github.com/atlassian-labs/atlaspack/commit/05012550da35b05ce7d356a8cc29311e7f9afdca)]:
|
|
18
|
-
- @atlaspack/feature-flags@2.18.1
|
|
19
|
-
- @atlaspack/types@2.15.3
|
|
20
|
-
- @atlaspack/utils@2.15.1
|
|
21
|
-
- @atlaspack/plugin@2.14.13
|
|
22
|
-
|
|
23
|
-
## 2.14.12
|
|
24
|
-
|
|
25
|
-
### Patch Changes
|
|
26
|
-
|
|
27
|
-
- Updated dependencies [[`10fbcfb`](https://github.com/atlassian-labs/atlaspack/commit/10fbcfbfa49c7a83da5d7c40983e36e87f524a75), [`85c52d3`](https://github.com/atlassian-labs/atlaspack/commit/85c52d3f7717b3c84a118d18ab98cfbfd71dcbd2), [`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c)]:
|
|
28
|
-
- @atlaspack/feature-flags@2.18.0
|
|
29
|
-
- @atlaspack/utils@2.15.0
|
|
30
|
-
- @atlaspack/types@2.15.2
|
|
31
|
-
- @atlaspack/plugin@2.14.12
|
|
32
|
-
|
|
33
|
-
## 2.14.11
|
|
34
|
-
|
|
35
|
-
### Patch Changes
|
|
36
|
-
|
|
37
|
-
- [#623](https://github.com/atlassian-labs/atlaspack/pull/623) [`b1b3693`](https://github.com/atlassian-labs/atlaspack/commit/b1b369317c66f8a431c170df2ebba4fa5b2e38ef) Thanks [@JakeLane](https://github.com/JakeLane)! - Load same conditional bundles as conditional manifest in HTML
|
|
38
|
-
|
|
39
|
-
- Updated dependencies [[`73ea3c4`](https://github.com/atlassian-labs/atlaspack/commit/73ea3c4d85d4401fdd15abcbf988237e890e7ad3), [`b1b3693`](https://github.com/atlassian-labs/atlaspack/commit/b1b369317c66f8a431c170df2ebba4fa5b2e38ef)]:
|
|
40
|
-
- @atlaspack/feature-flags@2.17.0
|
|
41
|
-
- @atlaspack/utils@2.14.11
|
|
42
|
-
- @atlaspack/types@2.15.1
|
|
43
|
-
- @atlaspack/plugin@2.14.11
|
|
44
|
-
|
|
45
3
|
## 2.14.10
|
|
46
4
|
|
|
47
5
|
### Patch Changes
|
package/lib/HTMLPackager.js
CHANGED
|
@@ -46,13 +46,6 @@ function _nullthrows() {
|
|
|
46
46
|
};
|
|
47
47
|
return data;
|
|
48
48
|
}
|
|
49
|
-
function _featureFlags() {
|
|
50
|
-
const data = require("@atlaspack/feature-flags");
|
|
51
|
-
_featureFlags = function () {
|
|
52
|
-
return data;
|
|
53
|
-
};
|
|
54
|
-
return data;
|
|
55
|
-
}
|
|
56
49
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
57
50
|
// https://www.w3.org/TR/html5/dom.html#metadata-content-2
|
|
58
51
|
const metadataContent = new Set(['base', 'link', 'meta', 'noscript',
|
|
@@ -95,7 +88,7 @@ var _default = exports.default = new (_plugin().Packager)({
|
|
|
95
88
|
let referencedBundles = [...(0, _utils().setSymmetricDifference)(new Set(referencedBundlesRecursive), new Set(bundleGraph.getReferencedBundles(bundle, {
|
|
96
89
|
recursive: false
|
|
97
90
|
})))];
|
|
98
|
-
let conditionalBundles = config.evaluateRootConditionalBundles ? (0,
|
|
91
|
+
let conditionalBundles = config.evaluateRootConditionalBundles ? (0, _utils().setDifference)(new Set([...referencedBundlesRecursive.flatMap(referencedBundle => bundleGraph.getReferencedConditionalBundles(referencedBundle))]), new Set(referencedBundles)) : new Set();
|
|
99
92
|
let renderConfig = config === null || config === void 0 ? void 0 : config.render;
|
|
100
93
|
let {
|
|
101
94
|
html
|
|
@@ -250,20 +243,4 @@ function findBundleInsertIndex(content) {
|
|
|
250
243
|
}
|
|
251
244
|
}
|
|
252
245
|
return doctypeIndex ? doctypeIndex + 1 : 0;
|
|
253
|
-
}
|
|
254
|
-
function getReferencedConditionalScripts(bundleGraph, referencedBundles) {
|
|
255
|
-
const conditionalBundleMapping = bundleGraph.getConditionalBundleMapping();
|
|
256
|
-
const bundles = [];
|
|
257
|
-
for (const bundle of referencedBundles) {
|
|
258
|
-
const conditions = conditionalBundleMapping.get(bundle.id);
|
|
259
|
-
if (conditions) {
|
|
260
|
-
for (const [, cond] of conditions) {
|
|
261
|
-
// Reverse so dependent bundles are loaded first
|
|
262
|
-
const dependentBundles = [...cond.ifTrueBundles.reverse(), ...cond.ifFalseBundles.reverse()];
|
|
263
|
-
bundles.push(...dependentBundles);
|
|
264
|
-
referencedBundles.push(...dependentBundles);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
return new Set(bundles);
|
|
269
246
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/packager-html",
|
|
3
|
-
"version": "2.14.5-dev.
|
|
3
|
+
"version": "2.14.5-dev.69+67cb517ae",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -15,13 +15,12 @@
|
|
|
15
15
|
"node": ">= 16.0.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@atlaspack/
|
|
19
|
-
"@atlaspack/
|
|
20
|
-
"@atlaspack/
|
|
21
|
-
"@atlaspack/utils": "2.14.5-dev.1c70d50f9.99+1c70d50f9",
|
|
18
|
+
"@atlaspack/plugin": "2.14.5-dev.69+67cb517ae",
|
|
19
|
+
"@atlaspack/types": "2.14.5-dev.69+67cb517ae",
|
|
20
|
+
"@atlaspack/utils": "2.14.5-dev.69+67cb517ae",
|
|
22
21
|
"nullthrows": "^1.1.1",
|
|
23
22
|
"posthtml": "^0.16.5"
|
|
24
23
|
},
|
|
25
24
|
"type": "commonjs",
|
|
26
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "67cb517ae793046fb5a0d2ef02ba74510fefccf3"
|
|
27
26
|
}
|
package/src/HTMLPackager.js
CHANGED
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
urlJoin,
|
|
14
14
|
} from '@atlaspack/utils';
|
|
15
15
|
import nullthrows from 'nullthrows';
|
|
16
|
-
import {getFeatureFlag} from '@atlaspack/feature-flags';
|
|
17
16
|
|
|
18
17
|
// https://www.w3.org/TR/html5/dom.html#metadata-content-2
|
|
19
18
|
const metadataContent = new Set([
|
|
@@ -77,23 +76,16 @@ export default (new Packager({
|
|
|
77
76
|
];
|
|
78
77
|
|
|
79
78
|
let conditionalBundles = config.evaluateRootConditionalBundles
|
|
80
|
-
?
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
bundleGraph,
|
|
84
|
-
referencedBundlesRecursive,
|
|
79
|
+
? setDifference(
|
|
80
|
+
new Set([
|
|
81
|
+
...referencedBundlesRecursive.flatMap((referencedBundle) =>
|
|
82
|
+
bundleGraph.getReferencedConditionalBundles(referencedBundle),
|
|
85
83
|
),
|
|
86
|
-
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
new Set([
|
|
90
|
-
...referencedBundlesRecursive.flatMap((referencedBundle) =>
|
|
91
|
-
bundleGraph.getReferencedConditionalBundles(referencedBundle),
|
|
92
|
-
),
|
|
93
|
-
]),
|
|
94
|
-
new Set(referencedBundles),
|
|
95
|
-
)
|
|
84
|
+
]),
|
|
85
|
+
new Set(referencedBundles),
|
|
86
|
+
)
|
|
96
87
|
: new Set();
|
|
88
|
+
|
|
97
89
|
let renderConfig = config?.render;
|
|
98
90
|
|
|
99
91
|
let {html} = await posthtml([
|
|
@@ -292,28 +284,3 @@ function findBundleInsertIndex(content) {
|
|
|
292
284
|
|
|
293
285
|
return doctypeIndex ? doctypeIndex + 1 : 0;
|
|
294
286
|
}
|
|
295
|
-
|
|
296
|
-
function getReferencedConditionalScripts(
|
|
297
|
-
bundleGraph: BundleGraph<NamedBundle>,
|
|
298
|
-
referencedBundles: NamedBundle[],
|
|
299
|
-
): Set<NamedBundle> {
|
|
300
|
-
const conditionalBundleMapping = bundleGraph.getConditionalBundleMapping();
|
|
301
|
-
|
|
302
|
-
const bundles = [];
|
|
303
|
-
for (const bundle of referencedBundles) {
|
|
304
|
-
const conditions = conditionalBundleMapping.get(bundle.id);
|
|
305
|
-
if (conditions) {
|
|
306
|
-
for (const [, cond] of conditions) {
|
|
307
|
-
// Reverse so dependent bundles are loaded first
|
|
308
|
-
const dependentBundles = [
|
|
309
|
-
...cond.ifTrueBundles.reverse(),
|
|
310
|
-
...cond.ifFalseBundles.reverse(),
|
|
311
|
-
];
|
|
312
|
-
bundles.push(...dependentBundles);
|
|
313
|
-
referencedBundles.push(...dependentBundles);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
return new Set(bundles);
|
|
319
|
-
}
|