Skip to content

Skip sprockets initializers for apps that don't use sprockets #63

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

Closed
wants to merge 2 commits into from

Conversation

gmcgibbon
Copy link
Member

@gmcgibbon gmcgibbon commented Aug 16, 2021

Some apps don't use sprockets and the current set of initializers assumes sprockets to be loaded. I think it would be reasonable to conditionally set initializers based on if Sprockets is defined or not. This should be done before the gem is required in sprockets railtie that rails loads with "rails/all":

https://github.com/rails/rails/blob/13a714f30d5e4c4a53062bb1b29fbeb287efd3be/railties/lib/rails/all.rb#L18
https://github.com/rails/sprockets-rails/blob/118ce60b1ffeb7a85640661b014cd2ee3c4e3e56/lib/sprockets/railtie.rb#L6

Also, the first commit is to clean up the mimemagic reference in the lockfile.

@gmcgibbon gmcgibbon changed the title Sprockets fix Skip sprockets initializers for apps that don't use sprockets Aug 16, 2021
@dhh
Copy link
Member

dhh commented Aug 18, 2021

This gem has now doubled down on being a solutions specifically for sprockets based apps, so I don't think this is relevant any longer.

@dhh dhh closed this Aug 18, 2021
@gmcgibbon gmcgibbon deleted the sprockets_fix branch August 18, 2021 21:33
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.

2 participants