From 042f3f32471b2f2eae73e26ad3f2a713af15eaed Mon Sep 17 00:00:00 2001 From: Keenan Brock Date: Wed, 16 Oct 2024 18:27:49 -0400 Subject: [PATCH] Drop sass-rails We are using webpacker (via the command line) to build sass assets. This is disabled in production And developers are using either rake update:ui or webpack --watch So no need to include this in our dev chain. --- config/initializers/assets.rb | 2 +- lib/manageiq/ui/classic/engine.rb | 12 ------------ manageiq-ui-classic.gemspec | 2 +- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 06496a3276a..a99fed249fb 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -1,5 +1,5 @@ Rails.application.config.assets.paths << ManageIQ::UI::Classic::Engine.root.join('node_modules') Rails.application.config.assets.precompile << proc do |filename, path| - path =~ %r{app/assets} && !%w(.js .css).include?(File.extname(filename)) + path =~ %r{app/assets} && !%w(.js .css .sass).include?(File.extname(filename)) end diff --git a/lib/manageiq/ui/classic/engine.rb b/lib/manageiq/ui/classic/engine.rb index cd957b42932..dc72a001ec8 100644 --- a/lib/manageiq/ui/classic/engine.rb +++ b/lib/manageiq/ui/classic/engine.rb @@ -1,18 +1,6 @@ require 'rails/engine' require 'sprockets/railtie' -# Since we serve our assets directly through apache on an appliance after they -# are pre-compiled, there is no need to have sass/coffeescript loaded in the -# application, so we can save a bit of resources by not loading these two. -# -# That said, we still need to load both of these when pre-compiling the assets -# in production mode, so if Rake is defined, load things like we used to. -# -# For this to work properly, it is dependent on patternfly/patternfly-sass#150 -if ENV["RAILS_ENV"] != "production" || defined?(Rake) - require 'sass-rails' -end - require 'high_voltage' require 'webpacker' diff --git a/manageiq-ui-classic.gemspec b/manageiq-ui-classic.gemspec index e133244f0d8..4194d62e11a 100644 --- a/manageiq-ui-classic.gemspec +++ b/manageiq-ui-classic.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |s| # TODO: fix manageiq-decorators so we can eager load after manageiq-ui-classic # s.add_dependency "manageiq-decorators" s.add_dependency "more_core_extensions", ">= 3.2", "< 5" - s.add_dependency "sass-rails" + s.add_dependency "sprockets-rails" s.add_dependency "uglifier", "~>4.2.0" s.add_dependency "webpacker", "~>2.0.0"