es-module-shims 2.0.2 → 2.0.3
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/README.md +6 -6
- package/dist/es-module-shims.debug.js +388 -445
- package/dist/es-module-shims.js +374 -436
- package/dist/es-module-shims.wasm.js +374 -436
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Polyfills import maps and other ES Modules features on top of the baseline native ESM support in browsers.
|
|
4
4
|
|
|
5
|
-
With import maps now supported by all major browsers, ES Module Shims entirely bypasses processing for the [
|
|
5
|
+
With import maps now supported by all major browsers, ES Module Shims entirely bypasses processing for the [94% of users](https://caniuse.com/import-maps) with native import maps support.
|
|
6
6
|
|
|
7
|
-
For the remaining 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).
|
|
7
|
+
For the remaining ~4% 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@2.0.
|
|
30
|
+
<script async src="https://ga.jspm.io/npm:es-module-shims@2.0.3/dist/es-module-shims.js"></script>
|
|
31
31
|
|
|
32
32
|
<!-- https://generator.jspm.io/#U2NhYGBkDM0rySzJSU1hKEpNTC5xMLTQM9Az0C1K1jMAAKFS5w0gAA -->
|
|
33
33
|
<script type="importmap">
|
|
@@ -210,8 +210,8 @@ ES Module Shims is designed for production performance. A [comprehensive benchma
|
|
|
210
210
|
|
|
211
211
|
Benchmark summary:
|
|
212
212
|
|
|
213
|
-
* [ES Module Shims Chrome Passthrough](bench/README.md#chrome-passthrough-performance) (for [
|
|
214
|
-
* [ES Module Shims Polyfilling](bench/README.md#native-v-polyfill-performance) (for the remaining [
|
|
213
|
+
* [ES Module Shims Chrome Passthrough](bench/README.md#chrome-passthrough-performance) (for [94% of users](https://caniuse.com/import-maps)) results in ~5ms extra initialization time over native for ES Module Shims fetching, execution and initialization, and on a slow connection the additional non-blocking bandwidth cost of its 10KB compressed download as expected.
|
|
214
|
+
* [ES Module Shims Polyfilling](bench/README.md#native-v-polyfill-performance) (for the remaining [3% of users](https://caniuse.com/import-maps)) is on average 1.4x - 1.5x slower than native module loading, and up to 1.8x slower on slow networks (most likely due to the browser preloader), both for cached and uncached loads, and this result scales linearly up to 10MB and 20k modules loaded executing on the fastest connection in just over 2 seconds in Firefox.
|
|
215
215
|
* [Very large import maps](bench/README.md#large-import-maps-performance) (100s of entries) cost only a few extra milliseconds upfront for the additional loading cost.
|
|
216
216
|
|
|
217
217
|
## Features
|
|
@@ -222,7 +222,7 @@ Works in all browsers with [baseline ES module support](https://caniuse.com/#fea
|
|
|
222
222
|
|
|
223
223
|
Browser Compatibility on baseline ES modules support **with** ES Module Shims:
|
|
224
224
|
|
|
225
|
-
| ES Modules Features | Chrome (
|
|
225
|
+
| ES Modules Features | Chrome (63+) | Firefox (67+) | Safari (11.1+) |
|
|
226
226
|
| ----------------------------------------------- | ------------------------------------ | ------------------------------------ | ------------------------------------ |
|
|
227
227
|
| [modulepreload](#modulepreload) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
|
228
228
|
| [Import Maps](#import-maps) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|