Mobile/ResourceLoader

Current state
Most JS and CSS in MobileFrontend are loaded 'manually' with a or produced in the skin like this:

$scriptLinks[] = $this->resourceLoaderLink( array( 'jquery.hidpi', 'mediawiki.hidpi' ), 'scripts', true, true );

which produces something like this:



The problem
Because the URLs including the 'version=XXXXXXXXXX' timestamp are embedded into HTML, they get cached and do not change when new code is pushed.

As a workaround, we have to clear the mobile varnish cache on each push to allow new JS code to act as expected.

How it's supposed to work
With $wgMFEnableResourceLoader on, RL modules defined with the 'target' set to 'mobile' will be loaded.

General code (in special pages etc) can add RL modules as they do on the desktop:

$this->getOutput->addModules( 'mediawiki.hidpi' );

and it'll get loaded dynamically, with the timestamp updated in the RL "startup module". This should cause code to update within about 5 minutes of deployment, since the startup module falls out of cache much more aggressively.

Moving things over

 * make sure the module definitions use 'target' => 'mobile'
 * if you don't, it won't be included in the mobile RL manifest and won't get loaded
 * make sure something does an addModules with the relevant modules
 * if need to retain compatibility with $wgMFEnableResourceLoader off, then also throw in a conditional check in SkinMobile.php to load it the old-fashioned way
 * make sure ResourceLoader concatenates all JS into a single file in production so that we don't get dozens of separate requests per each JS file

Possible more fixes
It doesn't look like MobileFrontend loads static styles through full RL right now (like the skin styles, that we want to come through even with JS is off). May need to add that in -- check how desktop handles statically-loaded styles vs dynamically-loaded ones.