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

Add support for Propshaft #134

Merged

Conversation

martinzamuner
Copy link
Contributor

Rails 7 adds the option of using a new asset pipeline library called Propshaft. It will most likely replace Sprockets in the future as the default asset pipeline for Rails as they move away from CSS compilers and JS bundlers.

This PR adds a new asset finder for Propshaft and it automatically loads it when appropriate. I've tried to make as few changes as possible because Sprockets is still the default and inline_svg supports many versions of Rails.

@navidemad
Copy link

Working well in my repository ⚡️

@jamesmartin
Copy link
Owner

@martinzamuner thanks for the PR! ✨

The code looks good to me. Tagging in @mjc-gh as they raised the issue of support for Rails 7 without using the Asset Pipeline in #133. More 👀 on the approach taken in this PR would be helpful.

Also, note to self, I think we'll want to add Rails 7 (with and without Propshaft, if that's an option) as an integration test matrix item in:

test-branch: [rails3, rails4, main, rails6, rails6-webpacker]

@mjc-gh
Copy link

mjc-gh commented Dec 13, 2021

Hey all, this PR look good to me overall. This Rails issue rails/rails#43793 is generally related to the initial issue I brought up in #133 and to this PR as well. I think the gist of it all is either sprockets-rails or propshaft should be installed to actually serve assets on most Rails 7 apps and this gem can likely expect either or is present when Rails 7 is being used.

Presumably the existing asset pipeline/sprocket support still works so long as sprockets-rails is installed. Perhaps the additions to the integration test matrix should be for rails 7 with sprockets-rails and rails 7 with propshaft?

@jamesmartin jamesmartin merged commit b820d6d into jamesmartin:main Dec 14, 2021
@jamesmartin
Copy link
Owner

jamesmartin commented Dec 15, 2021

I added Rails 7 to the integration tests and removed Rails 6 Webpacker, because it's become unreliable. I'm planning to drop support for Webpacker from this gem moving forward, as it seems to have fallen out of favor in the Rails world.

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.

4 participants