From: Timo Tijhof Date: Wed, 23 May 2018 14:53:33 +0000 (+0100) Subject: resourceloader: Remove 'user.styles' dependency from 'user' module X-Git-Tag: 1.34.0-rc.0~5332^2 X-Git-Url: http://git.cyclocoop.org/data/%7BGarradin/WEBSITE%7D?a=commitdiff_plain;h=1c657b06e814fd057a915a7aa701edaf4dd8a7e4;p=lhc%2Fweb%2Fwiklou.git resourceloader: Remove 'user.styles' dependency from 'user' module Follows-up c3f200849b99721, which made isKnownEmpty() return false for modules that have dependencies. This had the side-effect of causing the 'user' module to be loaded in its own HTTP request on all page views, even for logged-out users and for registered users without scripts, because it has a dependency on the 'user.styles' module. This commit fixes that regression by removing the dependency so that the 'user' module can, once again, be considered "empty". The dependency isn't needed. It was only added for the transitional period after the 'user' module was split up so that existing cached views for logged-in users (in theory, e.g. 304 Not Modified) would still trigger a load for the styles. But that transition ended over a year ago. Now, both modules act independently and are always queued separately, with user.styles explicitly added as a style module (as it should be). Even for the case of an AJAX preview (if it is somehow possible for the 'user' module to not be loaded already), the API would respond with a module list that contains both 'user' and 'user.styles'. Bug: T195380 Change-Id: I9852516af1bd55c84a9213628c7796e2c2168745 --- diff --git a/includes/resourceloader/ResourceLoaderUserModule.php b/includes/resourceloader/ResourceLoaderUserModule.php index e747373e1a..026cea101e 100644 --- a/includes/resourceloader/ResourceLoaderUserModule.php +++ b/includes/resourceloader/ResourceLoaderUserModule.php @@ -77,12 +77,4 @@ class ResourceLoaderUserModule extends ResourceLoaderWikiModule { public function getGroup() { return 'user'; } - - /** - * @param ResourceLoaderContext|null $context - * @return array - */ - public function getDependencies( ResourceLoaderContext $context = null ) { - return [ 'user.styles' ]; - } }