From c0fd4ab9d63f01edee3a04d6ccd5f588a0ffa1f1 Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Tue, 23 Feb 2021 16:20:59 -0500 Subject: [PATCH] DEV: Remove deprecated plugins variables importer (#12168) --- app/assets/stylesheets/common/foundation/variables.scss | 4 ---- lib/discourse_plugin_registry.rb | 4 ---- lib/stylesheet/importer.rb | 4 ---- spec/components/discourse_plugin_registry_spec.rb | 7 ------- spec/components/plugin/instance_spec.rb | 4 ---- 5 files changed, 23 deletions(-) diff --git a/app/assets/stylesheets/common/foundation/variables.scss b/app/assets/stylesheets/common/foundation/variables.scss index 493c21c68a3..33b439aaedf 100644 --- a/app/assets/stylesheets/common/foundation/variables.scss +++ b/app/assets/stylesheets/common/foundation/variables.scss @@ -74,10 +74,6 @@ $line-height-small: 1; $line-height-medium: 1.2; // Headings or large text $line-height-large: 1.4; // Normal or small text -// These files don't actually exist. They're injected by Stylesheet::Compiler. -// -------------------------------------------------- - -@import "plugins_variables"; @import "common/foundation/math"; // Z-index diff --git a/lib/discourse_plugin_registry.rb b/lib/discourse_plugin_registry.rb index 105ea6e0493..b3ecd3151a2 100644 --- a/lib/discourse_plugin_registry.rb +++ b/lib/discourse_plugin_registry.rb @@ -55,7 +55,6 @@ class DiscoursePluginRegistry define_register :mobile_stylesheets, Hash define_register :desktop_stylesheets, Hash define_register :color_definition_stylesheets, Hash - define_register :sass_variables, Set define_register :handlebars, Set define_register :serialized_current_user_fields, Set define_register :seed_data, HashWithIndifferentAccess @@ -161,9 +160,6 @@ class DiscoursePluginRegistry self.desktop_stylesheets[plugin_directory_name] << asset elsif opts == :color_definitions self.color_definition_stylesheets[plugin_directory_name] = asset - elsif opts == :variables - Discourse.deprecate(":variables is deprecated", drop_from: "2.7") - self.sass_variables << asset else self.stylesheets[plugin_directory_name] ||= Set.new self.stylesheets[plugin_directory_name] << asset diff --git a/lib/stylesheet/importer.rb b/lib/stylesheet/importer.rb index 0a692c65c4f..b4d65498f4b 100644 --- a/lib/stylesheet/importer.rb +++ b/lib/stylesheet/importer.rb @@ -91,10 +91,6 @@ module Stylesheet Import.new("wizard_fonts.scss", source: contents) end - register_import "plugins_variables" do - import_files(DiscoursePluginRegistry.sass_variables) - end - register_import "category_backgrounds" do contents = +"" Category.where('uploaded_background_id IS NOT NULL').each do |c| diff --git a/spec/components/discourse_plugin_registry_spec.rb b/spec/components/discourse_plugin_registry_spec.rb index 186dc69d270..0eb7547c83e 100644 --- a/spec/components/discourse_plugin_registry_spec.rb +++ b/spec/components/discourse_plugin_registry_spec.rb @@ -233,13 +233,6 @@ describe DiscoursePluginRegistry do expect(registry.stylesheets[plugin_directory_name]).to eq(nil) end - it "registers sass variable properly" do - registry.register_asset("test.css", :variables) - - expect(registry.sass_variables.count).to eq(1) - expect(registry.stylesheets.count).to eq(0) - end - it "registers admin javascript properly" do registry.register_asset("my_admin.js", :admin) diff --git a/spec/components/plugin/instance_spec.rb b/spec/components/plugin/instance_spec.rb index 0678d472c26..9c67ee8a036 100644 --- a/spec/components/plugin/instance_spec.rb +++ b/spec/components/plugin/instance_spec.rb @@ -258,9 +258,6 @@ describe Plugin::Instance do plugin.register_asset("desktop.css", :desktop) plugin.register_asset("desktop2.css", :desktop) - plugin.register_asset("variables1.scss", :variables) - plugin.register_asset("variables2.scss", :variables) - plugin.register_asset("code.js") plugin.register_asset("my_admin.js", :admin) @@ -271,7 +268,6 @@ describe Plugin::Instance do expect(DiscoursePluginRegistry.javascripts.count).to eq(2) expect(DiscoursePluginRegistry.admin_javascripts.count).to eq(2) expect(DiscoursePluginRegistry.desktop_stylesheets[plugin.directory_name].count).to eq(2) - expect(DiscoursePluginRegistry.sass_variables.count).to eq(2) expect(DiscoursePluginRegistry.stylesheets[plugin.directory_name].count).to eq(2) expect(DiscoursePluginRegistry.mobile_stylesheets[plugin.directory_name].count).to eq(1) end