resourceloader: Add $wgIncludejQueryMigrate option

Bug: T280944
Change-Id: I61aa56368bf8868f369dfc294b5d7b4435013670
This commit is contained in:
Timo Tijhof 2021-04-24 02:51:46 +01:00
parent 7f7015428a
commit bf62d08cd8
3 changed files with 21 additions and 4 deletions

View file

@ -42,6 +42,8 @@ is no longer recommended and the option has been removed.
* (T157145) $wgSkinMetaTags This setting allows configuration of skins to
support meta tags. These tags make sharing of MediaWiki pages on a variety of
social platforms more contentful and thus useful.
* (T280944) $wgIncludejQueryMigrate - This setting allows the jQuery Migrate
plugin to be disabled. It has been enabled by default since MediaWiki 1.27.
* …
==== Changed configuration ====

View file

@ -4411,6 +4411,17 @@ $wgResourceLoaderDebug = false;
*/
$wgIncludeLegacyJavaScript = false;
/**
* Whether to load the jquery.migrate library.
*
* This provides jQuery 1.12 features that were removed in jQuery 3.0.
* See also <https://jquery.com/upgrade-guide/3.0/> and
* <https://phabricator.wikimedia.org/T280944>.
*
* @deprecated since 1.36
*/
$wgIncludejQueryMigrate = true;
/**
* ResourceLoader will not generate URLs whose query string is more than
* this many characters long, and will instead use multiple requests with

View file

@ -116,10 +116,14 @@ return [
// These modules' dependencies MUST be dependency-free (having dependencies would cause recursion).
'jquery' => [
'scripts' => [
'resources/lib/jquery/jquery.js',
'resources/lib/jquery/jquery.migrate.js',
],
'scripts' => ( $GLOBALS['wgIncludejQueryMigrate'] ?
[
'resources/lib/jquery/jquery.js',
'resources/lib/jquery/jquery.migrate.js',
] : [
'resources/lib/jquery/jquery.js'
]
),
'targets' => [ 'desktop', 'mobile' ],
],
'es6-polyfills' => [