resourceloader: Clean up and better document module list (un)packing
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 1 Mar 2018 00:23:02 +0000 (16:23 -0800)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 6 Mar 2018 23:59:13 +0000 (15:59 -0800)
commitdc8550ea24cd80eb2cca16a8de51ab1be5ca0e31
tree094f224cd61f70df556c80815c5eae81b2c9bbba
parent6e65e0ab0d0dc5e7e0ea000f024a3481da35505b
resourceloader: Clean up and better document module list (un)packing

* Move buildModulesString() call from doRequest() to batchRequest()

  This keeps all module string "packing" logic located to the same function,
  which is batchRequest(). It also means that the moduleMap object will not
  leave the function, which helps in maintenance given it's very internal.

* Add comments to all the methods referring to each other.

* Explain why buildModulesString() is only a partial port, and the rest is
  inlined in batchRequest().

* Minor changes to the JS and PHP implementation to better match each other.
  - '$groups' -> '$moduleMap'.
  - Remove redundant '$str'.

Bug: T188076
Change-Id: I7b0790606c456e492ab682faeb80f7e7fce7d9f8
includes/resourceloader/ResourceLoader.php
includes/resourceloader/ResourceLoaderContext.php
resources/src/mediawiki/mediawiki.js