es-module-shims 1.4.1 → 1.4.2
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/CHANGELOG.md +3 -0
- package/README.md +3 -3
- package/dist/es-module-shims.js +4 -3
- package/dist/es-module-shims.wasm.js +4 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
ES Module Shims 1.4.2 (2022/01/24)
|
|
2
|
+
* Fix: optional catch binding in `isUrl` function (@thepassle, https://github.com/guybedford/es-module-shims/pull/246)
|
|
3
|
+
|
|
1
4
|
ES Module Shims 1.4.1 (2021/12/15)
|
|
2
5
|
* Fix: Firefox parse error stacks (https://github.com/guybedford/es-module-shims/pull/239)
|
|
3
6
|
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Shims modern ES Modules features like import maps on top of the baseline modules
|
|
|
4
4
|
|
|
5
5
|
When running in polyfill mode, [the 67% of users](https://caniuse.com/import-maps) with import maps entirely bypass the shim code entirely.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
For the remaining 30% of users, the highly performant (see [benchmarks](#benchmarks)) production and [CSP-compatible](#csp-support) shim kicks in to rewrite module specifiers driven by the [Web Assembly ES Module Lexer](https://github.com/guybedford/es-module-lexer).
|
|
8
8
|
|
|
9
9
|
The following modules features are polyfilled:
|
|
10
10
|
|
|
@@ -27,7 +27,7 @@ Because we are still using the native module loader the edge cases work out comp
|
|
|
27
27
|
Include ES Module Shims with a `async` attribute on the script, then include an import map and module scripts normally:
|
|
28
28
|
|
|
29
29
|
```html
|
|
30
|
-
<script async src="https://ga.jspm.io/npm:es-module-shims@1.
|
|
30
|
+
<script async src="https://ga.jspm.io/npm:es-module-shims@1.4.2/dist/es-module-shims.js"></script>
|
|
31
31
|
|
|
32
32
|
<!-- https://generator.jspm.io/#U2NhYGBkDM0rySzJSU1hKEpNTC5xMLTQM9Az0C1K1jMAAKFS5w0gAA -->
|
|
33
33
|
<script type="importmap">
|
|
@@ -431,7 +431,7 @@ window.esmsInitOptions = {
|
|
|
431
431
|
resolve: (id, parentUrl, resolve) => resolve(id, parentUrl), // default is spec resolution
|
|
432
432
|
fetch: (url, options) => fetch(url, options), // default is native
|
|
433
433
|
revokeBlobURLs: true, // default false
|
|
434
|
-
enforceIntegrity: true, // default
|
|
434
|
+
enforceIntegrity: true, // default false
|
|
435
435
|
}
|
|
436
436
|
</script>
|
|
437
437
|
<script async src="es-module-shims.js"></script>
|
package/dist/es-module-shims.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ES Module Shims 1.4.
|
|
1
|
+
/* ES Module Shims 1.4.2 */
|
|
2
2
|
(function () {
|
|
3
3
|
|
|
4
4
|
const uaMatch = navigator.userAgent.match(/(Edge|Safari)\/\d+\.\d+/);
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
new URL(url);
|
|
30
30
|
return true;
|
|
31
31
|
}
|
|
32
|
-
catch {
|
|
32
|
+
catch(_) {
|
|
33
33
|
return false;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -531,7 +531,6 @@
|
|
|
531
531
|
resolvedSource += source.slice(lastIndex);
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
-
// ; and // trailer support added for Ruby 7 source maps compatibility
|
|
535
534
|
let hasSourceURL = false;
|
|
536
535
|
resolvedSource = resolvedSource.replace(sourceMapURLRegEx, (match, isMapping, url) => (hasSourceURL = !isMapping, match.replace(url, () => new URL(url, load.r))));
|
|
537
536
|
if (!hasSourceURL)
|
|
@@ -541,6 +540,8 @@
|
|
|
541
540
|
load.S = undefined;
|
|
542
541
|
}
|
|
543
542
|
|
|
543
|
+
// ; and // trailer support added for Ruby on Rails 7 source maps compatibility
|
|
544
|
+
// https://github.com/guybedford/es-module-shims/issues/228
|
|
544
545
|
const sourceMapURLRegEx = /\n\/\/# source(Mapping)?URL=([^\n]+)\s*((;|\/\/[^#][^\n]*)\s*)*$/;
|
|
545
546
|
|
|
546
547
|
const jsContentType = /^(text|application)\/(x-)?javascript(;|$)/;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* ES Module Shims Wasm 1.4.
|
|
1
|
+
/* ES Module Shims Wasm 1.4.2 */
|
|
2
2
|
(function () {
|
|
3
3
|
|
|
4
4
|
const uaMatch = navigator.userAgent.match(/(Edge|Safari)\/\d+\.\d+/);
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
new URL(url);
|
|
30
30
|
return true;
|
|
31
31
|
}
|
|
32
|
-
catch {
|
|
32
|
+
catch(_) {
|
|
33
33
|
return false;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -529,7 +529,6 @@
|
|
|
529
529
|
resolvedSource += source.slice(lastIndex);
|
|
530
530
|
}
|
|
531
531
|
|
|
532
|
-
// ; and // trailer support added for Ruby 7 source maps compatibility
|
|
533
532
|
let hasSourceURL = false;
|
|
534
533
|
resolvedSource = resolvedSource.replace(sourceMapURLRegEx, (match, isMapping, url) => (hasSourceURL = !isMapping, match.replace(url, () => new URL(url, load.r))));
|
|
535
534
|
if (!hasSourceURL)
|
|
@@ -539,6 +538,8 @@
|
|
|
539
538
|
load.S = undefined;
|
|
540
539
|
}
|
|
541
540
|
|
|
541
|
+
// ; and // trailer support added for Ruby on Rails 7 source maps compatibility
|
|
542
|
+
// https://github.com/guybedford/es-module-shims/issues/228
|
|
542
543
|
const sourceMapURLRegEx = /\n\/\/# source(Mapping)?URL=([^\n]+)\s*((;|\/\/[^#][^\n]*)\s*)*$/;
|
|
543
544
|
|
|
544
545
|
const jsContentType = /^(text|application)\/(x-)?javascript(;|$)/;
|