Skip to content

fix(assets): Skip SassC compression for prebuilt admin CSS - #3952

Merged
tvdeyen merged 2 commits into
mainfrom
fix/skip-sass-compression-for-builds
Jun 11, 2026
Merged

fix(assets): Skip SassC compression for prebuilt admin CSS#3952
tvdeyen merged 2 commits into
mainfrom
fix/skip-sass-compression-for-builds

Conversation

@tvdeyen

@tvdeyen tvdeyen commented Jun 11, 2026

Copy link
Copy Markdown
Member

What is this pull request for?

Alchemy ships pre-built, already-minified admin CSS in app/assets/builds that uses modern CSS syntax such as relative colors and oklch(). When a host app pulls in sassc-rails (the default in any Solidus app), Sprockets sets the :sass css_compressor, which re-parses every text/css asset as SCSS through the unmaintained libSass and raises on that syntax. Since these files are already minified, prepend a skip onto the SassC compressor for assets under our builds directory and leave every other stylesheet to be compressed as before.

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

@tvdeyen tvdeyen added this to the 8.3 milestone Jun 11, 2026
@tvdeyen
tvdeyen requested a review from a team as a code owner June 11, 2026 06:54
@tvdeyen tvdeyen added the bug label Jun 11, 2026
@tvdeyen
tvdeyen enabled auto-merge June 11, 2026 06:55
tvdeyen added a commit to AlchemyCMS/alchemy-solidus that referenced this pull request Jun 11, 2026
@tvdeyen

tvdeyen commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

See it in action AlchemyCMS/alchemy-solidus#148

@tvdeyen
tvdeyen force-pushed the fix/skip-sass-compression-for-builds branch from 24d1167 to 71d1bc8 Compare June 11, 2026 09:07
Alchemy ships pre-built, already-minified admin CSS in app/assets/builds
that uses modern CSS syntax such as relative colors and oklch(). When a
host app pulls in sassc-rails (the default in any Solidus app), Sprockets
sets the :sass css_compressor, which re-parses every text/css asset as
SCSS through the unmaintained libSass and raises on that syntax. Since
these files are already minified, prepend a skip onto the SassC
compressor for assets under our builds directory and leave every other
stylesheet to be compressed as before.
@tvdeyen
tvdeyen force-pushed the fix/skip-sass-compression-for-builds branch from 71d1bc8 to 6e2df59 Compare June 11, 2026 12:15
The "when sprockets is not defined" example removed the top-level
Sprockets constant with Object.send(:remove_const, :Sprockets) but never
restored it, permanently mutating global state for the rest of the
process. Under eager loading this leaked into later specs that rely on
Sprockets being defined, making them fail depending on run order.
hide_const hides the constant only for the duration of the example and
restores it automatically, matching the sibling stub_const context.
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 98.15%. Comparing base (d7c851b) to head (9b41630).

Files with missing lines Patch % Lines
lib/alchemy/engine.rb 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3952      +/-   ##
==========================================
- Coverage   98.16%   98.15%   -0.01%     
==========================================
  Files         344      345       +1     
  Lines        8953     8964      +11     
==========================================
+ Hits         8789     8799      +10     
- Misses        164      165       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tvdeyen
tvdeyen merged commit 3aeee35 into main Jun 11, 2026
26 of 28 checks passed
@tvdeyen
tvdeyen deleted the fix/skip-sass-compression-for-builds branch June 11, 2026 15:28
@alchemycms-bot alchemycms-bot Bot mentioned this pull request Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants