importmap-rails 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/es-module-shims.js +9 -21
- data/lib/importmap/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6bef1930a7817f62361604877196991706c6dd6ac589d41fb615bb3cd21cdb6
|
4
|
+
data.tar.gz: 7cd5da364f95e8ea04104e57d22c42e9fe1351451a51d22fa1247456dda6fa10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3e7e6e12f99afc8d69756142f5c1fa8945d541489d5950cdf36adeb8b7f6dcf5c8b7924b64b8a4d003bcef16bf2522fb435da54b3c74afdd4d2db88c838c54e
|
7
|
+
data.tar.gz: b8c8b2ab0472abb4c7eac50ad4c2a858d4210939438e095b367608323ae72b08e514075e12846282020ae98f1664d61e2e826c214441d442cecfda9b6c10b765
|
@@ -1,8 +1,6 @@
|
|
1
|
-
/* ES Module Shims
|
1
|
+
/* ES Module Shims 1.0.0 */
|
2
2
|
(function () {
|
3
3
|
|
4
|
-
Promise.resolve();
|
5
|
-
|
6
4
|
const edge = navigator.userAgent.match(/Edge\/\d\d\.\d+$/);
|
7
5
|
|
8
6
|
let baseUrl;
|
@@ -331,7 +329,7 @@
|
|
331
329
|
|
332
330
|
let importMap = { imports: {}, scopes: {} };
|
333
331
|
let importMapSrcOrLazy = false;
|
334
|
-
let importMapPromise = featureDetectionPromise;
|
332
|
+
let importMapPromise = featureDetectionPromise.then(() => undefined);
|
335
333
|
|
336
334
|
let acceptingImportMaps = true;
|
337
335
|
let nativeAcceptingImportMaps = true;
|
@@ -346,21 +344,20 @@
|
|
346
344
|
}
|
347
345
|
await importMapPromise;
|
348
346
|
// early analysis opt-out - no need to even fetch if we have feature support
|
349
|
-
if (!shimMode && supportsDynamicImport && supportsImportMeta && supportsImportMaps && (!jsonModulesEnabled || supportsJsonAssertions) && (!cssModulesEnabled || supportsCssAssertions) && !importMapSrcOrLazy) {
|
347
|
+
if (!shimMode && supportsDynamicImport && supportsImportMeta && supportsImportMaps && (!jsonModulesEnabled || supportsJsonAssertions) && (!cssModulesEnabled || supportsCssAssertions) && !importMapSrcOrLazy && !false) {
|
350
348
|
// for polyfill case, only dynamic import needs a return value here, and dynamic import will never pass nativelyLoaded
|
351
349
|
if (nativelyLoaded)
|
352
350
|
return null;
|
353
351
|
await lastStaticLoadPromise;
|
354
352
|
return dynamicImport(source ? createBlob(source) : url, { errUrl: url || source });
|
355
353
|
}
|
356
|
-
await undefined;
|
357
354
|
const load = getOrCreateLoad(url, fetchOpts, source);
|
358
355
|
const seen = {};
|
359
356
|
await loadAll(load, seen);
|
360
357
|
lastLoad = undefined;
|
361
358
|
resolveDeps(load, seen);
|
362
359
|
await lastStaticLoadPromise;
|
363
|
-
if (source && !shimMode && !load.n) {
|
360
|
+
if (source && !shimMode && !load.n && !false) {
|
364
361
|
const module = await dynamicImport(createBlob(source), { errUrl: source });
|
365
362
|
if (revokeBlobURLs) revokeObjectURLs(Object.keys(seen));
|
366
363
|
return module;
|
@@ -490,17 +487,11 @@
|
|
490
487
|
resolvedSource += source.slice(lastIndex);
|
491
488
|
}
|
492
489
|
|
493
|
-
resolvedSource = resolvedSource.replace(/\/\/# sourceMappingURL=(.*)\s*$/, (match, url) =>
|
494
|
-
return match.replace(url, new URL(url, load.r));
|
495
|
-
});
|
490
|
+
resolvedSource = resolvedSource.replace(/\/\/# sourceMappingURL=(.*)\s*$/, (match, url) => match.replace(url, () => new URL(url, load.r)));
|
496
491
|
let hasSourceURL = false;
|
497
|
-
resolvedSource = resolvedSource.replace(/\/\/# sourceURL=(.*)\s*$/, (match, url) =>
|
498
|
-
|
499
|
-
return match.replace(url, new URL(url, load.r));
|
500
|
-
});
|
501
|
-
if (!hasSourceURL) {
|
492
|
+
resolvedSource = resolvedSource.replace(/\/\/# sourceURL=(.*)\s*$/, (match, url) => (hasSourceURL = true, match.replace(url, () => new URL(url, load.r))));
|
493
|
+
if (!hasSourceURL)
|
502
494
|
resolvedSource += '\n//# sourceURL=' + load.r;
|
503
|
-
}
|
504
495
|
|
505
496
|
load.b = lastLoad = createBlob(resolvedSource);
|
506
497
|
load.S = undefined;
|
@@ -627,13 +618,10 @@
|
|
627
618
|
return load;
|
628
619
|
}
|
629
620
|
|
630
|
-
const scriptQuery = 'script[type="module-shim"],script[type="importmap-shim"],script[type="module"],script[type="importmap"]';
|
631
|
-
const preloadQuery = 'link[rel="modulepreload"]';
|
632
|
-
|
633
621
|
function processScripts () {
|
634
|
-
for (const link of document.querySelectorAll(
|
622
|
+
for (const link of document.querySelectorAll('link[rel="modulepreload"]'))
|
635
623
|
processPreload(link);
|
636
|
-
const scripts = document.querySelectorAll(
|
624
|
+
const scripts = document.querySelectorAll('script[type="module-shim"],script[type="importmap-shim"],script[type="module"],script[type="importmap"]');
|
637
625
|
// early shim mode opt-in
|
638
626
|
if (!shimMode) {
|
639
627
|
for (const script of scripts) {
|
data/lib/importmap/version.rb
CHANGED