From 482ad8d9fb2e8273cefc4a5a557604b093944c8b Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 10 Aug 2016 18:39:30 -0700 Subject: [PATCH] resourceloader: Make cache-eval in mw.loader.work asynchronous * Add 'if !batch.length' in work() to avoid needless initialisation of mw.loader.store(). work() can be called without anything in the batch because using() will call enqueue() for any non-ready modules in order to get a job callback. This will invoke work() as side-effect but will have no work to do. This was previously here but got moved in 488c5d9. * Add 'if !implementations.length' to avoid needless scheduling of an idle callback when none of the modules in the batch are found in local storage (e.g. first view). Bug: T142129 Change-Id: Icd39423aec35f25162d2443b1f0507f6f0c748a3 --- resources/src/mediawiki/mediawiki.js | 78 +++++++++++++++++++--------- 1 file changed, 53 insertions(+), 25 deletions(-) diff --git a/resources/src/mediawiki/mediawiki.js b/resources/src/mediawiki/mediawiki.js index 7ceb5fe9ee..122f232736 100644 --- a/resources/src/mediawiki/mediawiki.js +++ b/resources/src/mediawiki/mediawiki.js @@ -1195,7 +1195,7 @@ // Force jQuery behaviour to be for crossDomain. Otherwise jQuery would use // XHR for a same domain request instead of