@atlaspack/packager-js 2.14.5-dev.14 → 2.14.5-dev.55
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 +44 -0
- package/lib/ScopeHoistingPackager.js +1 -10
- package/package.json +8 -8
- package/src/ScopeHoistingPackager.js +1 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
# @atlaspack/packager-js
|
|
2
2
|
|
|
3
|
+
## 2.14.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`124b7ff`](https://github.com/atlassian-labs/atlaspack/commit/124b7fff44f71aac9fbad289a9a9509b3dfc9aaa), [`e052521`](https://github.com/atlassian-labs/atlaspack/commit/e0525210850ed1606146eb86991049cf567c5dec), [`15c6d70`](https://github.com/atlassian-labs/atlaspack/commit/15c6d7000bd89da876bc590aa75b17a619a41896), [`e4d966c`](https://github.com/atlassian-labs/atlaspack/commit/e4d966c3c9c4292c5013372ae65b10d19d4bacc6), [`209692f`](https://github.com/atlassian-labs/atlaspack/commit/209692ffb11eae103a0d65c5e1118a5aa1625818), [`42a775d`](https://github.com/atlassian-labs/atlaspack/commit/42a775de8eec638ad188f3271964170d8c04d84b), [`29c2f10`](https://github.com/atlassian-labs/atlaspack/commit/29c2f106de9679adfb5afa04e1910471dc65a427), [`f4da1e1`](https://github.com/atlassian-labs/atlaspack/commit/f4da1e120e73eeb5e8b8927f05e88f04d6148c7b), [`1ef91fc`](https://github.com/atlassian-labs/atlaspack/commit/1ef91fcc863fdd2831511937083dbbc1263b3d9d)]:
|
|
8
|
+
- @atlaspack/rust@3.3.4
|
|
9
|
+
- @atlaspack/feature-flags@2.16.0
|
|
10
|
+
- @atlaspack/utils@2.14.9
|
|
11
|
+
- @atlaspack/types@2.14.9
|
|
12
|
+
- @atlaspack/plugin@2.14.9
|
|
13
|
+
|
|
14
|
+
## 2.14.8
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [[`30f6017`](https://github.com/atlassian-labs/atlaspack/commit/30f60175ba4d272c5fc193973c63bc298584775b), [`1ab0a27`](https://github.com/atlassian-labs/atlaspack/commit/1ab0a275aeca40350415e2b03e7440d1dddc6228), [`b8a4ae8`](https://github.com/atlassian-labs/atlaspack/commit/b8a4ae8f83dc0a83d8b145c5f729936ce52080a3)]:
|
|
19
|
+
- @atlaspack/feature-flags@2.15.1
|
|
20
|
+
- @atlaspack/rust@3.3.3
|
|
21
|
+
- @atlaspack/utils@2.14.8
|
|
22
|
+
- @atlaspack/types@2.14.8
|
|
23
|
+
- @atlaspack/plugin@2.14.8
|
|
24
|
+
|
|
25
|
+
## 2.14.7
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- Updated dependencies [[`a1773d2`](https://github.com/atlassian-labs/atlaspack/commit/a1773d2a62d0ef7805ac7524621dcabcc1afe929), [`556d6ab`](https://github.com/atlassian-labs/atlaspack/commit/556d6ab8ede759fa7f37fcd3f4da336ef1c55e8f)]:
|
|
30
|
+
- @atlaspack/feature-flags@2.15.0
|
|
31
|
+
- @atlaspack/rust@3.3.2
|
|
32
|
+
- @atlaspack/utils@2.14.7
|
|
33
|
+
- @atlaspack/types@2.14.7
|
|
34
|
+
- @atlaspack/plugin@2.14.7
|
|
35
|
+
|
|
36
|
+
## 2.14.6
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- Updated dependencies [[`e0f5337`](https://github.com/atlassian-labs/atlaspack/commit/e0f533757bd1019dbd108a04952c87da15286e09)]:
|
|
41
|
+
- @atlaspack/feature-flags@2.14.4
|
|
42
|
+
- @atlaspack/rust@3.3.1
|
|
43
|
+
- @atlaspack/utils@2.14.6
|
|
44
|
+
- @atlaspack/types@2.14.6
|
|
45
|
+
- @atlaspack/plugin@2.14.6
|
|
46
|
+
|
|
3
47
|
## 2.14.5
|
|
4
48
|
|
|
5
49
|
### Patch Changes
|
|
@@ -60,13 +60,6 @@ function _featureFlags() {
|
|
|
60
60
|
};
|
|
61
61
|
return data;
|
|
62
62
|
}
|
|
63
|
-
function _buildCache() {
|
|
64
|
-
const data = require("@atlaspack/build-cache");
|
|
65
|
-
_buildCache = function () {
|
|
66
|
-
return data;
|
|
67
|
-
};
|
|
68
|
-
return data;
|
|
69
|
-
}
|
|
70
63
|
var _ESMOutputFormat = require("./ESMOutputFormat");
|
|
71
64
|
var _CJSOutputFormat = require("./CJSOutputFormat");
|
|
72
65
|
var _GlobalOutputFormat = require("./GlobalOutputFormat");
|
|
@@ -96,7 +89,6 @@ const OUTPUT_FORMATS = {
|
|
|
96
89
|
commonjs: _CJSOutputFormat.CJSOutputFormat,
|
|
97
90
|
global: _GlobalOutputFormat.GlobalOutputFormat
|
|
98
91
|
};
|
|
99
|
-
const bundleDirectReferences = (0, _buildCache().createBuildCache)();
|
|
100
92
|
class ScopeHoistingPackager {
|
|
101
93
|
exportedSymbols = new Map();
|
|
102
94
|
externals = new Map();
|
|
@@ -273,7 +265,6 @@ class ScopeHoistingPackager {
|
|
|
273
265
|
maxConcurrent: 32
|
|
274
266
|
});
|
|
275
267
|
let wrapped = [];
|
|
276
|
-
const referencedAssets = this.bundleGraph.getReferencedAssets(this.bundle, bundleDirectReferences);
|
|
277
268
|
this.bundle.traverseAssets(asset => {
|
|
278
269
|
queue.add(async () => {
|
|
279
270
|
let [code, map] = await Promise.all([asset.getCode(), this.bundle.env.sourceMap ? asset.getMapBuffer() : null]);
|
|
@@ -282,7 +273,7 @@ class ScopeHoistingPackager {
|
|
|
282
273
|
map
|
|
283
274
|
}];
|
|
284
275
|
});
|
|
285
|
-
if (asset.meta.shouldWrap || this.bundle.env.sourceType === 'script' ||
|
|
276
|
+
if (asset.meta.shouldWrap || this.bundle.env.sourceType === 'script' || this.bundleGraph.isAssetReferenced(this.bundle, asset) || this.bundleGraph.getIncomingDependencies(asset).some(dep => dep.meta.shouldWrap && dep.specifierType !== 'url')) {
|
|
286
277
|
// Don't wrap constant "entry" modules _except_ if they are referenced by any lazy dependency
|
|
287
278
|
if (!asset.meta.isConstantModule || this.bundleGraph.getIncomingDependencies(asset).some(dep => dep.priority === 'lazy')) {
|
|
288
279
|
this.wrappedAssets.add(asset.id);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/packager-js",
|
|
3
|
-
"version": "2.14.5-dev.
|
|
3
|
+
"version": "2.14.5-dev.55+5a11f33c5",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
"node": ">= 16.0.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@atlaspack/diagnostic": "2.14.1-dev.
|
|
19
|
-
"@atlaspack/feature-flags": "2.14.1-dev.
|
|
20
|
-
"@atlaspack/plugin": "2.14.5-dev.
|
|
21
|
-
"@atlaspack/rust": "3.2.1-dev.
|
|
22
|
-
"@atlaspack/types": "2.14.5-dev.
|
|
23
|
-
"@atlaspack/utils": "2.14.5-dev.
|
|
18
|
+
"@atlaspack/diagnostic": "2.14.1-dev.123+5a11f33c5",
|
|
19
|
+
"@atlaspack/feature-flags": "2.14.1-dev.123+5a11f33c5",
|
|
20
|
+
"@atlaspack/plugin": "2.14.5-dev.55+5a11f33c5",
|
|
21
|
+
"@atlaspack/rust": "3.2.1-dev.55+5a11f33c5",
|
|
22
|
+
"@atlaspack/types": "2.14.5-dev.55+5a11f33c5",
|
|
23
|
+
"@atlaspack/utils": "2.14.5-dev.55+5a11f33c5",
|
|
24
24
|
"@parcel/source-map": "^2.1.1",
|
|
25
25
|
"globals": "^13.2.0",
|
|
26
26
|
"nullthrows": "^1.1.1"
|
|
27
27
|
},
|
|
28
28
|
"type": "commonjs",
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "5a11f33c51ff74d1cf8d4b72cfa0fda833aa980a"
|
|
30
30
|
}
|
|
@@ -25,7 +25,6 @@ import ThrowableDiagnostic, {
|
|
|
25
25
|
import globals from 'globals';
|
|
26
26
|
import path from 'path';
|
|
27
27
|
import {getFeatureFlag} from '@atlaspack/feature-flags';
|
|
28
|
-
import {createBuildCache} from '@atlaspack/build-cache';
|
|
29
28
|
|
|
30
29
|
import {ESMOutputFormat} from './ESMOutputFormat';
|
|
31
30
|
import {CJSOutputFormat} from './CJSOutputFormat';
|
|
@@ -76,8 +75,6 @@ export interface OutputFormat {
|
|
|
76
75
|
buildBundlePostlude(): [string, number];
|
|
77
76
|
}
|
|
78
77
|
|
|
79
|
-
const bundleDirectReferences = createBuildCache();
|
|
80
|
-
|
|
81
78
|
export class ScopeHoistingPackager {
|
|
82
79
|
options: PluginOptions;
|
|
83
80
|
bundleGraph: BundleGraph<NamedBundle>;
|
|
@@ -360,12 +357,6 @@ export class ScopeHoistingPackager {
|
|
|
360
357
|
async loadAssets(): Promise<Array<Asset>> {
|
|
361
358
|
let queue = new PromiseQueue({maxConcurrent: 32});
|
|
362
359
|
let wrapped = [];
|
|
363
|
-
|
|
364
|
-
const referencedAssets = this.bundleGraph.getReferencedAssets(
|
|
365
|
-
this.bundle,
|
|
366
|
-
bundleDirectReferences,
|
|
367
|
-
);
|
|
368
|
-
|
|
369
360
|
this.bundle.traverseAssets((asset) => {
|
|
370
361
|
queue.add(async () => {
|
|
371
362
|
let [code, map] = await Promise.all([
|
|
@@ -378,7 +369,7 @@ export class ScopeHoistingPackager {
|
|
|
378
369
|
if (
|
|
379
370
|
asset.meta.shouldWrap ||
|
|
380
371
|
this.bundle.env.sourceType === 'script' ||
|
|
381
|
-
|
|
372
|
+
this.bundleGraph.isAssetReferenced(this.bundle, asset) ||
|
|
382
373
|
this.bundleGraph
|
|
383
374
|
.getIncomingDependencies(asset)
|
|
384
375
|
.some((dep) => dep.meta.shouldWrap && dep.specifierType !== 'url')
|