-
Notifications
You must be signed in to change notification settings - Fork 121
Drop the bundled shim #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
It's no longer needed with full support for import maps in all modern browsers.
Prep for importmap-rails v2 by using the new defaults now, even on v1. rails/importmap-rails#216
Prep for importmap-rails v2 by using the new defaults now, even on v1. rails/importmap-rails#216
* Preload all pins rails/importmap-rails#218 * Disable shim for importmaps Prep for importmap-rails v2 by using the new defaults now, even on v1. rails/importmap-rails#216
Warning that this breaks JS on all browsers on iOS 16 and below, even if you download the latest version available for that OS. Verified on Safari, Chrome, and Duck Duck Go on a fresh install. This was a significant portion of my e-commerce site's users (12%+). I understand that these aren't "modern" browsers but this feels fairly premature for a lot of sites out there - so update with care. |
That's why this is a major version bump. You can continue using 1.x for shim compatibility. |
Sure, but being stuck on 1.x for an unknown amount of time isn't ideal. You'll be picking between new features in the 2.x release line and a fair amount of site traffic for most websites. Feels a bit idealistic in my opinion. At any rate, it works to add the shim manually ahead of the call to <script async src="https://ga.jspm.io/npm:[email protected]/dist/es-module-shims.js" data-turbo-track="reload"></script>
<%= javascript_importmap_tags %> |
Feel free to add a PR to the README explaining how to manually bring back the shim 👍 |
The Rails Guides refers to Es-module-shims, but the latest version (2.x) does not insert the shims, which can be misleading. |
Should be updated to reflect that shims aren’t needed for modern
browsers. Could mention that if you need to service legacy browsers you
can easily add the shim back yourself.
On February 11, 2024, "github.com" ***@***.***> wrote:
The Rails Guides refers to Es-module-shims
<https://github.com/rails/rails/blob/main/guides/source/asset_pipeline.md#usage>,
but the latest version (2.x) does not insert the shims, which can be
misleading.
Should the reference to the shims be removed from the Rails Guides?
—
Reply to this email directly, view it on GitHub
<#216 (comment)-
1937959607>, or unsubscribe
<https://github.com/notifications/unsubscribe-
auth/AAAAVNMI2ICJTYNIRBGOZU3YTFVJBAVCNFSM6AAAAABBJAHTQWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZXHE2TSNRQG4>.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Before updating the Rails Guides, first, I have sent PR #249 that add how to support legacy browsers with Es-module-shims to the README. |
I have submitted the PR on the Rails to update the Guides to reflect this PR #216. |
It's no longer needed with full support for import maps in all modern browsers.