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

Prioritize app assets over engine assets #206

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

brunoprietog
Copy link
Contributor

Make the app assets always have priority when resolving them, if there is another asset with the same name in a gem. For example:

bin/importmap pin trix

You would have a vendor/javascript/trix.js file. If you call "trix" from importmap, it would still take the one from Action Text gem instead. Not anymore.

@theodorton
Copy link
Collaborator

Not anymore.

Are you seeing a regression compared to sprockets after migrating to propshaft?

I think we need to consider warning users in cases of ambiguous asset names, and also be clear/explicit in the documentation and configuration about load order.

Is the specific engine you're using provided from a public gem?

@dhh
Copy link
Member

dhh commented Sep 23, 2024

We had a regression in our app where we had a vendored trix.js that was newer than the trix.js that came with Action Text. The app should always win over any engine. I'm almost certain this is how Sprockets worked as well, since that's the only way you could have a generic engine with views that are overwritten in the app.

@dhh dhh merged commit 48df362 into rails:main Sep 23, 2024
3 checks passed
@brunoprietog brunoprietog deleted the prioritize-app-assets branch September 24, 2024 05:26
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