resourceloader: Fold legacy modules into base modules request
authorTimo Tijhof <krinklemail@gmail.com>
Sun, 10 Apr 2016 02:05:14 +0000 (03:05 +0100)
committerKrinkle <krinklemail@gmail.com>
Tue, 11 Apr 2017 22:56:38 +0000 (22:56 +0000)
commit0ac6076b4c0848568868bf36b4d9506ad990160b
tree274a1f64b2667fbc6fc8b5d530a4471a1c6f032c
parent0beaa51bb1030a4482cd30b5ce7449604130d9d7
resourceloader: Fold legacy modules into base modules request

Follows-up 0ac4f998 (restore "blocking" legacy modules).

After d790562, legacy modules in the top queue were no longer consistently
loaded before the bottom queue due to the top queue being async.

The implied dependency was made explicit by 0ac4f998 by forcing all modules
to wait for legacy modules before executing.

This had the negative side-effect of putting an extra HTTP request between
the startup module request, base modules request, and actual execution
of page modules.

(Indentation aligns with when a request is triggered.)

Before:
 1. Request: Startup module.
   2. Request: Base modules
   3. Request: Legacy modules
     4. Page module request (or local store hit) and execution

After:
 1. Request: Startup module.
   2. Request: Base+legacy modules
     3. Page module request (or local store hit) and execution

This could alternatively be fixed by moving the top queue to be before
the embedded modules and enforcing the embed in a different way.
It could also be fixed by debouncing module load calls so they naturally
end up in the same request as page modules.

However for now I'm addressing this by adding legacy modules to the
list of modules in the initial load request from the startup module.

This was not possible before because the legacy wikibits had dependencies
and base modules cannot have dependencies. Fixed in I7f9f61ea81ad1ef.

Bug: T159911
Change-Id: I54f087655e1cde1b8ff1ca5fe56e82f7f7d80965
includes/resourceloader/ResourceLoaderStartUpModule.php
includes/skins/Skin.php
resources/src/mediawiki/mediawiki.js