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
Fix confusing wording in Asset Pipeline guide [ci skip] #38782
Conversation
Prior to ab123a3, this guide mentioned that three gems (sass-rails, uglifier, and coffee-rails) would be added to the Gemfile by default, unless the `--skip-sprockets` option was used when generating the application. However, ab123a3 removed uglifier and coffee-rails from the guide (to reflect the switch to webpacker for managing javascript in rails 6). Now that only sass-rails is left, the guide should say "adding this to your Gemfile" instead of "adding them to your Gemfile" and "add that gem" instead of "add those gems". [ci skip]
The original text "used by Sprockets for asset compression" was written when this sentence was summarizing the purpose of three gems: sass-rails, uglifier, and coffee-rails. However, ab123a3 removed uglifier and coffee-rails from this sentence. Now that only sass-rails is left, we can be more specific about what it is used for: compiling Sass stylesheets. [ci skip]
We link to the sprockets-rails repository in the preceding paragraph, so it seems appropriate to also link to the sass-rails repository in this paragraph. And since readers of this guide may not know what Sass is, it also seems appropriate to link to the sass-lang.com website. [ci skip]
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.
There are a few more outdated references in the Preprocessing section, in particular the assertion that Rails generates a CoffeeScript file with every scaffold by default. Could you do a pass over those too?
[ci skip] Co-Authored-By: Eugene Kenny <elkenny@gmail.com>
of the Asset Pipeline guide This section previously declared that the Rails controller generator generated an `app/assets/javascripts/projects.coffee` and an `app/assets/stylesheets/projects.scss` file. Then, in ab123a3, we removed the assertion that `app/assets/javascripts/projects.coffee` would be generated (to reflect the switch to webpacker for managing javascript in Rails 6). However, the preceding sentence and the subsequent paragraph were still written with the assumption that a CoffeeScript file would be generated. Now we've reworded those parts to be consistent with the fact that Rails no longer generates a CoffeeScript file. [ci skip]
30a009b
to
e71692f
Compare
Sounds good, I've updated the Preprocessing section in e71692f |
guides/source/asset_pipeline.md
Outdated
`app/assets/stylesheets/projects.scss` file. | ||
|
||
In development mode, or if the asset pipeline is disabled, when this file is | ||
requested it is processed by the processor provided by the `sass` gem and then |
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.
The sass
gem is no longer maintained, and sass-rails
now depends on the sassc
gem instead via sassc-rails
(#32896).
Even if it's not technically accurate, I think this should say "provided by the sass-rails
gem" - for the purposes of following this guide, it's enough to know that the processor is available because sass-rails
is in the Gemfile, even if the code is ultimately provided by a different gem.
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.
👍 Updated to sass-rails
in 649d265
As of rails/sass-rails@409d871 sass-rails no longer uses the `sass` gem (which is no longer maintained; it has been replaced by the `sassc` gem). Thus, the rails guides should not mention the `sass` gem specifically. Instead, they can continue to reference the `sass-rails` gem. [ci skip]
Could you squash your commits? Otherwise I think this is ready to go. |
Can you do a squash-and-merge? Or do you want me to squash into more than 1 commit? |
If I use the squash and merge button, the autogenerated commit message will be enormous:
This is way too much detail for the patch it describes. I could edit it down myself, but I'd prefer if you handled it by squashing the commits and writing a shorter combined commit message. |
I can squash and push later when I return to my rails dev machine. (Unfortunately, recloning on my current connection is not feasible.) Alternatively, if you want to squash-merge now, here's a proposal for an abbreviated commit message:
|
Perfect, thanks! 💛 I squash-merged with that message. |
Summary
While looking into #38307, I noticed some confusing wording in the Asset Pipeline guide:
rails/guides/source/asset_pipeline.md
Lines 36 to 45 in aeac447
Specifically
and
is confusing because the preceding paragraph only mentions one gem (
sass-rails
). I discovered that this is a result of removing mentions ofuglifier
andcoffee-rails
from that paragraph in #35994.So I've opened this PR as a follow-up to #35994 to clean up the confusing wording that was left in the guide.
Other Information
While I was in there, I also clarified the purpose of the
sass-rails
gem and added links to https://github.com/rails/sass-rails and https://sass-lang.com.