* Support for the deprecated hook MagicWordMagicWords was removed.
* The Xml::namespaceSelector method has been deprecated, please use
Html::namespaceSelector instead (note that the parameters have changed also).
+* (bug 33746) Preload popular ResourceLoader modules (mediawiki.util) as stop-gap
+ for scripts missing dependencies.
+ New configuration variable $wgPreloadJavaScriptMwUtil has been introduced for this
+ (set to false by default for new installations). Set to true if your wiki has a large
+ amount of user/site scripts that are lacking dependency information. In the short to
+ medium term these user/site scripts should be fixed by adding the used modules to the
+ dependencies in the module registry and/or wrapping them in a callback to mw.loader.using.
== Compatibility ==
*/
$wgIncludeLegacyJavaScript = true;
+/**
+ * Whether to preload the mediawiki.util module as blocking module in the top queue.
+ * Before MediaWiki 1.19, modules used to load slower/less asynchronous which allowed
+ * modules to lack dependencies on 'popular' modules that were likely loaded already.
+ * This setting is to aid scripts during migration by providing mediawiki.util
+ * unconditionally (which was the most commonly missed dependency).
+ * It doesn't cover all missing dependencies obviously but should fix most of them.
+ * This should be removed at some point after site/user scripts have been fixed.
+ * Enable this if your wiki has a large amount of user/site scripts that are lacking
+ * dependencies.
+ */
+$wgPreloadJavaScriptMwUtil = false;
+
/**
* Whether or not to assing configuration variables to the global window object.
* If this is set to false, old code using deprecated variables like:
* Add the default ResourceLoader modules to this object
*/
private function addDefaultModules() {
- global $wgIncludeLegacyJavaScript, $wgUseAjax, $wgAjaxWatch, $wgEnableMWSuggest;
+ global $wgIncludeLegacyJavaScript, $wgPreloadJavaScriptMwUtil, $wgUseAjax,
+ $wgAjaxWatch, $wgEnableMWSuggest;
// Add base resources
$this->addModules( array(
'mediawiki.user',
- 'mediawiki.util',
'mediawiki.page.startup',
'mediawiki.page.ready',
) );
$this->addModules( 'mediawiki.legacy.wikibits' );
}
+ if ( $wgPreloadJavaScriptMwUtil ) {
+ $this->addModules( 'mediawiki.util' );
+ }
+
// Add various resources if required
if ( $wgUseAjax ) {
$this->addModules( 'mediawiki.legacy.ajax' );
'jquery.mwExtension',
),
'messages' => array( 'showtoc', 'hidetoc' ),
+ 'position' => 'top', // For $wgPreloadJavaScriptMwUtil
),
/* MediaWiki Action */