Skip to content

Commit

Permalink
1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Mar 28, 2023
1 parent b24550d commit 4d47205
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# ES Module Shims

Shims modern ES Modules features like import maps on top of the baseline modules support in browsers supported by [95% of users](https://caniuse.com/#feat=es6-module).
Polyfills import maps and other ES Modules features on top of the baseline native ESM support in browsers.

When running in polyfill mode, [the 72% of users](https://caniuse.com/import-maps) with import maps bypass the shim code entirely.
With import maps now supported by all major browsers, ES Module Shims entirely bypasses processing for the [74% of users](https://caniuse.com/import-maps) with native import maps support.

For the remaining 28% 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).
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).

The following modules features are polyfilled:

* [Import Maps](#import-maps) polyfill.
* Dynamic `import()` shimming when necessary in eg older Firefox versions.
* `import.meta` and `import.meta.url`.
* [JSON](#json-modules) and [CSS modules](#css-modules) with import assertions (when enabled).
* [`<link rel="modulepreload">` polyfill](#modulepreload) in non Chromium browsers for both shimmed and unshimmed preloading scenarios.
* [`<link rel="modulepreload">` is shimmed](#modulepreload) in browsers without import maps support.

When running in shim mode, module rewriting is applied for all users and custom [resolve](#resolve-hook) and [fetch](#fetch-hook) hooks can be implemented allowing for custom resolution and streaming in-browser transform workflows.

Expand All @@ -29,7 +29,7 @@ Because we are still using the native module loader the edge cases work out comp
Include ES Module Shims with a `async` attribute on the script, then include an import map and module scripts normally:

```html
<script async src="https://ga.jspm.io/npm:es-module-shims@1.7.0/dist/es-module-shims.js"></script>
<script async src="https://ga.jspm.io/npm:es-module-shims@1.7.1/dist/es-module-shims.js"></script>

<!-- https://generator.jspm.io/#U2NhYGBkDM0rySzJSU1hKEpNTC5xMLTQM9Az0C1K1jMAAKFS5w0gAA -->
<script type="importmap">
Expand Down Expand Up @@ -237,7 +237,7 @@ Browser compatibility **without** ES Module Shims:
| [modulepreload](#modulepreload) | 66+ | :x: | :x: |
| [Dynamic Import](#dynamic-import) | 63+ | 67+ | 11.1+ |
| [import.meta.url](#importmetaurl) | ~76+ | ~67+ | ~12+ ❕<sup>1</sup> |
| [Import Maps](#import-maps) | 89+ | 108+ | :x: |
| [Import Maps](#import-maps) | 89+ | 108+ | 16.4+ |
| [JSON Modules](#json-modules) | 91+ | :x: | :x: |
| [CSS Modules](#css-modules) | 95+ | :x: | :x: |
| [import.meta.resolve](#resolve) | :x: | :x: | :x: |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "es-module-shims",
"version": "1.7.0",
"version": "1.7.1",
"description": "Shims for the latest ES module features",
"main": "dist/es-module-shims.js",
"exports": {
Expand Down

0 comments on commit 4d47205

Please sign in to comment.