Deprecate ResourceLoaderGetStartupModules
authorOri Livneh <ori@wikimedia.org>
Sun, 20 Apr 2014 21:01:21 +0000 (14:01 -0700)
committerOri Livneh <ori@wikimedia.org>
Sun, 20 Apr 2014 21:07:54 +0000 (14:07 -0700)
In bug 63240, Roan calls it a 'misfeature', which I think is exactly right. It
has been used as a lazy workaround for having to think about load-order,
dependency management, and race conditions.

Bug: 63240
Change-Id: Ic48ad39c6d3d166d6bb8f60dfdd5f95aa7ed16a6

RELEASE-NOTES-1.23
docs/hooks.txt
includes/resourceloader/ResourceLoaderStartUpModule.php

index 2b1dba3..22520d3 100644 (file)
@@ -57,6 +57,7 @@ production.
 * $wgProfileOnly is now deprecated; set the log file in
   $wgDebugLogGroups['profileoutput'] to replace it.
 * $wgMaxBacklinksInvalidate was removed; use $wgJobBackoffThrottling instead
+* Deprecated ResourceLoaderGetStartupModules hook.
 
 === New features in 1.23 ===
 * ResourceLoader can utilize the Web Storage API to cache modules client-side.
index de4bc3b..80f388b 100644 (file)
@@ -2096,7 +2096,7 @@ configuration variables to JavaScript. Things that depend on the current page
 or request state must be added through MakeGlobalVariablesScript instead.
 &$vars: array( variable name => value )
 
-'ResourceLoaderGetStartupModules': Run once the startup module is being
+'ResourceLoaderGetStartupModules': DEPRECATED. Run once the startup module is being
 generated. This allows you to add modules to the startup module. This hook
 should be used sparingly since any module added here will be loaded on all
 pages. This hook is useful if you want to make code available to module loader
index 005081c..5ff88d8 100644 (file)
@@ -238,7 +238,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
        public static function getStartupModulesUrl( ResourceLoaderContext $context ) {
                // The core modules:
                $moduleNames = array( 'jquery', 'mediawiki' );
-               wfRunHooks( 'ResourceLoaderGetStartupModules', array( &$moduleNames ) );
+               wfRunHooks( 'ResourceLoaderGetStartupModules', array( &$moduleNames ), '1.23' );
 
                // Get the latest version
                $loader = $context->getResourceLoader();