Page MenuHomePhabricator

Minimise the initial load of ULS on desktop pages
Closed, ResolvedPublic

Description

ULS loads 26kb of JavaScript [1] (after gzip) to every desktop page. However most of this code goes unused, unless the user clicks the language button. It consists of the modules: ext.uls.compactlinks', 'ext.uls.geoclient', 'ext.uls.interface', - which ones loaded vary based on certain configuration options.

Ideally the uls-settings-trigger element would be rendered on the server side and a small amount of JavaScript would be added to the page, to make sure that the settings cog opens a dialog like so


Upon clicking, all the other modules should be loaded using client side checks rather than server side checks.

It's possible, we might want to compare code in Page previews with this feature - the UI component here is very similar, and this might benefit from a shared component in core.

Acceptance criteria

  • A single lightweight module is added to the page.
  • The module is not added on skins where it is not needed e.g. Minerva
  • The module has targets 'desktop' and 'mobile' so it loads on skins in the mobile domain.

[1] For comparison, VisualEditor is 10.7kb and Page previews is a delayed load of 18.5kb.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 31 2019, 10:25 PM
Jdlrobson updated the task description. (Show Details)Oct 31 2019, 10:30 PM
Restricted Application added a subscriber: Masumrezarock100. · View Herald TranscriptOct 31 2019, 10:30 PM
ovasileva triaged this task as Medium priority.Nov 4 2019, 7:14 PM
ovasileva moved this task from Incoming to Triaged but Future on the Readers-Web-Backlog board.

Change 631885 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/UniversalLanguageSelector@master] WIP: Reduce JS loaded on critical path

https://gerrit.wikimedia.org/r/631885

Change 631885 merged by jenkins-bot:
[mediawiki/extensions/UniversalLanguageSelector@master] Reduce JS loaded on critical path

https://gerrit.wikimedia.org/r/631885

Jdlrobson closed this task as Resolved.Oct 20 2020, 6:36 PM
Jdlrobson claimed this task.

Thanks all! Heads up to the performance team this should land in English Wikipedia thursday in case we see any positive changes there. We don't seem to monitor webpagetest on desktop beta cluster pages, so I will circle back in November to check on impact of this (have left note in my calendar).