@atlaspack/packager-js 2.21.2-dev-inline-requires-reuse-bdc9ca9c3.0 → 2.21.3-inline-requires-take-2-2a0c642df.0
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 +16 -0
- package/lib/ScopeHoistingPackager.js +11 -4
- package/package.json +8 -8
- package/src/ScopeHoistingPackager.ts +13 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaspack/packager-js
|
|
2
2
|
|
|
3
|
+
## 2.21.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#742](https://github.com/atlassian-labs/atlaspack/pull/742) [`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd) Thanks [@yamadapc](https://github.com/yamadapc)! - Internal changes and bug fixes to environmentDeduplication flag
|
|
8
|
+
|
|
9
|
+
- [#755](https://github.com/atlassian-labs/atlaspack/pull/755) [`b6e72b6`](https://github.com/atlassian-labs/atlaspack/commit/b6e72b6dd2b517cbb0e700fa69e63332d3eacb1e) Thanks [@benjervis](https://github.com/benjervis)! - Allow runtime assets to be marked as requiring execution on load
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd), [`889c65c`](https://github.com/atlassian-labs/atlaspack/commit/889c65cd25b811045e26a117e7404f694dde77a2)]:
|
|
12
|
+
- @atlaspack/feature-flags@2.23.1
|
|
13
|
+
- @atlaspack/diagnostic@2.14.3
|
|
14
|
+
- @atlaspack/plugin@2.14.26
|
|
15
|
+
- @atlaspack/types@2.15.16
|
|
16
|
+
- @atlaspack/utils@2.18.3
|
|
17
|
+
- @atlaspack/rust@3.6.1
|
|
18
|
+
|
|
3
19
|
## 2.21.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -190,10 +190,17 @@ class ScopeHoistingPackager {
|
|
|
190
190
|
let entries = this.bundle.getEntryAssets();
|
|
191
191
|
let mainEntry = this.bundle.getMainEntry();
|
|
192
192
|
if (this.isAsyncBundle) {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
if ((0, _featureFlags().getFeatureFlag)('applyScopeHoistingImprovement') || (0, _featureFlags().getFeatureFlag)('supportWebpackChunkName')) {
|
|
194
|
+
// Generally speaking, async bundles should not be executed on load, as
|
|
195
|
+
// they're just collections of assets that other assets require.
|
|
196
|
+
// However, there are some special cases where a runtime asset needs to be
|
|
197
|
+
// injected, but no other asset will require it (mostly the bundle
|
|
198
|
+
// manifest).
|
|
199
|
+
// In this case, those assets need to be required on load.
|
|
200
|
+
entries = entries.filter(a => {
|
|
201
|
+
var _a$meta;
|
|
202
|
+
return (_a$meta = a.meta) === null || _a$meta === void 0 ? void 0 : _a$meta.runtimeAssetRequiringExecutionOnLoad;
|
|
203
|
+
});
|
|
197
204
|
} else {
|
|
198
205
|
entries = entries.filter(a => {
|
|
199
206
|
var _mainEntry;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/packager-js",
|
|
3
|
-
"version": "2.21.
|
|
3
|
+
"version": "2.21.3-inline-requires-take-2-2a0c642df.0",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"node": ">= 16.0.0"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@atlaspack/diagnostic": "2.14.
|
|
20
|
-
"@atlaspack/feature-flags": "2.23.
|
|
21
|
-
"@atlaspack/plugin": "2.14.
|
|
22
|
-
"@atlaspack/rust": "3.6.
|
|
23
|
-
"@atlaspack/types": "2.15.
|
|
24
|
-
"@atlaspack/utils": "2.18.
|
|
19
|
+
"@atlaspack/diagnostic": "2.14.4-inline-requires-take-2-2a0c642df.0",
|
|
20
|
+
"@atlaspack/feature-flags": "2.23.2-inline-requires-take-2-2a0c642df.0",
|
|
21
|
+
"@atlaspack/plugin": "2.14.27-inline-requires-take-2-2a0c642df.0",
|
|
22
|
+
"@atlaspack/rust": "3.6.2-inline-requires-take-2-2a0c642df.0",
|
|
23
|
+
"@atlaspack/types": "2.15.17-inline-requires-take-2-2a0c642df.0",
|
|
24
|
+
"@atlaspack/utils": "2.18.4-inline-requires-take-2-2a0c642df.0",
|
|
25
25
|
"@parcel/source-map": "^2.1.1",
|
|
26
26
|
"globals": "^13.2.0",
|
|
27
27
|
"nullthrows": "^1.1.1",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"check-ts": "tsc --emitDeclarationOnly --rootDir src",
|
|
33
33
|
"build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "2a0c642dfe354e30a8cbd23be0b1a283eab54040"
|
|
36
36
|
}
|
|
@@ -220,10 +220,19 @@ export class ScopeHoistingPackager {
|
|
|
220
220
|
let entries = this.bundle.getEntryAssets();
|
|
221
221
|
let mainEntry = this.bundle.getMainEntry();
|
|
222
222
|
if (this.isAsyncBundle) {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
223
|
+
if (
|
|
224
|
+
getFeatureFlag('applyScopeHoistingImprovement') ||
|
|
225
|
+
getFeatureFlag('supportWebpackChunkName')
|
|
226
|
+
) {
|
|
227
|
+
// Generally speaking, async bundles should not be executed on load, as
|
|
228
|
+
// they're just collections of assets that other assets require.
|
|
229
|
+
// However, there are some special cases where a runtime asset needs to be
|
|
230
|
+
// injected, but no other asset will require it (mostly the bundle
|
|
231
|
+
// manifest).
|
|
232
|
+
// In this case, those assets need to be required on load.
|
|
233
|
+
entries = entries.filter(
|
|
234
|
+
(a) => a.meta?.runtimeAssetRequiringExecutionOnLoad,
|
|
235
|
+
);
|
|
227
236
|
} else {
|
|
228
237
|
entries = entries.filter((a) => a.id !== mainEntry?.id);
|
|
229
238
|
}
|