-
Notifications
You must be signed in to change notification settings - Fork 72
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
Support both Sprockets and Webpacker? #102
Comments
@kylefox thanks for the suggestion. I've been thinking about the upgrade path for existing Rails apps and I think your suggestion makes sense. Definitely open to the idea of multiple asset finders. 👍 |
Thinking about it more, I wonder if it makes sense to introduce a new helper explicitly for webpacker — similar to what Rails/Webpacker itself has done. 🤔 Rails has What do you think about replacing I think those helpers more closely match the Rails helpers. |
I'm not against this. I think it would have to be a major version bump as it would completely break the v1.x interface. Sounds like v2.0 might be the "Webpacker" release. 😆 |
Yeah, I think for sure it would need to be a major version bump. Just wanted to confirm if you'd be open to a change like that (and the resulting major version bump) before I explored that route. Thanks! |
I think the interface change you proposed will clear up confusion and make things more consistent with similar Rails internal helpers, so I'm definitely open to this and a major version bump as a result. 👍 |
As an experiment, I tried implementing Let me know if you think this implementation approach looks acceptable, or if I should pursue another approach! |
Hey @jamesmartin can you let me know if there's anything else needed before #103 can be merged and released? Thanks! |
No problem, thanks for giving responsive and helpful feedback 👍 |
First off, thanks for this great gem 👍
We're migrating our Rails app from Sprockets to Webpacker, but we're doing it in gradual steps. We need to find SVGs in both the asset pipeline and webpacker.
Would you be open to a PR that adds functionality for configuring multiple asset finders? I'm thinking something like this:
The idea would be that
inline_svg
would first attempt to find the asset in webpacker, and if not found would fallback to finding with sprockets. The array syntax could allow people to invert this behavior by swapping the order of the finders if they prefer to search the asset pipeline first.Thoughts?
The text was updated successfully, but these errors were encountered: