importmap-rails 1.1.5 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/app/assets/javascripts/es-module-shims.js +197 -144
- data/app/assets/javascripts/es-module-shims.js.map +1 -1
- data/app/assets/javascripts/es-module-shims.min.js +2 -2
- data/app/helpers/importmap/importmap_tags_helper.rb +2 -2
- data/lib/importmap/packager.rb +2 -2
- data/lib/importmap/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70bd0df53bac3a5b6657fc7184840311bfe68d19de5db9470f8b1b2a7ae0ac25
|
4
|
+
data.tar.gz: 21625eddac92ce45d8174e6023be8e1c602c3b43fab5380c54ee82d67ccdf552
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d96158943de237bfcf6ddf7d5966712635b810a647f2aa4e7e9fbf7fbbc76d8c442e51cead39bf61f71ece5015e1c2f84c75c0a00d7d8e5ae8500c36dc81ad68
|
7
|
+
data.tar.gz: 7e9cfcefeeb5de53bb05fff2401b46e4775949e78a2a5c148e4827deaec590df7e1033c64e4dd7982b4eb69bed8c8e850b60721784097d91f0e0472502624354
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
With this approach you'll ship many small JavaScript files instead of one big JavaScript file. Thanks to HTTP/2 that no longer carries a material performance penalty during the initial transport, and in fact offers substantial benefits over the long run due to better caching dynamics. Whereas before any change to any JavaScript file included in your big bundle would invalidate the cache for the whole bundle, now only the cache for that single file is invalidated.
|
6
6
|
|
7
|
-
There's [native support for import maps in Chrome/Edge 89+](https://caniuse.com/?search=importmap), and [a shim available](https://github.com/guybedford/es-module-shims) for any browser with basic ESM support. So your app will be able to work with all the evergreen browsers.
|
7
|
+
There's [native support for import maps in Chrome/Edge 89+/Firefox 108+](https://caniuse.com/?search=importmap), and [a shim available](https://github.com/guybedford/es-module-shims) for any browser with basic ESM support. So your app will be able to work with all the evergreen browsers.
|
8
8
|
|
9
9
|
|
10
10
|
## Installation
|
@@ -291,13 +291,13 @@ end
|
|
291
291
|
|
292
292
|
## Expected errors from using the es-module-shim
|
293
293
|
|
294
|
-
While import maps are native in Chrome and
|
294
|
+
While import maps are native in Chrome, Edge, and Firefox, they need a shim in other browsers that'll produce a JavaScript console error like `TypeError: Module specifier, 'application' does not start with "/", "./", or "../".`. This error is normal and does not have any user-facing consequences.
|
295
295
|
|
296
296
|
In Firefox. when opening the browser console, the asm.js module lexer build will run in unoptimized mode due to the debugger attaching. This gives a warning message `"asm.js type error: Disabled because no suitable wasm compiler is available"` which is as expected. When the console is closed again, the asm.js optimizations are fully applied, and this can even be verified with the console open by disabling the debugger in `about:config` and reloading the page.
|
297
297
|
|
298
298
|
## Turning off the shim
|
299
299
|
|
300
|
-
Under certain circumstances, like running system tests using chromedriver under CI (which may be resource constrained and trigger errors in certain cases), you may want to explicitly turn off including the shim. You can do this by calling the bulk tag helper with `javascript_importmap_tags("application", shim: false)`. Thus you can pass in something like `shim: !ENV["CI"]`. If you want, and are sure you're not doing any full-page caching, you can also connect this directive to a user agent check (using a gem like `useragent`) to check whether the browser is chrome/edge 89+. But you really shouldn't have to, as the shim is designed to gracefully work with natively compatible drivers.
|
300
|
+
Under certain circumstances, like running system tests using chromedriver under CI (which may be resource constrained and trigger errors in certain cases), you may want to explicitly turn off including the shim. You can do this by calling the bulk tag helper with `javascript_importmap_tags("application", shim: false)`. Thus you can pass in something like `shim: !ENV["CI"]`. If you want, and are sure you're not doing any full-page caching, you can also connect this directive to a user agent check (using a gem like `useragent`) to check whether the browser is chrome/edge 89+/firefox 108+. But you really shouldn't have to, as the shim is designed to gracefully work with natively compatible drivers.
|
301
301
|
|
302
302
|
## Checking for outdated or vulnerable packages
|
303
303
|
|