resourceloader: Make cache-eval in mw.loader.work asynchronous
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 17 Oct 2016 18:01:14 +0000 (19:01 +0100)
committerOri.livneh <ori@wikimedia.org>
Thu, 20 Oct 2016 00:03:01 +0000 (00:03 +0000)
commit2a895edbd23f796206e26fb7d08a79fe6c653103
tree718e51aefa0cc39b38e26fbf35c626dde0dc5244
parent269a6a0a0391442a882007241e9ada99c57206b7
resourceloader: Make cache-eval in mw.loader.work asynchronous

This is an amended version of reverted commit 482ad8d9fb2e.

The difference is that this change is smaller.

We keep the eval as one large chunk. Not split up in <=50ms chunks and
spread out based on how fast code executes on the device. This means we keep
the issue of an irresponsive UI thread during execution, and trade it for
finishing quicker. This doesn't feel right, but is something we should change
separately, later because it has side-effects (T146510).

Doing it in one chunk is the status quo as we've had it for the last two
years. This commit merely defers the big eval chunk to one tick later so
that higher priority work may happen first (e.g. rendering).

Bug: T142129
Change-Id: I2b31b27554cd29b48d986ed6a6f698a77e59c0e5
resources/src/mediawiki/mediawiki.js