@atlaspack/runtime-js 2.12.1-dev.3443 → 2.12.1-dev.3478

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/runtime-js",
3
- "version": "2.12.1-dev.3443+d1170cfc7",
3
+ "version": "2.12.1-dev.3478+5fd2da535",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -13,14 +13,14 @@
13
13
  "source": "src/JSRuntime.js",
14
14
  "engines": {
15
15
  "node": ">= 16.0.0",
16
- "parcel": "^2.12.1-dev.3443+d1170cfc7"
16
+ "parcel": "^2.12.1-dev.3478+5fd2da535"
17
17
  },
18
18
  "dependencies": {
19
- "@atlaspack/diagnostic": "2.12.1-dev.3443+d1170cfc7",
20
- "@atlaspack/feature-flags": "2.12.1-dev.3443+d1170cfc7",
21
- "@atlaspack/plugin": "2.12.1-dev.3443+d1170cfc7",
22
- "@atlaspack/utils": "2.12.1-dev.3443+d1170cfc7",
19
+ "@atlaspack/diagnostic": "2.12.1-dev.3478+5fd2da535",
20
+ "@atlaspack/feature-flags": "2.12.1-dev.3478+5fd2da535",
21
+ "@atlaspack/plugin": "2.12.1-dev.3478+5fd2da535",
22
+ "@atlaspack/utils": "2.12.1-dev.3478+5fd2da535",
23
23
  "nullthrows": "^1.1.1"
24
24
  },
25
- "gitHead": "d1170cfc79beb290b2a066f472f68f71f7d7cb23"
25
+ "gitHead": "5fd2da535ecbe096d57e03aec15e80bb1d7601f7"
26
26
  }
package/src/JSRuntime.js CHANGED
@@ -254,9 +254,9 @@ export default (new Runtime({
254
254
 
255
255
  let bundleGroup = resolved.value;
256
256
  let mainBundle = nullthrows(
257
- bundleGraph.getBundlesInBundleGroup(bundleGroup).find(b => {
257
+ bundleGraph.getBundlesInBundleGroup(bundleGroup).find((b) => {
258
258
  let entries = b.getEntryAssets();
259
- return entries.some(e => bundleGroup.entryAssetId === e.id);
259
+ return entries.some((e) => bundleGroup.entryAssetId === e.id);
260
260
  }),
261
261
  );
262
262
 
@@ -307,7 +307,7 @@ export default (new Runtime({
307
307
  shouldUseRuntimeManifest(bundle, options) &&
308
308
  bundleGraph
309
309
  .getChildBundles(bundle)
310
- .some(b => b.bundleBehavior !== 'inline') &&
310
+ .some((b) => b.bundleBehavior !== 'inline') &&
311
311
  isNewContext(bundle, bundleGraph)
312
312
  ) {
313
313
  assets.push({
@@ -340,7 +340,7 @@ function getDependencies(bundle: NamedBundle): {|
340
340
  let asyncDependencies = [];
341
341
  let otherDependencies = [];
342
342
  let conditionalDependencies = [];
343
- bundle.traverse(node => {
343
+ bundle.traverse((node) => {
344
344
  if (node.type !== 'dependency') {
345
345
  return;
346
346
  }
@@ -387,7 +387,7 @@ function getLoaderRuntime({
387
387
  let externalBundles = bundleGraph.getBundlesInBundleGroup(bundleGroup);
388
388
  let mainBundle = nullthrows(
389
389
  externalBundles.find(
390
- bundle => bundle.getMainEntry()?.id === bundleGroup.entryAssetId,
390
+ (bundle) => bundle.getMainEntry()?.id === bundleGroup.entryAssetId,
391
391
  ),
392
392
  );
393
393
 
@@ -472,7 +472,7 @@ function getLoaderRuntime({
472
472
 
473
473
  if (getFeatureFlag('conditionalBundlingApi')) {
474
474
  let conditionalDependencies = externalBundles.flatMap(
475
- to => getDependencies(to).conditionalDependencies,
475
+ (to) => getDependencies(to).conditionalDependencies,
476
476
  );
477
477
  for (const cond of bundleGraph.getConditionsForDependencies(
478
478
  conditionalDependencies,
@@ -511,8 +511,8 @@ function getLoaderRuntime({
511
511
  loaderModules.push(
512
512
  ...externalBundles
513
513
  // TODO: Allow css to preload resources as well
514
- .filter(to => to.type === 'js')
515
- .flatMap(from => {
514
+ .filter((to) => to.type === 'js')
515
+ .flatMap((from) => {
516
516
  let {preload, prefetch} = getHintedBundleGroups(bundleGraph, from);
517
517
 
518
518
  return [
@@ -660,12 +660,12 @@ function isNewContext(
660
660
  let parents = bundleGraph.getParentBundles(bundle);
661
661
  let isInEntryBundleGroup = bundleGraph
662
662
  .getBundleGroupsContainingBundle(bundle)
663
- .some(g => bundleGraph.isEntryBundleGroup(g));
663
+ .some((g) => bundleGraph.isEntryBundleGroup(g));
664
664
  return (
665
665
  isInEntryBundleGroup ||
666
666
  parents.length === 0 ||
667
667
  parents.some(
668
- parent =>
668
+ (parent) =>
669
669
  parent.env.context !== bundle.env.context || parent.type !== 'js',
670
670
  )
671
671
  );
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "presets": [
3
- ["@babel/preset-env", {
4
- "targets": {
5
- "ie": 11
3
+ [
4
+ "@babel/preset-env",
5
+ {
6
+ "targets": {
7
+ "ie": 11
8
+ }
6
9
  }
7
- }]
10
+ ]
8
11
  ]
9
12
  }
@@ -4,7 +4,7 @@ async function load(id) {
4
4
  }
5
5
 
6
6
  if (!globalThis.navigator.onLine) {
7
- await new Promise(res =>
7
+ await new Promise((res) =>
8
8
  globalThis.addEventListener('online', res, {once: true}),
9
9
  );
10
10
  }
@@ -4,7 +4,7 @@ module.exports = cacheLoader(function importModule(bundle) {
4
4
  return new Promise((resolve, reject) => {
5
5
  // Add a global function to handle when the script loads.
6
6
  let globalName = `i${('' + Math.random()).slice(2)}`;
7
- global[globalName] = m => {
7
+ global[globalName] = (m) => {
8
8
  resolve(m);
9
9
  cleanup();
10
10
  };