mysociety / alaveteli

Provide a Freedom of Information request system for your jurisdiction
https://alaveteli.org
Other
387 stars 195 forks source link

ERB warning when precompiling assets #7532

Closed gbp closed 1 year ago

gbp commented 1 year ago

Since #6348 we're seeing warnings for sprockets v3. We should upgrade to sprockets v4 or take a look at the new options with Rails 7 https://discuss.rubyonrails.org/t/guide-to-rails-7-and-the-asset-pipeline/80851

gems/sprockets-3.7.2/lib/sprockets/erb_processor.rb:21: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.
gems/sprockets-3.7.2/lib/sprockets/erb_processor.rb:21: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.
gbp commented 1 year ago

Upgrading to sprockets v4 isn't straight forward due to how alaveteli themes inject their assets. https://github.com/mysociety/alavetelitheme/blob/eda4278ccc578e17d80e124355930fce9240a005/lib/alavetelitheme.rb#L45-L49

See: https://github.com/rails/sprockets-rails/commit/fb6f9c65f9edb94c7678e815e357b7867c466161#diff-0fe0cefbd0308feaa605773633e907deef8b306702ccf16ebb57c02c345f6adeR64-R68

gbp commented 1 year ago

Might be able to switch to https://github.com/rails/propshaft. This looks like it might be the default in Rails 8.