@atlaspack/runtime-js 2.14.5-canary.122 → 2.14.5-canary.124
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/JSRuntime.js +2 -15
- package/package.json +7 -7
- package/src/JSRuntime.js +6 -39
package/lib/JSRuntime.js
CHANGED
|
@@ -446,21 +446,8 @@ function getLoaderRuntime({
|
|
|
446
446
|
return loaders;
|
|
447
447
|
}
|
|
448
448
|
if ((0, _featureFlags().getFeatureFlag)('conditionalBundlingApi')) {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
loaderModules.push(...getConditionalLoadersForCondition(conditionalDependencies, bundle));
|
|
452
|
-
} else {
|
|
453
|
-
let conditionalDependencies = externalBundles.flatMap(to => getDependencies(to).conditionalDependencies);
|
|
454
|
-
for (const cond of bundleGraph.getConditionsForDependencies(conditionalDependencies, bundle)) {
|
|
455
|
-
// This bundle has a conditional dependency, we need to load the bundle group
|
|
456
|
-
const ifTrueLoaders = cond.ifTrueBundles.map(targetBundle => getLoaderForBundle(bundle, targetBundle));
|
|
457
|
-
const ifFalseLoaders = cond.ifFalseBundles.map(targetBundle => getLoaderForBundle(bundle, targetBundle));
|
|
458
|
-
if (ifTrueLoaders.length > 0 || ifFalseLoaders.length > 0) {
|
|
459
|
-
// Load conditional bundles with helper (and a dev mode with additional hints)
|
|
460
|
-
loaderModules.push(`require('./helpers/conditional-loader${options.mode === 'development' ? '-dev' : ''}')('${cond.key}', function (){return Promise.all([${ifTrueLoaders.join(',')}]);}, function (){return Promise.all([${ifFalseLoaders.join(',')}]);})`);
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
}
|
|
449
|
+
let conditionalDependencies = externalBundles.flatMap(to => getDependencies(to).conditionalDependencies);
|
|
450
|
+
loaderModules.push(...getConditionalLoadersForCondition(conditionalDependencies, bundle));
|
|
464
451
|
}
|
|
465
452
|
for (let to of externalBundles) {
|
|
466
453
|
let loaderModule = getLoaderForBundle(bundle, to, shardingConfig);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/runtime-js",
|
|
3
|
-
"version": "2.14.5-canary.
|
|
3
|
+
"version": "2.14.5-canary.124+c4415a455",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"node": ">= 16.0.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@atlaspack/diagnostic": "2.14.1-canary.
|
|
19
|
-
"@atlaspack/domain-sharding": "2.14.1-canary.
|
|
20
|
-
"@atlaspack/feature-flags": "2.14.1-canary.
|
|
21
|
-
"@atlaspack/plugin": "2.14.5-canary.
|
|
22
|
-
"@atlaspack/utils": "2.14.5-canary.
|
|
18
|
+
"@atlaspack/diagnostic": "2.14.1-canary.192+c4415a455",
|
|
19
|
+
"@atlaspack/domain-sharding": "2.14.1-canary.192+c4415a455",
|
|
20
|
+
"@atlaspack/feature-flags": "2.14.1-canary.192+c4415a455",
|
|
21
|
+
"@atlaspack/plugin": "2.14.5-canary.124+c4415a455",
|
|
22
|
+
"@atlaspack/utils": "2.14.5-canary.124+c4415a455",
|
|
23
23
|
"nullthrows": "^1.1.1"
|
|
24
24
|
},
|
|
25
25
|
"type": "commonjs",
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "c4415a455543d984ca28452c2cb87a794d22497c"
|
|
27
27
|
}
|
package/src/JSRuntime.js
CHANGED
|
@@ -583,46 +583,13 @@ function getLoaderRuntime({
|
|
|
583
583
|
}
|
|
584
584
|
|
|
585
585
|
if (getFeatureFlag('conditionalBundlingApi')) {
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
);
|
|
590
|
-
|
|
591
|
-
loaderModules.push(
|
|
592
|
-
...getConditionalLoadersForCondition(conditionalDependencies, bundle),
|
|
593
|
-
);
|
|
594
|
-
} else {
|
|
595
|
-
let conditionalDependencies = externalBundles.flatMap(
|
|
596
|
-
(to) => getDependencies(to).conditionalDependencies,
|
|
597
|
-
);
|
|
598
|
-
for (const cond of bundleGraph.getConditionsForDependencies(
|
|
599
|
-
conditionalDependencies,
|
|
600
|
-
bundle,
|
|
601
|
-
)) {
|
|
602
|
-
// This bundle has a conditional dependency, we need to load the bundle group
|
|
603
|
-
const ifTrueLoaders = cond.ifTrueBundles.map((targetBundle) =>
|
|
604
|
-
getLoaderForBundle(bundle, targetBundle),
|
|
605
|
-
);
|
|
606
|
-
const ifFalseLoaders = cond.ifFalseBundles.map((targetBundle) =>
|
|
607
|
-
getLoaderForBundle(bundle, targetBundle),
|
|
608
|
-
);
|
|
586
|
+
let conditionalDependencies = externalBundles.flatMap(
|
|
587
|
+
(to) => getDependencies(to).conditionalDependencies,
|
|
588
|
+
);
|
|
609
589
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
`require('./helpers/conditional-loader${
|
|
614
|
-
options.mode === 'development' ? '-dev' : ''
|
|
615
|
-
}')('${
|
|
616
|
-
cond.key
|
|
617
|
-
}', function (){return Promise.all([${ifTrueLoaders.join(
|
|
618
|
-
',',
|
|
619
|
-
)}]);}, function (){return Promise.all([${ifFalseLoaders.join(
|
|
620
|
-
',',
|
|
621
|
-
)}]);})`,
|
|
622
|
-
);
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
}
|
|
590
|
+
loaderModules.push(
|
|
591
|
+
...getConditionalLoadersForCondition(conditionalDependencies, bundle),
|
|
592
|
+
);
|
|
626
593
|
}
|
|
627
594
|
|
|
628
595
|
for (let to of externalBundles) {
|