Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -321,6 +321,13 @@ |
322 | 322 | * Support for the deprecated hook MagicWordMagicWords was removed. |
323 | 323 | * The Xml::namespaceSelector method has been deprecated, please use |
324 | 324 | Html::namespaceSelector instead (note that the parameters have changed also). |
| 325 | +* (bug 33746) Preload popular ResourceLoader modules (mediawiki.util) as stop-gap |
| 326 | + for scripts missing dependencies. |
| 327 | + New configuration variable $wgPreloadJavaScriptMwUtil has been introduced for this |
| 328 | + (set to false by default for new installations). Set to true if your wiki has a large |
| 329 | + amount of user/site scripts that are lacking dependency information. In the short to |
| 330 | + medium term these user/site scripts should be fixed by adding the used modules to the |
| 331 | + dependencies in the module registry and/or wrapping them in a callback to mw.loader.using. |
325 | 332 | |
326 | 333 | == Compatibility == |
327 | 334 | |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2439,12 +2439,12 @@ |
2440 | 2440 | * Add the default ResourceLoader modules to this object |
2441 | 2441 | */ |
2442 | 2442 | private function addDefaultModules() { |
2443 | | - global $wgIncludeLegacyJavaScript, $wgUseAjax, $wgAjaxWatch, $wgEnableMWSuggest; |
| 2443 | + global $wgIncludeLegacyJavaScript, $wgPreloadJavaScriptMwUtil, $wgUseAjax, |
| 2444 | + $wgAjaxWatch, $wgEnableMWSuggest; |
2444 | 2445 | |
2445 | 2446 | // Add base resources |
2446 | 2447 | $this->addModules( array( |
2447 | 2448 | 'mediawiki.user', |
2448 | | - 'mediawiki.util', |
2449 | 2449 | 'mediawiki.page.startup', |
2450 | 2450 | 'mediawiki.page.ready', |
2451 | 2451 | ) ); |
— | — | @@ -2452,6 +2452,10 @@ |
2453 | 2453 | $this->addModules( 'mediawiki.legacy.wikibits' ); |
2454 | 2454 | } |
2455 | 2455 | |
| 2456 | + if ( $wgPreloadJavaScriptMwUtil ) { |
| 2457 | + $this->addModules( 'mediawiki.util' ); |
| 2458 | + } |
| 2459 | + |
2456 | 2460 | // Add various resources if required |
2457 | 2461 | if ( $wgUseAjax ) { |
2458 | 2462 | $this->addModules( 'mediawiki.legacy.ajax' ); |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2605,6 +2605,19 @@ |
2606 | 2606 | $wgIncludeLegacyJavaScript = true; |
2607 | 2607 | |
2608 | 2608 | /** |
| 2609 | + * Whether to preload the mediawiki.util module as blocking module in the top queue. |
| 2610 | + * Before MediaWiki 1.19, modules used to load slower/less asynchronous which allowed |
| 2611 | + * modules to lack dependencies on 'popular' modules that were likely loaded already. |
| 2612 | + * This setting is to aid scripts during migration by providing mediawiki.util |
| 2613 | + * unconditionally (which was the most commonly missed dependency). |
| 2614 | + * It doesn't cover all missing dependencies obviously but should fix most of them. |
| 2615 | + * This should be removed at some point after site/user scripts have been fixed. |
| 2616 | + * Enable this if your wiki has a large amount of user/site scripts that are lacking |
| 2617 | + * dependencies. |
| 2618 | + */ |
| 2619 | +$wgPreloadJavaScriptMwUtil = false; |
| 2620 | + |
| 2621 | +/** |
2609 | 2622 | * Whether or not to assing configuration variables to the global window object. |
2610 | 2623 | * If this is set to false, old code using deprecated variables like: |
2611 | 2624 | * " if ( window.wgRestrictionEdit ) ..." |
Index: trunk/phase3/resources/Resources.php |
— | — | @@ -592,6 +592,7 @@ |
593 | 593 | 'jquery.mwExtension', |
594 | 594 | ), |
595 | 595 | 'messages' => array( 'showtoc', 'hidetoc' ), |
| 596 | + 'position' => 'top', // For $wgPreloadJavaScriptMwUtil |
596 | 597 | ), |
597 | 598 | |
598 | 599 | /* MediaWiki Action */ |