From e8b46e5e6660c9fbce01c982e98c7662b135a130 Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Sun, 20 Apr 2014 14:01:21 -0700 Subject: [PATCH] Deprecate ResourceLoaderGetStartupModules 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 | 1 + docs/hooks.txt | 2 +- includes/resourceloader/ResourceLoaderStartUpModule.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23 index 2b1dba354f..22520d3a57 100644 --- a/RELEASE-NOTES-1.23 +++ b/RELEASE-NOTES-1.23 @@ -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. diff --git a/docs/hooks.txt b/docs/hooks.txt index de4bc3b1e6..80f388bd90 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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 diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index 005081ce8b..5ff88d8633 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -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(); -- 2.20.1