From e10e162b580f934fca173ce41db0825ee0590935 Mon Sep 17 00:00:00 2001
From: nod_ <nod_@598310.no-reply.drupal.org>
Date: Tue, 11 Mar 2025 10:48:40 +0100
Subject: [PATCH] Issue #3511938 by catch, smustgrave: Move status report
 assets to their own library

---
 .../FunctionalJavascript/PerformanceTest.php  |  2 +-
 .../system/src/Element/StatusReportPage.php   |  5 ++++
 core/modules/system/system.libraries.yml      | 24 +++++++++++++--
 .../AssetAggregationAcrossPagesTest.php       |  2 +-
 ...nTelemetryAuthenticatedPerformanceTest.php |  2 +-
 .../OpenTelemetryFrontPagePerformanceTest.php |  2 +-
 .../StandardPerformanceTest.php               |  6 ++--
 core/themes/claro/claro.info.yml              |  9 ++----
 core/themes/claro/claro.libraries.yml         | 29 ++++++++++++++++---
 core/themes/stable9/stable9.info.yml          | 10 +++++--
 10 files changed, 68 insertions(+), 23 deletions(-)

diff --git a/core/modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php b/core/modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php
index 067c588422b3..e1edd2f916eb 100644
--- a/core/modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php
+++ b/core/modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php
@@ -93,7 +93,7 @@ public function testLogin(): void {
       'ScriptCount' => 2,
       'ScriptBytes' => 215500,
       'StylesheetCount' => 1,
-      'StylesheetBytes' => 47700,
+      'StylesheetBytes' => 46300,
     ];
     $this->assertMetrics($expected, $performance_data);
 
diff --git a/core/modules/system/src/Element/StatusReportPage.php b/core/modules/system/src/Element/StatusReportPage.php
index 440cb778dbb1..90a878831ead 100644
--- a/core/modules/system/src/Element/StatusReportPage.php
+++ b/core/modules/system/src/Element/StatusReportPage.php
@@ -136,6 +136,11 @@ public static function preRenderRequirements($element) {
     $element['#requirements'] = [
       '#type' => 'status_report',
       '#requirements' => $element['#requirements'],
+      '#attached' => [
+        'library' => [
+          'system/status.report',
+        ],
+      ],
     ];
 
     return $element;
diff --git a/core/modules/system/system.libraries.yml b/core/modules/system/system.libraries.yml
index 11491f7a779a..3f3c00951be0 100644
--- a/core/modules/system/system.libraries.yml
+++ b/core/modules/system/system.libraries.yml
@@ -15,9 +15,6 @@ base:
       css/components/position-container.module.css: { weight: -10 }
       css/components/reset-appearance.module.css: { weight: -10 }
       css/components/resize.module.css: { weight: -10 }
-      css/components/system-status-counter.css: { weight: -10 }
-      css/components/system-status-report-counters.css: { weight: -10 }
-      css/components/system-status-report-general-info.css: { weight: -10 }
       css/components/tablesort.module.css: { weight: -10 }
 
 admin:
@@ -37,6 +34,27 @@ maintenance:
     - system/base
     - system/admin
 
+status.report:
+  version: VERSION
+  css:
+    component:
+      css/components/system-status-counter.css: { weight: -10 }
+      css/components/system-status-report-counters.css: { weight: -10 }
+      css/components/system-status-report-general-info.css: { weight: -10 }
+  moved_files:
+    system/base:
+      deprecation_version: 11.2.0
+      removed_version: 12.0.0
+      deprecation_link: https://www.drupal.org/node/3432346
+      css:
+        component:
+          css/components/system-status-counter.css:
+            base: css/components/system-status-counter.css
+          css/components/system-status-reports-counters.css:
+            base: css/components/system-status-reports-counters.css
+          css/components/system-status-report-general-info.css:
+            base: css/components/system-status-report-general-info.css
+
 drupal.system:
   version: VERSION
   js:
diff --git a/core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php b/core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php
index 9cb51a0598e8..896e825d62f2 100644
--- a/core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php
+++ b/core/profiles/demo_umami/tests/src/FunctionalJavascript/AssetAggregationAcrossPagesTest.php
@@ -30,7 +30,7 @@ public function testFrontAndRecipesPages(): void {
       'ScriptCount' => 1,
       'ScriptBytes' => 11700,
       'StylesheetCount' => 6,
-      'StylesheetBytes' => 124450,
+      'StylesheetBytes' => 121000,
     ];
     $this->assertMetrics($expected, $performance_data);
   }
diff --git a/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryAuthenticatedPerformanceTest.php b/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryAuthenticatedPerformanceTest.php
index 0a4ae12d1f0b..4ff48563bbbb 100644
--- a/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryAuthenticatedPerformanceTest.php
+++ b/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryAuthenticatedPerformanceTest.php
@@ -66,7 +66,7 @@ public function testFrontPageAuthenticatedWarmCache(): void {
       'ScriptCount' => 1,
       'ScriptBytes' => 123850,
       'StylesheetCount' => 2,
-      'StylesheetBytes' => 43600,
+      'StylesheetBytes' => 42500,
     ];
     $this->assertMetrics($expected, $performance_data);
   }
diff --git a/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php b/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php
index 5b767bed3164..1157448a7828 100644
--- a/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php
+++ b/core/profiles/demo_umami/tests/src/FunctionalJavascript/OpenTelemetryFrontPagePerformanceTest.php
@@ -78,7 +78,7 @@ protected function testFrontPageHotCache(): void {
       'ScriptCount' => 1,
       'ScriptBytes' => 11850,
       'StylesheetCount' => 2,
-      'StylesheetBytes' => 41200,
+      'StylesheetBytes' => 40000,
     ];
     $this->assertMetrics($expected, $performance_data);
   }
