resourceloader: Omit empty parameters from mw.loader.implement calls
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 9 Dec 2014 01:17:53 +0000 (01:17 +0000)
committerKrinkle <krinklemail@gmail.com>
Tue, 20 Jan 2015 23:11:05 +0000 (23:11 +0000)
commit4ce0c0da42acfbcc5c68527834f85436efd0ebc1
treecc24c31aab5c247926836c9bc4d17a4f50b1b697
parentd61ccd0183e24453f44ad9e540b16c7b367d7419
resourceloader: Omit empty parameters from mw.loader.implement calls

Follows-up ebeb297236.

Also:
* Add tests for ResourceLoader::makeLoaderImplementScript().
* Apply ResourceLoader::trimArray to makeLoaderImplementScript (new in c0c221bf).

As always, the client (updated in Ie32e7d6a3c) is backward-compatible with old
(cached) load.php module responses. However, the old client is not compatible
new load.php responses after this commit.

That's generally not an issue, as we don't cache the client very long (~ 5 min).
However people with their browser open and mw.loader clients initialised can
still make new module requests (e.g. modules loaded on-demand, such as when
previewing edits, clicking buttons etc.). That can easily be several hours after
initial page load. As such, client/server bound changes should always be
back-compat and deployed a reasonable time apart to reduce chances of active
sessions making subsequent requests. Ideally we'd find some solution to this in
the long-term, but handling this at all is better than what we usually do...

For deployment: Ensure this is deployed several days after Ie32e7d6a3c09f.

Change-Id: Ic8d7efe49b5d45e3f95a2f04e3a26a014b10af16
includes/resourceloader/ResourceLoader.php
tests/phpunit/includes/OutputPageTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderTest.php