Page MenuHomePhabricator

Improve JS loading and execution for slow connections on MobileFrontend
Closed, ResolvedPublic

Description

Currently javascript lives at the bottom of the mobile page. This means on large pages on a slow internet connection the javascript for toggling sections will load at the end.

On very slow connections this can have the result of sections being collapsed whilst the user is reading an article.

To improve these we should consider loading javascript earlier, closing sections as they are loaded in the page with inline javascript and reducing the page size (see suggested enhancement bug 31011)


Version: unspecified
Severity: enhancement

Details

Reference
bz36633

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:20 AM
bzimport set Reference to bz36633.
bzimport added a subscriber: Unknown Object (MLST).

I went with this fix -
https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/MobileFrontend.git;a=commit;h=2bc935f081082fe37c2bce1002a21fe5966a431f

This closes sections and grays them out until the page has fully loaded. This avoids unexpected collapsing
A follow up commit is needed to prevent window.scrollTo happening in application.js - it should happen in the head instead as this is causing a jumping to the top of the page

Long term we need to reduce the initial page load by doing something like bug 31011

Closing in favour of more specific bugs such as bug 31011 and bug 40196