Page MenuHomePhabricator

Large ext.flaggedRevs.advanced module is loaded for anonymous users
Open, HighPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

  • mw.loader.getState('ext.flaggedRevs.advanced') === 'ready' but none of that code seems to be utilized on the page. The ext.flaggedRevs.advanced module is very resource intensive - loading more than 300kb of JS.

What should have happened instead?:

  • The ext.flaggedRevs.advanced should not be loaded if it is not being used.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

There is one thing that seems to be utilized. When I change the advanced to be loaded only for reviwers, loading a page locally logged out doesn't show the tooltip when you hover over the icon:

grafik.png (107×136 px, 2 KB)

Moving that to basic shouldn't be hard.

{{ec}}

As far as I understand, it powers the review state box visible on the top right on https://ru.wikipedia.org/wiki/%D0%97%D0%B0%D0%B3%D0%BB%D0%B0%D0%B2%D0%BD%D0%B0%D1%8F_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0?safemode=1 – ruwiki uses Common.css to hide the box, but FlaggedRevs cannot know this in advance. I see two options:

  • Introduce a LocalSettings.php variable that allows hiding the box on the main page. I don’t know how complicated this would be, and it would only help on the main page (although the main page is probably the most performance-sensitive one, so it may still make sense).
  • Try to split the module to download only the absolutely necessary parts. This decreases the amount of JS downloaded by the module, but increases the number of RL modules.

And in any case, migrate it from OOUI to Codex if possible, so that OOUI doesn’t have to be downloaded at all.

{{ec}}

As far as I understand, it powers the review state box visible on the top right on https://ru.wikipedia.org/wiki/%D0%97%D0%B0%D0%B3%D0%BB%D0%B0%D0%B2%D0%BD%D0%B0%D1%8F_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0?safemode=1 – ruwiki uses Common.css to hide the box, but FlaggedRevs cannot know this in advance. I see two options:

  • Introduce a LocalSettings.php variable that allows hiding the box on the main page. I don’t know how complicated this would be, and it would only help on the main page (although the main page is probably the most performance-sensitive one, so it may still make sense).
  • Try to split the module to download only the absolutely necessary parts. This decreases the amount of JS downloaded by the module, but increases the number of RL modules.

Wonder if we can turn ext.flaggedRevs.basic to include js as well and move those parts there.

And in any case, migrate it from OOUI to Codex if possible, so that OOUI doesn’t have to be downloaded at all.

+1

Since this is impacting performance (and thus likely SEO) anonymous page views on certain wikis bumping to high priority. I can help out with this week of 9th if needed. We can switch to Codex markup without loading Vue.js by using the CSS only version (https://doc.wikimedia.org/codex/latest/components/demos/button.html#css-only-version)
I'm also attending the hackathon if we want to do this in person.

Another option for ruWP might be to turn on the ‘basic’ experience by default since we don't seem to show the ‘advanced’ version to IP users and I would argue ‘advanced’ option is pretty, for the lack of the technical term, shit for everyone else as well. That whole interface really needs a redesign, but in the case of Russian Wikipedia, I think switching it off might be a proper solution as well.

Change #1020418 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/FlaggedRevs@master] WIP: FlaggedRevisions should not use OOUI for rendering icons

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