-
Notifications
You must be signed in to change notification settings - Fork 121
Add default support for the Propshaft asset pipeline #61
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70b2937
to
6440d53
Compare
Can you rebase and make it ready to review? |
6440d53
to
ba83470
Compare
Okay, I rebased the branch, but I still haven't addressed the test coverage issue. I did notice we have this: Lines 7 to 8 in a711ebb
although it doesn't currently appear to be used - we aren't using the CI matrix to test against different rails versions. Perhaps I should start by adding that, and then I can follow up here by adding a conditional in the Gemfile that swaps out sprockets-rails for propshaft and then extend the CI matrix to exercise that as well. |
I've opened #73 to expand the CI matrix to test against multiple versions of rails. If that looks good, I'll update this PR accordingly and then mark it ready for review. |
Rails 7 will formally support multiple asset pipelines, making sprockets optional: rails/rails@fb1ab34 Since our rails 7 gemfile is still using sprockets, let's rename it to clarify that, which will also make the setup clearer when we add a separate `rails_7_propshaft` gemfile.
(generated via `bundle exec appraisal install`) We'll use this new Gemfile to test importmap-rails against a rails 7 application using the propshaft asset pipeline (instead of sprockets-rails) on CI.
Since rails 7 has made sprockets optional in rails/rails@fb1ab34 our test app should support running without sprockets. This will allow us to test importmap-rails with an alternative asset pipeline such as propshaft.
We'll automatically add `Propshaft::MissingAssetError` to the `rescuable_asset_errors` if `Propshaft` is detected. This allows the test suite to pass when run against an application that uses propshaft instead of sprockets.
New rails 7 applications can be generated with propshaft as an alternative asset pipeline to sprockets: rails/rails@fb1ab34 Since we want importmap-rails to work out of the box with either of those asset pipeline options, we'll run our test suite continuously against both.
ba83470
to
0463e76
Compare
Propshaft::MissingAssetError
@rafaelfranca Done! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow-up to #60
Closes #42
New rails 7 applications can be generated with Propshaft as an alternative asset pipeline to Sprockets: rails/rails#43261. Per #42 (comment), we want importmap-rails to work out of the box with either of those asset pipeline options, so we'll automatically add
Propshaft::MissingAssetError
to therescuable_asset_errors
ifPropshaft
is detected. This allows the test suite to pass when run against an application that uses Propshaft instead of Sprockets. To that end, we've extended the CI matrix to also run our test suite continuously against a rails 7 application that uses Propshaft.