@atlaspack/core 2.16.2-canary.161 → 2.16.2-canary.163
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/lib/applyRuntimes.js
CHANGED
|
@@ -161,11 +161,13 @@ async function applyRuntimes({
|
|
|
161
161
|
filePath,
|
|
162
162
|
isEntry,
|
|
163
163
|
env,
|
|
164
|
+
runtimeAssetRequiringExecutionOnLoad,
|
|
164
165
|
priority
|
|
165
166
|
} of runtimeAssets) {
|
|
166
167
|
let sourceName = _path().default.join(_path().default.dirname(filePath), `runtime-${(0, _rust().hashString)(code)}.${bundle.type}`);
|
|
167
168
|
let assetGroup = {
|
|
168
169
|
code,
|
|
170
|
+
runtimeAssetRequiringExecutionOnLoad,
|
|
169
171
|
filePath: (0, _projectPath.toProjectPath)(options.projectRoot, sourceName),
|
|
170
172
|
env: (0, _Environment.mergeEnvironments)(options.projectRoot, (0, _EnvironmentManager.fromEnvironmentId)(bundle.env), env),
|
|
171
173
|
// Runtime assets should be considered source, as they should be
|
|
@@ -415,6 +415,14 @@ class AssetGraphBuilder {
|
|
|
415
415
|
});
|
|
416
416
|
if (assets != null) {
|
|
417
417
|
for (let asset of assets) {
|
|
418
|
+
// Pass the runtimeAssetRequiringExecutionOnLoad flag from the asset
|
|
419
|
+
// group down to the asset itself, for reading in the packager.
|
|
420
|
+
if (input.runtimeAssetRequiringExecutionOnLoad) {
|
|
421
|
+
asset.meta = {
|
|
422
|
+
...(asset.meta ?? {}),
|
|
423
|
+
runtimeAssetRequiringExecutionOnLoad: input.runtimeAssetRequiringExecutionOnLoad
|
|
424
|
+
};
|
|
425
|
+
}
|
|
418
426
|
if (this.assetGraph.safeToIncrementallyBundle) {
|
|
419
427
|
let otherAsset = this.assetGraph.getNodeByContentKey(asset.id);
|
|
420
428
|
if (otherAsset != null) {
|
package/lib/types/types.d.ts
CHANGED
|
@@ -322,6 +322,7 @@ export type AssetRequestInput = {
|
|
|
322
322
|
isSource?: boolean;
|
|
323
323
|
canDefer?: boolean;
|
|
324
324
|
sideEffects?: boolean;
|
|
325
|
+
runtimeAssetRequiringExecutionOnLoad?: boolean;
|
|
325
326
|
code?: string;
|
|
326
327
|
pipeline?: string | null | undefined;
|
|
327
328
|
optionsRef: SharedReference;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/core",
|
|
3
|
-
"version": "2.16.2-canary.
|
|
3
|
+
"version": "2.16.2-canary.163+889c65cd2",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -23,21 +23,21 @@
|
|
|
23
23
|
"build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@atlaspack/build-cache": "2.13.3-canary.
|
|
27
|
-
"@atlaspack/cache": "3.1.1-canary.
|
|
28
|
-
"@atlaspack/diagnostic": "2.14.1-canary.
|
|
29
|
-
"@atlaspack/events": "2.14.1-canary.
|
|
30
|
-
"@atlaspack/feature-flags": "2.14.1-canary.
|
|
31
|
-
"@atlaspack/fs": "2.14.5-canary.
|
|
32
|
-
"@atlaspack/graph": "3.4.1-canary.
|
|
33
|
-
"@atlaspack/logger": "2.14.5-canary.
|
|
34
|
-
"@atlaspack/package-manager": "2.14.5-canary.
|
|
35
|
-
"@atlaspack/plugin": "2.14.5-canary.
|
|
36
|
-
"@atlaspack/profiler": "2.14.1-canary.
|
|
37
|
-
"@atlaspack/rust": "3.2.1-canary.
|
|
38
|
-
"@atlaspack/types": "2.14.5-canary.
|
|
39
|
-
"@atlaspack/utils": "2.14.5-canary.
|
|
40
|
-
"@atlaspack/workers": "2.14.5-canary.
|
|
26
|
+
"@atlaspack/build-cache": "2.13.3-canary.231+889c65cd2",
|
|
27
|
+
"@atlaspack/cache": "3.1.1-canary.163+889c65cd2",
|
|
28
|
+
"@atlaspack/diagnostic": "2.14.1-canary.231+889c65cd2",
|
|
29
|
+
"@atlaspack/events": "2.14.1-canary.231+889c65cd2",
|
|
30
|
+
"@atlaspack/feature-flags": "2.14.1-canary.231+889c65cd2",
|
|
31
|
+
"@atlaspack/fs": "2.14.5-canary.163+889c65cd2",
|
|
32
|
+
"@atlaspack/graph": "3.4.1-canary.231+889c65cd2",
|
|
33
|
+
"@atlaspack/logger": "2.14.5-canary.163+889c65cd2",
|
|
34
|
+
"@atlaspack/package-manager": "2.14.5-canary.163+889c65cd2",
|
|
35
|
+
"@atlaspack/plugin": "2.14.5-canary.163+889c65cd2",
|
|
36
|
+
"@atlaspack/profiler": "2.14.1-canary.231+889c65cd2",
|
|
37
|
+
"@atlaspack/rust": "3.2.1-canary.163+889c65cd2",
|
|
38
|
+
"@atlaspack/types": "2.14.5-canary.163+889c65cd2",
|
|
39
|
+
"@atlaspack/utils": "2.14.5-canary.163+889c65cd2",
|
|
40
|
+
"@atlaspack/workers": "2.14.5-canary.163+889c65cd2",
|
|
41
41
|
"@mischnic/json-sourcemap": "^0.1.0",
|
|
42
42
|
"@parcel/source-map": "^2.1.1",
|
|
43
43
|
"base-x": "^3.0.8",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"./src/serializerCore.js": "./src/serializerCore.browser.js"
|
|
63
63
|
},
|
|
64
64
|
"type": "commonjs",
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "889c65cd25b811045e26a117e7404f694dde77a2"
|
|
66
66
|
}
|
package/src/applyRuntimes.ts
CHANGED
|
@@ -150,6 +150,7 @@ export default async function applyRuntimes<TResult extends RequestResult>({
|
|
|
150
150
|
filePath,
|
|
151
151
|
isEntry,
|
|
152
152
|
env,
|
|
153
|
+
runtimeAssetRequiringExecutionOnLoad,
|
|
153
154
|
priority,
|
|
154
155
|
} of runtimeAssets) {
|
|
155
156
|
let sourceName = path.join(
|
|
@@ -159,6 +160,7 @@ export default async function applyRuntimes<TResult extends RequestResult>({
|
|
|
159
160
|
|
|
160
161
|
let assetGroup = {
|
|
161
162
|
code,
|
|
163
|
+
runtimeAssetRequiringExecutionOnLoad,
|
|
162
164
|
filePath: toProjectPath(options.projectRoot, sourceName),
|
|
163
165
|
env: mergeEnvironments(
|
|
164
166
|
options.projectRoot,
|
|
@@ -560,6 +560,16 @@ export class AssetGraphBuilder {
|
|
|
560
560
|
|
|
561
561
|
if (assets != null) {
|
|
562
562
|
for (let asset of assets) {
|
|
563
|
+
// Pass the runtimeAssetRequiringExecutionOnLoad flag from the asset
|
|
564
|
+
// group down to the asset itself, for reading in the packager.
|
|
565
|
+
if (input.runtimeAssetRequiringExecutionOnLoad) {
|
|
566
|
+
asset.meta = {
|
|
567
|
+
...(asset.meta ?? {}),
|
|
568
|
+
runtimeAssetRequiringExecutionOnLoad:
|
|
569
|
+
input.runtimeAssetRequiringExecutionOnLoad,
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
|
|
563
573
|
if (this.assetGraph.safeToIncrementallyBundle) {
|
|
564
574
|
let otherAsset = this.assetGraph.getNodeByContentKey(asset.id);
|
|
565
575
|
if (otherAsset != null) {
|
package/src/types.ts
CHANGED
|
@@ -428,6 +428,7 @@ export type AssetRequestInput = {
|
|
|
428
428
|
isSource?: boolean;
|
|
429
429
|
canDefer?: boolean;
|
|
430
430
|
sideEffects?: boolean;
|
|
431
|
+
runtimeAssetRequiringExecutionOnLoad?: boolean;
|
|
431
432
|
code?: string;
|
|
432
433
|
pipeline?: string | null | undefined;
|
|
433
434
|
optionsRef: SharedReference;
|