resourceloader: Async all the way

This commit no longer exists in the repository. It may have been part of a branch which was deleted.This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or ref.


resourceloader: Async all the way

Page startup:

  • Due to the startup module and top queue being asynchronous now, move client-nojs/client-js class handling to OutputPage to ensure there is no flashes of wrongly styled or unstyled content.

    To preserve compatibility for unsupported browsers, undo the class swap at runtime after the isCompatible() check.

ResourceLoader startup module:

  • Load the startup module with <script async>.
  • Use DOM methods instead of 'document.write' to create base module request (jquery|mediawiki).


  • Drop 'async' parameter from mw.loader.load().
  • Remove the now-unused code paths for synchronous requests.


  • Drop '$loadCall' parameter from makeResourceLoaderLink(). Asynchronous is now the default and only way to load JavaScript. This means the 'user' module "conditional document-write scripts" are now a simple "mw.loader.load( url )" call.
  • Fix incorrect @return of makeResourceLoaderLink(). This returns an array not a string.
  • Improve documentation of makeResourceLoaderLink().
  • Drop '$inHead' parameter from getScriptsForBottomQueue(). No longer used. Compatibility with the $wgResourceLoaderExperimentalAsyncLoading feature is maintained. It just no longer needs to change the way the queue works since it's always asynchronous. The feature flag now only controls whether the bottom queue starts at the bottom or starts at the top.
  • Remove jQuery.ready() optimisation. This was mostly there to avoid the setTimeout() loop jQuery does to detect dom-ready in IE6/IE7 (which we no longer serve JavaScript at all). And for a bug in Firefox with document.write (which is no longer used as of this commit).

Bug: T107399
Change-Id: Icba6d7a87b239bf127a221bc6bc432cfa71a4a72


KrinkleAuthored on
oriCommitted on Aug 6 2015, 11:11 PM

Commit No Longer Exists

This commit no longer exists in the repository.