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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9e6300f655cdfdea924109ea99b791260794041dc3602d7b0a3b64d31be98ed
4
- data.tar.gz: 764cb26507d540bd42c796a8c34f30c1bd632ff8e6d0edae1295c84c19db1c78
3
+ metadata.gz: a6bef1930a7817f62361604877196991706c6dd6ac589d41fb615bb3cd21cdb6
4
+ data.tar.gz: 7cd5da364f95e8ea04104e57d22c42e9fe1351451a51d22fa1247456dda6fa10
5
5
  SHA512:
6
- metadata.gz: 83d0560169e2dd9248197c90abe92734eeebeacd7e3f9db1fb530f228a0bfbfb7c02081a566911f219fddcc3732cf9e49dfcf7a18308035841291d9f703062b2
7
- data.tar.gz: 1fbab54d8cb85d1e57d696d327b3ec4231a1d197840c7ecd7697bad15ca95168a9b5f2572c066d408773c1b7dddb16c0d062119567355d2d7ac8b07828f2ebdb
6
+ metadata.gz: e3e7e6e12f99afc8d69756142f5c1fa8945d541489d5950cdf36adeb8b7f6dcf5c8b7924b64b8a4d003bcef16bf2522fb435da54b3c74afdd4d2db88c838c54e
7
+ data.tar.gz: b8c8b2ab0472abb4c7eac50ad4c2a858d4210939438e095b367608323ae72b08e514075e12846282020ae98f1664d61e2e826c214441d442cecfda9b6c10b765
@@ -1,8 +1,6 @@
1
- /* ES Module Shims CSP 0.15.1 */
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
- hasSourceURL = true;
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(preloadQuery))
622
+ for (const link of document.querySelectorAll('link[rel="modulepreload"]'))
635
623
  processPreload(link);
636
- const scripts = document.querySelectorAll(scriptQuery);
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) {
@@ -1,3 +1,3 @@
1
1
  module Importmap
2
- VERSION = "0.7.2"
2
+ VERSION = "0.7.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: importmap-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson