-
Notifications
You must be signed in to change notification settings - Fork 248
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
Warn instead of raising on missing manifest.js
#546
Open
mamhoff
wants to merge
3
commits into
rails:master
Choose a base branch
from
mamhoff:warn-not-raise-missing-manifest
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
Bundler `latest` has stopped working with older Rubies. We need to specify the Bundler version for the older Rubies to still build.
See rails/rails#54260 for context.
7bacda1
to
4b59d14
Compare
Rebased on #547 to get the CI green. |
c4144a3
to
3288686
Compare
With a pristine (`rails new`) Rails 8.0 app, the `app/assets/config/manifest.js` file is no longer automatically generated. For engines still using sprockets, that is not a huge issue, because they have and add their own manifest files for their assets to the list of precompiled assets. However, scripts like the Solidus bin/sandbox script[1] first run `rails new`, then add the needed engines to the sandbox's `Gemfile`, then run `rails db:migrate` and their respective install generators. With Rails 8, these scripts now fail before anything is possible in Ruby, because the initializer of `Sprockets::Railtie` will raise an error on startup. This commit changes the behavior of the Railtie to issue a deprecation warning instead of raising an Exception. [1] https://github.com/solidusio/solidus/blob/main/bin/sandbox#L44-L99
3288686
to
3b36794
Compare
tvdeyen
reviewed
Feb 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This will help every Rails 8 app to even boot when a gem depends on sprockets-rails
. Please merge this 🙏🏻
Merged
4 tasks
tvdeyen
added a commit
to blish/solidus
that referenced
this pull request
Feb 18, 2025
Due to a bug in sprockets-rails[1] we need to manually add the sprockets manifest into the generated rails app before running any rails commands inside the rails app folder. [1](rails/sprockets-rails#546)
4 tasks
tvdeyen
added a commit
to blish/solidus
that referenced
this pull request
Feb 18, 2025
Due to a bug in sprockets-rails[1] we need to manually add the sprockets manifest into the generated rails app before running any rails commands inside the rails app folder. [1](rails/sprockets-rails#546)
tvdeyen
added a commit
to blish/solidus
that referenced
this pull request
Feb 18, 2025
Due to a bug in sprockets-rails[1] we need to manually add the sprockets manifest into the generated rails app before running any rails commands inside the rails app folder. [1](rails/sprockets-rails#546)
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.
With a pristine (
rails new
) Rails 8.0 app, theapp/assets/config/manifest.js
file is no longer automatically generated. For engines still using sprockets, that is not a huge issue, because they have and add their own manifest files for their assets to the list of precompiled assets.However, scripts like the Solidus bin/sandbox script first run
rails new
, then add the needed engines to the sandbox'sGemfile
, then runrails db:migrate
and their respective install generators. With Rails 8, these scripts now fail before anything is possible in Ruby, because the initializer ofSprockets::Railtie
will raise an error on startup.This commit changes the behavior of the Railtie to issue a deprecation warning instead of raising an Exception.