@atlaspack/runtime-js 2.14.16-dev-eae8c193d.0 → 2.14.16-typescript-de860656a.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.
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
 
3
3
  const cacheLoader = require('../cacheLoader');
4
- module.exports = cacheLoader(function (bundle) {
4
+ module.exports = cacheLoader(function loadCSSBundle(bundle) {
5
5
  return new Promise(function (resolve, reject) {
6
6
  // Don't insert the same link element twice (e.g. if it was already in the HTML)
7
7
  let existingLinks = document.getElementsByTagName('link');
8
- if ([].concat(existingLinks).some(function (link) {
8
+ let isCurrentBundle = function (link) {
9
9
  return link.href === bundle && link.rel.indexOf('stylesheet') > -1;
10
- })) {
10
+ };
11
+ if ([].concat(existingLinks).some(isCurrentBundle)) {
11
12
  resolve();
12
13
  return;
13
14
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  const cacheLoader = require('../cacheLoader');
4
- module.exports = cacheLoader(function (bundle) {
4
+ module.exports = cacheLoader(function loadHTMLBundle(bundle) {
5
5
  return fetch(bundle).then(function (res) {
6
6
  return res.text();
7
7
  });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  const cacheLoader = require('../cacheLoader');
4
- module.exports = cacheLoader(function (bundle) {
4
+ module.exports = cacheLoader(function importModule(bundle) {
5
5
  return new Promise((resolve, reject) => {
6
6
  // Add a global function to handle when the script loads.
7
7
  let globalName = `i${('' + Math.random()).slice(2)}`;
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
 
3
3
  const cacheLoader = require('../cacheLoader');
4
- module.exports = cacheLoader(function (bundle) {
4
+ module.exports = cacheLoader(function loadJSBundle(bundle) {
5
5
  return new Promise(function (resolve, reject) {
6
6
  // Don't insert the same script twice (e.g. if it was already in the HTML)
7
7
  let existingScripts = document.getElementsByTagName('script');
8
- if ([].concat(existingScripts).some(function (script) {
8
+ let isCurrentBundle = function (script) {
9
9
  return script.src === bundle;
10
- })) {
10
+ };
11
+ if ([].concat(existingScripts).some(isCurrentBundle)) {
11
12
  resolve();
12
13
  return;
13
14
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  const cacheLoader = require('../cacheLoader');
4
- module.exports = cacheLoader(function (bundle, priority) {
4
+ module.exports = cacheLoader(function prefetchJSBundle(bundle, priority) {
5
5
  var link = document.createElement('link');
6
6
  link.rel = 'prefetch';
7
7
  link.href = bundle;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  const cacheLoader = require('../cacheLoader');
4
- module.exports = cacheLoader(function (bundle, priority, isModule) {
4
+ module.exports = cacheLoader(function preloadJSBundle(bundle, priority, isModule) {
5
5
  var link = document.createElement('link');
6
6
  link.charset = 'utf-8';
7
7
  link.rel = isModule ? 'modulepreload' : 'preload';
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  const cacheLoader = require('../cacheLoader');
4
- module.exports = cacheLoader(function (bundle) {
4
+ module.exports = cacheLoader(function loadWASMBundle(bundle) {
5
5
  return fetch(bundle).then(function (res) {
6
6
  if (WebAssembly.instantiateStreaming) {
7
7
  return WebAssembly.instantiateStreaming(res);
@@ -13,7 +13,7 @@ function getCache(type) {
13
13
  return cachedBundles;
14
14
  }
15
15
  }
16
- module.exports = function (loader, type) {
16
+ module.exports = function cacheLoader(loader, type) {
17
17
  return function (bundle) {
18
18
  let cache = getCache(type);
19
19
  if (cache[bundle]) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- module.exports = function (cond, ifTrue, ifFalse) {
3
+ module.exports = function loadCond(cond, ifTrue, ifFalse) {
4
4
  if (typeof globalThis.__MCOND !== 'function') {
5
5
  throw new TypeError('"globalThis.__MCOND" was not set to an object. Ensure the function is set to return the key condition for conditional bundles to load with.');
6
6
  }
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
 
3
- module.exports = function (cond, ifTrue, ifFalse) {
3
+ module.exports = function loadCond(cond, ifTrue, ifFalse) {
4
4
  return globalThis.__MCOND && globalThis.__MCOND(cond) ? ifTrue() : ifFalse();
5
5
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- module.exports = function (workerUrl, origin, isESM) {
3
+ module.exports = function loadWorker(workerUrl, origin, isESM) {
4
4
  if (origin === self.location.origin) {
5
5
  // If the worker bundle's url is on the same origin as the document,
6
6
  // use the worker bundle's own url.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  // loading a CSS style is a no-op in Node.js
4
- module.exports = function () {
4
+ module.exports = function loadCSSBundle() {
5
5
  return Promise.resolve();
6
6
  };
@@ -2,7 +2,7 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const cacheLoader = require('../cacheLoader');
5
- module.exports = cacheLoader(function (bundle) {
5
+ module.exports = cacheLoader(function loadHTMLBundle(bundle) {
6
6
  return new Promise(function (resolve, reject) {
7
7
  fs.readFile(__dirname + bundle, 'utf8', function (err, data) {
8
8
  if (err) {
@@ -2,7 +2,7 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const cacheLoader = require('../cacheLoader');
5
- module.exports = cacheLoader(function (bundle) {
5
+ module.exports = cacheLoader(function loadJSBundle(bundle) {
6
6
  return new Promise(function (resolve, reject) {
7
7
  fs.readFile(__dirname + bundle, 'utf8', function (err, data) {
8
8
  if (err) {
@@ -2,7 +2,7 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const cacheLoader = require('../cacheLoader');
5
- module.exports = cacheLoader(function (bundle) {
5
+ module.exports = cacheLoader(function loadWASMBundle(bundle) {
6
6
  return new Promise(function (resolve, reject) {
7
7
  fs.readFile(__dirname + bundle, function (err, data) {
8
8
  if (err) {
@@ -2,7 +2,7 @@
2
2
 
3
3
  /* global __parcel__importScripts__:readonly*/
4
4
  const cacheLoader = require('../cacheLoader');
5
- module.exports = cacheLoader(function (bundle) {
5
+ module.exports = cacheLoader(function loadJSBundle(bundle) {
6
6
  return new Promise(function (resolve, reject) {
7
7
  try {
8
8
  __parcel__importScripts__(bundle);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  const cacheLoader = require('../cacheLoader');
4
- module.exports = cacheLoader(function (bundle) {
4
+ module.exports = cacheLoader(function loadWASMBundle(bundle) {
5
5
  return fetch(bundle).then(function (res) {
6
6
  if (WebAssembly.instantiateStreaming) {
7
7
  return WebAssembly.instantiateStreaming(res);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/runtime-js",
3
- "version": "2.14.16-dev-eae8c193d.0",
3
+ "version": "2.14.16-typescript-de860656a.0",
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.2-dev-eae8c193d.0",
19
- "@atlaspack/domain-sharding": "2.14.2-dev-eae8c193d.0",
20
- "@atlaspack/feature-flags": "2.18.4-dev-eae8c193d.0",
21
- "@atlaspack/plugin": "2.14.16-dev-eae8c193d.0",
22
- "@atlaspack/utils": "2.15.4-dev-eae8c193d.0",
18
+ "@atlaspack/diagnostic": "2.14.2-typescript-de860656a.0",
19
+ "@atlaspack/domain-sharding": "2.14.2-typescript-de860656a.0",
20
+ "@atlaspack/feature-flags": "2.18.4-typescript-de860656a.0",
21
+ "@atlaspack/plugin": "2.14.16-typescript-de860656a.0",
22
+ "@atlaspack/utils": "2.15.4-typescript-de860656a.0",
23
23
  "nullthrows": "^1.1.1"
24
24
  },
25
25
  "type": "commonjs",
26
- "gitHead": "eae8c193d1b12309f6377859a2da6a352b329f3d"
26
+ "gitHead": "de860656a3c821c6f8043b05fa7699289992edbb"
27
27
  }