Skip to content

Remove JS and CSS asset compressors#310

Draft
tom93 wants to merge 2 commits intomasterfrom
remove-asset-compressors
Draft

Remove JS and CSS asset compressors#310
tom93 wants to merge 2 commits intomasterfrom
remove-asset-compressors

Conversation

@tom93
Copy link
Contributor

@tom93 tom93 commented Jul 3, 2025

TO DO:

  • Test (update: did light testing, no issues)
  • Compare size of assets before/after

Stacked on #308 and #309.

From the commit message:

Rails 8 has moved away from asset compression[1].

uglifier (JS compressor) requires a JavaScript runtime (which we
previously provided using mini_racer). It's a large install and raises
security concerns because it uses an outdated version of V8 (it's only
meant to run as part of asset precompilation, not in the running web
server; but still).

yui requires the Java Runtime Environment.

We follow the Rails 8 rationale and remove the asset compression (even
though we are still on a much older version of Rails).

[1] https://guides.rubyonrails.org/v8.0/asset_pipeline.html

@tom93 tom93 changed the title Remove asset compressors Remove JS and CSS asset compressors Jul 3, 2025
@coveralls
Copy link

coveralls commented Jul 3, 2025

Coverage Status

coverage: 37.631%. remained the same
when pulling 2d3f6d7 on remove-asset-compressors
into dd4df24 on master.

@bagedevimo
Copy link
Contributor

While i'm fine with this in general I think it's worth at least briefly discussing what the plan for assets is before merging. Rails 8 ships importmaps by default but that's only really viable for those who don't care about backwards compatibility or compiling assets, which IMO isn't necessarily a great choice for a lot of applications.

@tom93
Copy link
Contributor Author

tom93 commented Jul 3, 2025

Definitely.

I created this PR because I got annoyed with bundle install running out of RAM while testing Rails 5 (a VM with 1GB isn't enough, need to enable swap). No rush to merge, just created it so I won't forget and to start the investigation/discussion.

I assumed Uglifier was only compressing (not adding ES compat) and I was hoping everything would "just work" (but as I said I didn't even bother testing), do you have any particular concerns / things to test? I remember talking about importmaps for auto-updating jQuery, but I'm not sure why else we would need importmaps / non-trivial asset compilation.

@tom93 tom93 changed the base branch from master to remove-sass July 5, 2025 10:21
@tom93 tom93 force-pushed the remove-asset-compressors branch from 98ec043 to 53ef427 Compare July 5, 2025 10:23
@tom93 tom93 force-pushed the remove-asset-compressors branch from 53ef427 to 00a3270 Compare July 5, 2025 10:37
Base automatically changed from remove-sass to master July 5, 2025 11:52
tom93 added 2 commits July 6, 2025 00:02
Rails 8 has moved away from asset compression[1].

`uglifier` (JS compressor) requires a JavaScript runtime (which we
previously provided using mini_racer). It's a large install and raises
security concerns because it uses an outdated version of V8 (it's only
meant to run as part of asset precompilation, not in the running web
server; but still).

`yui` requires the Java Runtime Environment.

We follow the Rails 8 rationale and remove the asset compression (even
though we are still on a much older version of Rails).

[1] https://guides.rubyonrails.org/v8.0/asset_pipeline.html
@tom93 tom93 force-pushed the remove-asset-compressors branch from 00a3270 to 2d3f6d7 Compare July 5, 2025 12:02
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.

3 participants