Move contents of mediawiki.legacy.commonPrint into ResourceLoaderSkinModule

Use the existing `legacy` feature. It's assumed that this module was always
used with `mediawiki.legacy.shared` and minimizes disruptions given the
migration steps are identical to the approach taken in `mediawiki.legacy.shared`

The existing release notes are updated to reflect this.

Bug: T242177
Change-Id: I785321d86a5f26808eb83847a3dbbbe62c62698c
This commit is contained in:
jdlrobson 2020-03-12 14:53:48 -07:00 committed by Jdlrobson
parent bc72208733
commit ecac8e1f96
6 changed files with 18 additions and 18 deletions

View file

@ -125,11 +125,12 @@ For notes on 1.34.x and older releases, see HISTORY.
removed in 1.36.
* The ParserPreSaveTransformComplete hook was added.
* The ResourceLoaderSkinModule class now has a "legacy" feature that loads
the stylesheets previously part of the "mediawiki.legacy.shared" module.
The latter is now deprecated and no longer loaded by skins. For skins needing
to retain these styles, you will need to load these styles via a module
using the ResourceLoaderSkinModule class. See Vector and Monobook for
examples.
the stylesheets previously part of the "mediawiki.legacy.shared" and
"mediawiki.legacy.commonPrint" module.
Those modules are now deprecated and no longer loaded by skins.
For skins needing to retain these styles, you will need to load these
styles via a module using the ResourceLoaderSkinModule class.
See Vector and Monobook for examples.
* ParserOutput now has methods addExtraCSPStyleSrc, addExtraCSPDefaultSrc
addExtraCSPScriptSrc for parser tags/functions to be able to add sources
to the Content Security Policy.
@ -384,9 +385,10 @@ because of Phabricator reports.
* OutputPage::parserOptions doesn't accept an $options parameter anymore.
* MessageCache::getParserOptions previously did not have a visibility set.
It has been made private.
* The Skin no loader loads the "mediawiki.legacy.shared" module. The legacy
shared styles must now be loaded by the skin explicitly, either inherited via
the "mediawiki.skinning.*" modules, or by making your skin's main styles
* The Skin no longer loads the "mediawiki.legacy.shared" or
"mediawiki.legacy.commonPrint" modules. The legacy shared styles must now
be loaded by the skin explicitly, either inherited via the
"mediawiki.skinning.*" modules, or by making your skin's main styles
module use the ResourceLoaderSkinModule class with the "legacy" attribute.
See Vector and Monobook for examples.
* …

View file

@ -92,6 +92,7 @@ class ResourceLoaderSkinModule extends ResourceLoaderFileModule {
'screen' => [ 'resources/src/mediawiki.skinning/elements.css' ],
],
'legacy' => [
'print' => [ 'resources/src/mediawiki.skinning/commonPrint.css' ],
'screen' => [ 'resources/src/mediawiki.skinning/legacy.less' ],
],
'i18n-ordered-lists' => [

View file

@ -170,13 +170,11 @@ abstract class Skin extends ContextSource {
// for ALL users, on ALL pages, in ALL skins.
// Keep this list as small as possible!
$modules = [
// The 'styles' key sets render-blocking style modules
// Unlike other keys in $modules, this is an associative array
// where each key is its own group pointing to a list of modules
'styles' => [
// The 'styles' key sets render-blocking style modules
// Unlike other keys in $modules, this is an associative array
// where each key is its own group pointing to a list of modules
'core' => [
'mediawiki.legacy.commonPrint',
],
'core' => [],
'content' => [],
'syndicate' => [],
],

View file

@ -2177,8 +2177,9 @@ return [
/* MediaWiki Legacy */
'mediawiki.legacy.commonPrint' => [
'deprecated' => 'Use ResourceLoaderSkinModule',
'styles' => [
'resources/src/mediawiki.legacy/commonPrint.css' => [ 'media' => 'print' ]
'resources/src/mediawiki.skinning/commonPrint.css' => [ 'media' => 'print' ]
],
],
'mediawiki.legacy.protect' => [

View file

@ -58,9 +58,7 @@ class SkinTemplateTest extends MediaWikiTestCase {
}
public function provideGetDefaultModules() {
$defaultStyles = [
'mediawiki.legacy.commonPrint',
];
$defaultStyles = [];
$buttonStyle = 'mediawiki.ui.button';
$feedStyle = 'mediawiki.feedlink';
return [