Skip to content

Reintroduce Propshaft as replacement for Sprockets#8457

Merged
aduth merged 2 commits intomainfrom
aduth-unrevert-propshaft
May 25, 2023
Merged

Reintroduce Propshaft as replacement for Sprockets#8457
aduth merged 2 commits intomainfrom
aduth-unrevert-propshaft

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented May 23, 2023

🛠 Summary of changes

Replaces Sprockets with Propshaft for managing the asset pipeline.

This is a retry of #8387, which was reverted in #8412 due to issues observed in deployed environments.

The key change here is in 1474ff0. By removing the configuration of asset_host, it's hoped to avoid issues which lead to the use of an inaccurate URL prefix in the published version of the Propshaft gem. The asset_host configuration is not necessary because (a) our CDN is now configured to serve from the same host as the IdP domain, and (b) Propshaft will still generate root-relative paths (not absolute paths) without the configuration.

📜 Testing Plan

  1. Go to http://localhost:3000/
  2. Observe that images and styles appear as expected

(Further testing will be conducted in deployed environments once merged)

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines -14 to -16
config.assets.compile = false
config.assets.digest = true
config.assets.gzip = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do these options no longer exist? or are they the new defaults?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They no longer exist.

I also came across them when looking through the Propshaft source, commented as being deprecated:

https://github.com/rails/propshaft/blob/69c285f/lib/propshaft/railtie.rb#L69-L74

@aduth aduth merged commit c4a4acd into main May 25, 2023
@aduth aduth deleted the aduth-unrevert-propshaft branch May 25, 2023 13:25
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.

2 participants