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

Update docs with pinning modules from engine/gem #221

Closed
wants to merge 1 commit into from

Conversation

javierjulio
Copy link
Contributor

@javierjulio javierjulio commented Jan 2, 2024

I'm working on ActiveAdmin v4 which uses importmap-rails (separate engine config) and @rails/ujs. I wondered why I had to download the @rails/ujs file from a CDN if the ESM version is already shipped in Rails (ActionView) to begin with. I figured it would help to have a section in the docs to demonstrate how to pin a module and link it, where the module file itself is included in Rails. My use case was for @rails/ujs but this approach should be applicable for activestorage, etc. I'm not sure if the term "vendored" here is appropriate. Would appreciate any review/corrections.

Since Rails ActionView includes rails-ujs.esm.js, we can import it directly without having to download the file from a CDN.
@javierjulio javierjulio changed the title Update with pinning modules from engine/gem Update docs with pinning modules from engine/gem Jan 2, 2024
@brunoprietog
Copy link

Anyway, keep in mind this rails/rails#50535

@dhh
Copy link
Member

dhh commented Jan 2, 2024

It's happening automatically in new apps when you activate active storage or action text through the install app. But would be happy to see it specified somewhere. And yes, rails-ujs is gone, so wouldn't focus further on that.

@dhh
Copy link
Member

dhh commented Jan 2, 2024

Solved in f27ec14.

@dhh dhh closed this Jan 2, 2024
@javierjulio javierjulio deleted the patch-2 branch January 2, 2024 21:31
@javierjulio
Copy link
Contributor Author

@dhh great, thank you!

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.

None yet

3 participants