Page MenuHomePhabricator

Light-weight tour launcher module
Closed, ResolvedPublic

Description

mediawiki.libs.guiders, ext.guidedTour.lib, and ext.guidedTour.styles are loading on every page for anons on enwiki, where they represent the biggest, second biggest, and fourth biggest ResourceLoader modules. This can't be right -- you should use the lightweight init module pattern instead.


Version: master
Severity: major

Details

Reference
bz65734

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:21 AM
bzimport set Reference to bz65734.

swalling wrote:

(In reply to Ori Livneh from comment #0)

mediawiki.libs.guiders, ext.guidedTour.lib, and ext.guidedTour.styles are
loading on every page for anons on enwiki, where they represent the biggest,
second biggest, and fourth biggest ResourceLoader modules. This can't be
right -- you should use the lightweight init module pattern instead.

In the short term, we're disabling the A/B test that is causing these to load (https://gerrit.wikimedia.org/r/#/c/135560/). That will get done hopefully today.
If, after analysis, we want to re-enable any of these tours for anonymous users, we'll be sure to review this issue beforehand. Matt and Sam may have some comments as well.

(In reply to Steven Walling from comment #1)

In the short term, we're disabling the A/B test that is causing these to
load (https://gerrit.wikimedia.org/r/#/c/135560/). That will get done
hopefully today.
If, after analysis, we want to re-enable any of these tours for anonymous
users, we'll be sure to review this issue beforehand. Matt and Sam may have
some comments as well.

Many thanks for acting quickly!

swalling wrote:

(In reply to Ori Livneh from comment #2)

(In reply to Steven Walling from comment #1)

In the short term, we're disabling the A/B test that is causing these to
load (https://gerrit.wikimedia.org/r/#/c/135560/). That will get done
hopefully today.
If, after analysis, we want to re-enable any of these tours for anonymous
users, we'll be sure to review this issue beforehand. Matt and Sam may have
some comments as well.

Many thanks for acting quickly!

No problem. It just so happens the seven day test is over. ;)

As Steven said, the experiment was coincidentally ending anyway.

The issue here is that although the tours were not auto-loaded regardless of an anon's actions, 'ext.gettingstarted.anonymousEditorAcquisition' was, which depends on 'ext.guidedTour.lib' (which then has transitive dependencies on other stuff), since launchTour was called as needed.

Since mw.guidedTour.launchTour is already async, we could just make a trivial launcher module, such that mw.guidedTour.launcher.launchTour (or whatever we call it) handled the mw.loader.using then called the real launchTour.

Then, we could mark mw.guidedTour.launchTour as @private, and discourage use outside the library code itself.

If people like this idea, I'll pivot the bug to that.

Side note, I think the main issue with ext.guidedTour.styles is probably the data URL @embeds (http://bits.wikimedia.org/en.wikipedia.org/load.php?debug=true\u0026lang=en&modules=ext.guidedTour.styles&only=styles&skin=vector&*).

There are two:

  • X button - ext.guidedTour.x.svg (data:image/svg+xml...); this is repeated twice for vendor prefixes, but gzip should greatly minimize the impact of that (not sure if that's taken in account in the 4th measurement)
  • Arrows - ext.guidedTour.arrows.png - This is bug. Sam is working on https://trello.com/c/KNOy96ga/426-how-to-redraw-the-pokey . If that's successful, we can draw the arrows in CSS and greatly reduce the size.

In the meantime, this spurred me to crush our PNGs with optipng, which is some low-hanging fruit: https://gerrit.wikimedia.org/r/#/c/135739/

Change 136788 had a related patch set uploaded by Phuedx:
Add a lightweight launcher for guided tours

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

Change 136794 had a related patch set uploaded by Phuedx:
Use the lightweight tour launcher

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

Change 136788 merged by jenkins-bot:
Add a lightweight launcher for guided tours

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

Change 136794 merged by jenkins-bot:
Use the lightweight tour launcher

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