Skip to content

Conversation

@javierjulio
Copy link
Member

Originally, I had tried this but ran into issues pinning to a file with the vendor path specified. The problem was that the vendor path doesn't need to be specified but that's what was listed in the importmap-rails documentation. The docs were corrected this week so this now works as expected. We prefer to vendor this file rather than rely on CDN or the gem bundled version which the latter could be different and potentially non-ESM.

Closes #8216

@javierjulio javierjulio self-assigned this Jan 7, 2024
@codecov
Copy link

codecov bot commented Jan 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4318a7a) 99.10% compared to head (cdad9b9) 99.10%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8217   +/-   ##
=======================================
  Coverage   99.10%   99.10%           
=======================================
  Files         140      140           
  Lines        4017     4017           
=======================================
  Hits         3981     3981           
  Misses         36       36           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

With this we avoid any files from CDN and issues with CSP. We intended to do this originally but couldn't get it to work. The docs in importmaps-rails were corrected this past week to show what to do in this case. Previously, I was setting the "to:" with the vendor path but it's unnecessary which is why it didn't work.
@javierjulio javierjulio force-pushed the vendor-rails-ujs-esm branch from 5b8387c to cdad9b9 Compare January 7, 2024 15:58
@javierjulio javierjulio merged commit c1f23f3 into master Jan 7, 2024
@javierjulio javierjulio deleted the vendor-rails-ujs-esm branch January 7, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v4 beta 3: External CDNs do not play well with CSP and may be a problem for intranet apps

2 participants