diff --git a/core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php b/core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php
index d774716be3f0..0c3d7300ea33 100644
--- a/core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php
+++ b/core/profiles/standard/tests/src/FunctionalJavascript/StandardPerformanceTest.php
@@ -168,7 +168,7 @@ protected function testAnonymous(): void {
         ['config:user.role.anonymous'],
       ],
       'StylesheetCount' => 1,
-      'StylesheetBytes' => 3450,
+      'StylesheetBytes' => 2250,
     ];
     $this->assertMetrics($expected, $performance_data);
     $expected_default_cache_cids = [
@@ -228,7 +228,7 @@ protected function testAnonymous(): void {
         ['config:user.role.anonymous'],
       ],
       'StylesheetCount' => 1,
-      'StylesheetBytes' => 3150,
+      'StylesheetBytes' => 2250,
     ];
     $this->assertMetrics($expected, $performance_data);
 
@@ -265,7 +265,7 @@ protected function testAnonymous(): void {
       'CacheTagInvalidationCount' => 0,
       'CacheTagLookupQueryCount' => 16,
       'StylesheetCount' => 1,
-      'StylesheetBytes' => 3150,
+      'StylesheetBytes' => 1950,
     ];
     $this->assertMetrics($expected, $performance_data);
   }
diff --git a/core/themes/claro/claro.info.yml b/core/themes/claro/claro.info.yml
index 4a0a326479fa..647a22a1568e 100644
--- a/core/themes/claro/claro.info.yml
+++ b/core/themes/claro/claro.info.yml
@@ -37,12 +37,7 @@ libraries-override:
       component:
         misc/components/autocomplete-loading.module.css: css/components/autocomplete-loading.module.css
 
-  system/base:
-    css:
-      component:
-        css/components/system-status-counter.css: css/components/system-status-counter.css
-        css/components/system-status-report-counters.css: css/components/system-status-report-counters.css
-        css/components/system-status-report-general-info.css: css/components/system-status-report-general-info.css
+  system/status.report: claro/status.report
 
   system/admin:
     css:
@@ -148,6 +143,8 @@ libraries-extend:
     - claro/form.password-confirm
   node/drupal.node.preview:
     - claro/drupal.node.preview
+  system/status.report:
+    - claro/status.report
   views/views.module:
     - claro/views
   views_ui/admin.styling:
diff --git a/core/themes/claro/claro.libraries.yml b/core/themes/claro/claro.libraries.yml
index 64b56ebaa448..5d94d224c16c 100644
--- a/core/themes/claro/claro.libraries.yml
+++ b/core/themes/claro/claro.libraries.yml
@@ -51,10 +51,6 @@ global-styling:
       css/components/table--file-multiple-widget.css: {}
       css/components/search-admin-settings.css: {}
       css/components/tablesort-indicator.css: {}
-      css/components/system-status-report-general-info.css: {}
-      css/components/system-status-report.css: {}
-      css/components/system-status-report-counters.css: {}
-      css/components/system-status-counter.css: {}
       css/components/tableselect.css: {}
       css/components/tabs.css: {}
     theme:
@@ -220,6 +216,31 @@ form.password-confirm:
     - core/drupal
     - claro/global-styling
 
+
+status.report:
+  version: VERSION
+  css:
+    component:
+      css/components/system-status-report-general-info.css: {}
+      css/components/system-status-report.css: {}
+      css/components/system-status-report-counters.css: {}
+      css/components/system-status-counter.css: {}
+  moved_files:
+    claro/global-styling:
+      deprecation_version: 11.2.0
+      removed_version: 12.0.0
+      deprecation_link: https://www.drupal.org/node/3432346
+      css:
+        component:
+          css/components/system-status-report.css:
+            base: css/components/system-status-report.css
+          css/components/system-status-counter.css:
+            base: css/components/system-status-counter.css
+          css/components/system-status-report-counters.css:
+            base: css/components/system-status-report-counters.css
+          css/components/system-status-report-general-info.css:
+            base: css/components/system-status-report-general-info.css
+
 views:
   css:
     component:
diff --git a/core/themes/stable9/stable9.info.yml b/core/themes/stable9/stable9.info.yml
index 0314380fbdfb..745ceffab040 100644
--- a/core/themes/stable9/stable9.info.yml
+++ b/core/themes/stable9/stable9.info.yml
@@ -231,9 +231,6 @@ libraries-override:
         css/components/position-container.module.css: css/system/components/position-container.module.css
         css/components/reset-appearance.module.css: css/system/components/reset-appearance.module.css
         css/components/resize.module.css: css/system/components/resize.module.css
-        css/components/system-status-counter.css: css/system/components/system-status-counter.css
-        css/components/system-status-report-counters.css: css/system/components/system-status-report-counters.css
-        css/components/system-status-report-general-info.css: css/system/components/system-status-report-general-info.css
         css/components/tablesort.module.css: css/system/components/tablesort.module.css
   system/admin:
     css:
@@ -248,6 +245,13 @@ libraries-override:
       component:
         css/system.diff.css: css/system/system.diff.css
 
+  system/status.report:
+    css:
+      component:
+        css/components/system-status-counter.css: css/system/components/system-status-counter.css
+        css/components/system-status-report-counters.css: css/system/components/system-status-report-counters.css
+        css/components/system-status-report-general-info.css: css/system/components/system-status-report-general-info.css
+
   taxonomy/drupal.taxonomy:
     css:
       component:
-- 
GitLab