resourceloader: Remove 'user.styles' dependency from 'user' module
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 23 May 2018 14:53:33 +0000 (15:53 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Wed, 23 May 2018 14:53:33 +0000 (15:53 +0100)
commit1c657b06e814fd057a915a7aa701edaf4dd8a7e4
tree56606bcd9fb1f543ad1d7c9f0ccdae03cd610859
parente946bd1432e935dbf77b12dbcf7379ae32d4661c
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
includes/resourceloader/ResourceLoaderUserModule.php