Skip to content
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

Drop the bundled shim #216

Merged
merged 2 commits into from
Jan 1, 2024
Merged

Drop the bundled shim #216

merged 2 commits into from
Jan 1, 2024

Conversation

dhh
Copy link
Member

@dhh dhh commented Jan 1, 2024

It's no longer needed with full support for import maps in all modern browsers.

It's no longer needed with full support for import maps in all modern browsers.
@dhh dhh added this to the 2.0.0 milestone Jan 1, 2024
@dhh dhh merged commit b372f2e into main Jan 1, 2024
40 checks passed
javierjulio added a commit to activeadmin/activeadmin that referenced this pull request Jan 2, 2024
Prep for importmap-rails v2 by using the new defaults now, even on v1.

rails/importmap-rails#216
javierjulio added a commit to activeadmin/activeadmin that referenced this pull request Jan 2, 2024
Prep for importmap-rails v2 by using the new defaults now, even on v1.

rails/importmap-rails#216
javierjulio added a commit to activeadmin/activeadmin that referenced this pull request Jan 2, 2024
* 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
@jonathandean
Copy link

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.

@dhh
Copy link
Member Author

dhh commented Jan 9, 2024

That's why this is a major version bump. You can continue using 1.x for shim compatibility.

@jonathandean
Copy link

jonathandean commented Jan 9, 2024

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 javascript_importmap_tags to be able to keep the 2.x version:

<script async src="https://ga.jspm.io/npm:[email protected]/dist/es-module-shims.js" data-turbo-track="reload"></script>

<%= javascript_importmap_tags %>

@dhh
Copy link
Member Author

dhh commented Jan 9, 2024

Feel free to add a PR to the README explaining how to manually bring back the shim 👍

@wakairo
Copy link
Contributor

wakairo commented Feb 12, 2024

The Rails Guides refers to Es-module-shims, 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?

@dhh
Copy link
Member Author

dhh commented Feb 12, 2024 via email

@wakairo
Copy link
Contributor

wakairo commented Feb 29, 2024

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.

@wakairo
Copy link
Contributor

wakairo commented Mar 21, 2024

I have submitted the PR on the Rails to update the Guides to reflect this PR #216.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants