resourceloader: Move per-page function calls to startup.js
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 8 May 2019 17:24:07 +0000 (18:24 +0100)
committerCatrope <roan@wikimedia.org>
Wed, 8 May 2019 21:23:59 +0000 (21:23 +0000)
commitcd45307ba16230d880ad062da7ccde6fa086729c
tree8e9e11c3a6c47d50d8a25c5cfd0dc0729097fd64
parent2c23c564e37320f99a4be0f77c954e910b38eaa6
resourceloader: Move per-page function calls to startup.js

Turn these embedded function calls into variable declarations,
later consumed by startup.js.

This has a few benefits:

* Variables can be declared immediately, without needing to
  defer it to after mw.loader arrives from startup, via an RLQ
  callback. This makes the inline script simpler and a tiny
  bit smaller.

* By moving the actual function calls to startup.js, they could
  easily be re-arranged in the future or migrated in other ways
  without needing to worry about HTML caching and keeping concurrent
  compatibility with both orders of execution.

Change-Id: I1c995a9572d9eb3201a565341c19bdf81ab00eff
includes/resourceloader/ResourceLoaderClientHtml.php
tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php