Skip to content

Upgrade asset pipeline to Sprockets 4 (sass-rails 5 -> 6)#81

Merged
JuanVqz merged 1 commit into
mainfrom
chore/asset-pipeline-sprockets4
Jul 9, 2026
Merged

Upgrade asset pipeline to Sprockets 4 (sass-rails 5 -> 6)#81
JuanVqz merged 1 commit into
mainfrom
chore/asset-pipeline-sprockets4

Conversation

@JuanVqz

@JuanVqz JuanVqz commented Jul 8, 2026

Copy link
Copy Markdown
Member

What

Moves the asset pipeline onto Sprockets 4 by upgrading sass-rails ~> 5.0~> 6.0.

Why

sass-rails 5.1.0 constrained sprockets (>= 2.8, < 4.0), pinning the app to Sprockets 3.7.5. That old Sprockets version registers a CoffeeScript engine unconditionally and, during assets:precompile, requires the coffee_script lib — which blocks two cleanups (removing the dead coffee-rails, swapping uglifierterser). Sprockets 4 dropped those built-in language engines, so this upgrade is the prerequisite that unblocks them.

Changes

  • sass-rails ~> 5.0~> 6.0 (delegates SCSS compilation to sassc-rails)
  • Resolves to sprockets 4.2.2 (was 3.7.5); adds sassc-rails 2.1.2
  • Both Gemfile.lock and the dual-boot Gemfile.next.lock updated
  • Used --conservative so rack stays at 2.2.23 rather than being dragged to 3.x as collateral — a rack major is out of scope here
  • app/assets/config/manifest.js (required by Sprockets 4) was already present; no change needed

Verification

  • Boots on Sprockets 4.2.2
  • assets:precompile succeeds — application.js, application.css, and pdf.css all compile, including the @import "font-awesome" and @import "fastruby/styleguide" paths
  • Full test suite passes: 16 runs, 52 assertions, 0 failures, 0 errors, 0 skips
  • The pre-existing sass gem deprecation warnings are gone (sass-rails 6 uses sassc)

Follow-ups this unblocks

  • Remove coffee-rails (dead; only file is an empty scaffold stub)
  • Replace uglifierterser

sass-rails 5.1.0 capped sprockets at < 4.0; bumping it to ~> 6.0 lifts the
cap and moves the app onto Sprockets 4.2.2 (sass-rails 6 delegates SCSS
compilation to sassc-rails). Both lockfiles updated.

Kept the update scoped: used --conservative so rack stays at 2.2.23 rather
than being dragged to 3.x as collateral. The app/assets/config/manifest.js
Sprockets 4 requires was already present.

This unblocks two follow-ups that Sprockets 3.x's unconditional CoffeeScript
engine was blocking: removing coffee-rails and swapping uglifier -> terser.

Verified: boots on Sprockets 4.2.2, assets:precompile succeeds (application
js/css + pdf.css, including the font-awesome and fastruby/styleguide
imports), and the full test suite passes (16 runs, 52 assertions, 0
failures).
@JuanVqz JuanVqz self-assigned this Jul 8, 2026
@JuanVqz JuanVqz marked this pull request as ready for review July 9, 2026 02:34
@JuanVqz JuanVqz merged commit 6abc73d into main Jul 9, 2026
2 checks passed
@JuanVqz JuanVqz deleted the chore/asset-pipeline-sprockets4 branch July 9, 2026 02:34
JuanVqz added a commit that referenced this pull request Jul 9, 2026
coffee-rails was dead: its only file, app/assets/javascripts/home.coffee,
was the default Rails scaffold comment block (three comment lines, zero
code). Converted that stub to an equivalent no-op home.js and dropped the
gem; both Gemfile.lock and the dual-boot Gemfile.next.lock updated (also
drops coffee-script / coffee-script-source).

This was blocked under Sprockets 3.x (which registered a CoffeeScript engine
unconditionally and required the coffee_script lib at precompile); the
Sprockets 4 upgrade (#81) removed that coupling, so the gem is now cleanly
removable.

Verified locally: boots, assets:precompile succeeds (application.js incl.
home.js, application.css, pdf.css), test suite green (16 runs, 52 assertions,
0 failures), rubocop clean (exact CI config), reek clean. System tests not
run locally (no chromedriver in this env) — covered by CI; change is a no-op
asset conversion so risk is minimal.

Co-authored-by: Juan Vásquez <jvasquez@navigatingcancer.com>
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.

1 participant