resourceloader: Restore mw.loader.store update postponing logic
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 23 Aug 2018 02:16:06 +0000 (03:16 +0100)
committerRoan Kattouw <roan.kattouw@gmail.com>
Mon, 27 Aug 2018 21:16:05 +0000 (14:16 -0700)
commitd269e1d91f76719fcf6f3e08175ba4a0a1ce0a17
tree9355b404708a220cbd11a97be6c86527770bf27c
parentec88ffd230b71075f520ebd6567fcf9d1a8fa1fa
resourceloader: Restore mw.loader.store update postponing logic

* Document the conditional that disables mw.loader.store if
  localStorage is unavailable. `raw === undefined` is correct,
  but can be confusing given it can also be null, and we
  specifically don't want to disable the store in that case.
  We only disable the store if raw is undefined.

* Remove the call to mw.loader.store.update() in init().
  If 0 modules were to load on the current page, there is little
  value in flushing an empty `items` object.
  If any modules load, they will be set() in the store and
  schedule an update() at that time, which is preferred and avoids
  unexpected overhead.

* Remove store.enabled check from prune(). It is only called
  from update(), which checks it already.
* Remove boolean return from set(). Not used.

* Remove boolean return from prune(). Not used.

* Restore the 2-second setTimeout debounce from 2013 (c719401661e),
  which got lost in the 2015 refactor (4174b662f623).
  This makes the documentation true again.

* Document the store singleton as @private. It will still be
  indexed by JSDuck and listed in the sidebar (under "private"),
  but will not be listed on the homepage, and the class' page
  will have a notice about it being a private API.

Bug: T202598
Change-Id: Ic0d4a15c241df391ab5f824ca9e754c3938ea108
maintenance/jsduck/categories.json
resources/src/startup/mediawiki.js