DEV: Remove unused `disabled_plugins` checks (#13144)

DEV: Remove unused disabled_plugins checks (#13144)

We now bundle Javascript for each theme/plugin separately, and only ship bundles for enabled plugins to the client. Therefore, these disabled_plugins checks are now redundant, and can be removed.

diff --git a/app/assets/javascripts/discourse/app/lib/plugin-connectors.js b/app/assets/javascripts/discourse/app/lib/plugin-connectors.js
index 16b7faf..71d922e 100644
--- a/app/assets/javascripts/discourse/app/lib/plugin-connectors.js
+++ b/app/assets/javascripts/discourse/app/lib/plugin-connectors.js
@@ -1,4 +1,3 @@
-import Site from "discourse/models/site";
 import { buildRawConnectorCache } from "discourse-common/lib/raw-templates";
 import deprecated from "discourse-common/lib/deprecated";
 
@@ -26,17 +25,8 @@ const DefaultConnectorClass = {
 };
 
 function findOutlets(collection, callback) {
-  const disabledPlugins = Site.currentProp("disabled_plugins") || [];
-
   Object.keys(collection).forEach(function (res) {
     if (res.indexOf("/connectors/") !== -1) {
-      // Skip any disabled plugins
-      for (let i = 0; i < disabledPlugins.length; i++) {
-        if (res.indexOf("/" + disabledPlugins[i] + "/") !== -1) {
-          return;
-        }
-      }
-
       const segments = res.split("/");
       let outletName = segments[segments.length - 2];
       const uniqueName = segments[segments.length - 1];
diff --git a/app/assets/javascripts/discourse/tests/fixtures/site-fixtures.js b/app/assets/javascripts/discourse/tests/fixtures/site-fixtures.js
index 2f7ca15..c143a52 100644
--- a/app/assets/javascripts/discourse/tests/fixtures/site-fixtures.js
+++ b/app/assets/javascripts/discourse/tests/fixtures/site-fixtures.js
@@ -4,7 +4,6 @@ export default {
   "site.json": {
     site: {
       default_archetype: "regular",
-      disabled_plugins: [],
       shared_drafts_category_id: 24,
       notification_types: NOTIFICATION_TYPES,
       post_types: {
diff --git a/app/serializers/site_serializer.rb b/app/serializers/site_serializer.rb
index acf0544..6fe1d7c 100644
--- a/app/serializers/site_serializer.rb
+++ b/app/serializers/site_serializer.rb
@@ -12,7 +12,6 @@ class SiteSerializer < ApplicationSerializer
     :top_menu_items,
     :anonymous_top_menu_items,
     :uncategorized_category_id, # this is hidden so putting it here
-    :disabled_plugins,
     :user_field_max_length,
     :post_action_types,
     :topic_flag_types,
@@ -118,10 +117,6 @@ class SiteSerializer < ApplicationSerializer
     SiteSetting.uncategorized_category_id
   end
 
-  def disabled_plugins
-    Discourse.disabled_plugin_names
-  end
-
   def user_field_max_length
     UserField.max_length
   end
diff --git a/plugins/styleguide/assets/javascripts/discourse/styleguide-route-map.js.es6 b/plugins/styleguide/assets/javascripts/discourse/styleguide-route-map.js.es6
index 155e556..bc8eea4 100644
--- a/plugins/styleguide/assets/javascripts/discourse/styleguide-route-map.js.es6
+++ b/plugins/styleguide/assets/javascripts/discourse/styleguide-route-map.js.es6
@@ -1,10 +1,4 @@
 export default function () {
-  const { disabled_plugins = [] } = this.site;
-
-  if (disabled_plugins.indexOf("styleguide") !== -1) {
-    return;
-  }
-
   this.route("styleguide", function () {
     this.route("show", { path: ":category/:section" });
   });

GitHub sha: 8c838031

This commit appears in #13144 which was approved by CvX. It was merged by SamSaffron.