Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/235289

Change subject: Deprecate unconditional loading of mediawiki.ui.button on all 
pages
......................................................................

Deprecate unconditional loading of mediawiki.ui.button on all pages

Formally deprecate the unconditional loading of mediawiki.ui.button on all
pages. During the deprecation period, the styles will be loaded on pages which
contain 'mw-ui-button' in the page HTML. Starting with 1.28, the styles will
only be loaded if explicitly depended upon.

The rationale for the patch was expressed by Spage in a comment on PS4 of
I835f3eb937: "Wikis have too many templates like
[[commons:Template:Clickable_button]] dependent on jquery.ui.button that don't
work if JavaScript isn't enabled.  mediawiki.ui.button is a lighter-weight
piece of CSS that we own and can improve, and transitioning wiki content to it
requires that we provide it." Mattflaschen commented that the added payload was
"justifiable if we announce this widely and make an effort to get wikis to use 
this."

A year and a half later, [[commons:Template:Clickable_button]] is still not
using mediawiki.ui.button, and usage elsewhere is not sufficiently widespread
to merit loading this stylesheet in the critical path.

Change-Id: I290e1db422b7c7b9c1a026aae22e174580cefae9
---
M RELEASE-NOTES-1.26
M includes/skins/SkinTemplate.php
2 files changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/89/235289/1

diff --git a/RELEASE-NOTES-1.26 b/RELEASE-NOTES-1.26
index 2774a27..4050754 100644
--- a/RELEASE-NOTES-1.26
+++ b/RELEASE-NOTES-1.26
@@ -64,6 +64,10 @@
   for potentially slow POST requests that need to be as atomic as possible.
 * ResourceLoader now loads all scripts asynchronously. The top-queue and
   startup modules are no longer synchronously loaded.
+* 'mediawiki.ui.button' styles are no longer unconditionally loaded on every
+  page. During the deprecation period, the styles will only be loaded on pages
+  which contain 'mw-ui-button' in their HTML. Starting in 1.28, the styles will
+  only be loaded if explicitly required.
 
 ==== External libraries ====
 * Update es5-shim from v4.0.0 to v4.1.5.
diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php
index a1844a8..baf9d95 100644
--- a/includes/skins/SkinTemplate.php
+++ b/includes/skins/SkinTemplate.php
@@ -54,12 +54,18 @@
                $moduleStyles = array(
                        'mediawiki.legacy.shared',
                        'mediawiki.legacy.commonPrint',
-                       'mediawiki.ui.button',
                        'mediawiki.sectionAnchor'
                );
                if ( $out->isSyndicated() ) {
                        $moduleStyles[] = 'mediawiki.feedlink';
                }
+
+               // Deprecated since 1.26: Unconditional loading of 
mediawiki.ui.button
+               // on every page is deprecated. Express a dependency instead.
+               if ( strpos( $out->getHTML(), 'mw-ui-button' ) !== false ) {
+                       $moduleStyles[] = 'mediawiki.ui.button';
+               }
+
                $out->addModuleStyles( $moduleStyles );
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/235289
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I290e1db422b7c7b9c1a026aae22e174580cefae9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.26wmf20
Gerrit-Owner: Ori.livneh <o...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to