resoureloader: Restore support for plain callbacks in mediawiki.base's RLQ
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 26 Oct 2018 21:33:26 +0000 (14:33 -0700)
committerTimo Tijhof <krinklemail@gmail.com>
Fri, 26 Oct 2018 21:33:26 +0000 (14:33 -0700)
commitcb7e0ea507c55b49fd22f734fbfe048fe87d5557
tree5b5c33d71db97ffcc88eb555348bb82e37eadc65
parentcb4d4c4d8f4884bfe18b1e69c0d1bc2d8d567d5c
resoureloader: Restore support for plain callbacks in mediawiki.base's RLQ

Follows-up dec800968e, which moved the processing of callbacks that require
'modules' from startup.js to mediawiki.base.js.

In doing so, it made an incorrect assumption. It assumed that the simple
signature of RLQ.push(Function) is not needed after 'mediawiki.base' loads.

It is true that RLQ.push() is mostly an internal interface, and we only
use it from within the HTML output, and that once the async pipeline has
finished and startup.js has processed the simple callbacks, only calls with
secondary signatures remain in the queue.

But, while it is true that we don't use RLQ.push() outside the HTML, it is
not true that the HTML will fully load and execute inline scripts before
any of the async scripts execute. As such, the call to RLQ.push() in the
HTML footer was sometimes being ignored because 'mediawiki.base' had already
loaded by now.

Bug: T208093
Change-Id: I25012a2c6f41968b1b4f85614a3bc0416512d530
resources/src/mediawiki.base/mediawiki.base.js
resources/src/startup/startup.js
tests/qunit/suites/resources/mediawiki/mediawiki.base.test.js