resourceloader: Add internal RLPAGEMODULES constant
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 17 Sep 2018 23:48:14 +0000 (00:48 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 18 Sep 2018 00:10:01 +0000 (01:10 +0100)
commitf22b3b81f9e30365536d4bc7b1b1bb827ae413fa
tree9d3a18db0d1bfe9b7d3b7b4f7e9634094bb84bf7
parent0a5757cda86b29462bddfbbc1c143811097bfef1
resourceloader: Add internal RLPAGEMODULES constant

Expose this constant for internal use by Navigation Timing,
so that it can compute mwLoadEnd based on when these modules
finish loading.

The way mwLoadEnd is currently computed is by building a list
of all registered module names, and narrowing it down to the
ones in 'loading' state at the time that ext.navigationTiming.js
executes. The problem with doing that, is that it is includes
various lazy-loaded modules that aren't critical to the page and
aren't meant to be tracked by that metric. For example:

* Preloading of modules from various extensions (including VE,
  and Popups).
* Background chains for EventLogging schemas from mw.loader.using,
  including the one started by Navigation Timing itself.
  On my local install, the list of filtered down modules always
  includes 'schema.SaveTiming', '...rumSpeedIndex', etc.

Exporting the list passed to the initial load() call as constant
will enable Navigation Timing to instead only await only those
modules (and their dependneices).

Bug: T204426
Change-Id: Ida134b4dfee218db16c2d1f88d4f26e8d761e154
includes/resourceloader/ResourceLoaderClientHtml.php
tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php