Page MenuHomePhabricator

Reduce module registrations from PageTriage
Open, MediumPublic

Description

As of April 2019, PageTriage registers 16 modules on all wikis where it is installed:

https://grafana.wikimedia.org/d/BvWJlaDWk/startup-manifest-size?orgId=1&var-wiki=enwiki&var-component=PageTriage&var-multiwiki=commonswiki&var-multiwiki=dewiki&var-multiwiki=enwiki

  • mediawiki.template.underscore
  • ext.pageTriage.external
  • jquery.badge.external
  • ext.pageTriage.init
  • ext.pageTriage.util
  • ext.pageTriage.models
  • jquery.tipoff
  • ext.pageTriage.views.list
  • ext.pageTriage.defaultTagsOptions
  • ext.pageTriage.externalTagsOptions
  • ext.pageTriage.defaultDeletionTagsOptions
  • ext.pageTriage.externalDeletionTagsOptions
  • ext.pageTriage.toolbarStartup
  • ext.pageTriage.article
  • ext.pageTriage.messages
  • ext.pageTriage.views.toolbar
startup data
["mediawiki.template.underscore","04nm6ui",[340,1139]],["ext.pageTriage.external","18hx74z"],["jquery.badge.external","0a62j20"],["ext.pageTriage.init","1cjhroj",[340]],["ext.pageTriage.util","0i8xh7b",[342]],["ext.pageTriage.models","1tlhfat",[342,1182,1183]],["jquery.tipoff","1f7lttn"],["ext.pageTriage.views.list","08sjy05",[344,343,1094,345,1107,1213,339]],["ext.pageTriage.defaultTagsOptions","1il2s2h"],["ext.pageTriage.externalTagsOptions","022h6x3",[347]],["ext.pageTriage.defaultDeletionTagsOptions","1cqlxka",[974,1173]],["ext.pageTriage.externalDeletionTagsOptions","0glogko",[349]],["ext.pageTriage.toolbarStartup","0sw7r96"],["ext.pageTriage.article","0yulkyf",[342,1182,1143,1213]],
["ext.pageTriage.messages","1ipi0o0",[343]],["ext.pageTriage.views.toolbar","1iyabaa",[350,348,344,341,1094,1107,1110,1213,1162,339]],

About ~1 KB (uncompressed)

  • Identify which bundles need to exist (modules that need to be queued via addModules or lazy-loaded).
  • Identify whether they have a common set of scripts that would justify a shared non-entrypoint dependency.
  • Merge the rest.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 504605 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/PageTriage@master] Remove unused ext.pageTriage.messages dependency from defaultDeletionTagsOptions

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

Change 504650 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/PageTriage@master] Merge ext.pageTriage.messages into the module that needs it

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

Change 504605 merged by jenkins-bot:
[mediawiki/extensions/PageTriage@master] Remove unused ext.pageTriage.messages dependency from defaultDeletionTagsOptions

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

Change 504650 merged by jenkins-bot:
[mediawiki/extensions/PageTriage@master] Merge ext.pageTriage.messages into the module that needs it

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

JTannerWMF subscribed.

This isn't within scope right now but we may work on it later.

Change 516245 had a related patch set uploaded (by Krinkle; owner: Krinkle):
[mediawiki/extensions/PageTriage@master] Merge 'ext.pageTriage.models' into 'ext.pageTriage.util'

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

Change 516245 merged by jenkins-bot:
[mediawiki/extensions/PageTriage@master] Merge module 'ext.pageTriage.models' into 'ext.pageTriage.util'

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

Change 604843 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/PageTriage@master] Merge PageTriageExternalDeletionTagsOptions into ExternalTagOptions

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

This isn't within scope right now but we may work on it later.

Is the growth team willing to review submitted patches?

Looks like there is only one patch left to review at https://gerrit.wikimedia.org/r/c/mediawiki/extensions/PageTriage/+/604843 , could someone take a look? TIA

Change 604843 merged by jenkins-bot:
[mediawiki/extensions/PageTriage@master] Merge PageTriageExternalDeletionTagsOptions into ExternalTagOptions

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

Change 665183 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/PageTriage@master] Merge defaultTagsOptions and defaultDeletionTagsOptions RL modules

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

Change 666335 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/PageTriage@master] Remove jquery.badge.external RL module

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

Change 666335 merged by jenkins-bot:
[mediawiki/extensions/PageTriage@master] Remove jquery.badge.external RL module

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

As of April 2019, PageTriage registers 16 modules on all wikis where it is installed:

https://grafana.wikimedia.org/d/BvWJlaDWk/startup-manifest-size?orgId=1&var-wiki=enwiki&var-component=PageTriage&var-multiwiki=commonswiki&var-multiwiki=dewiki&var-multiwiki=enwiki

As of Oct 2022, PageTriage registers 12 modules:

  1. mediawiki.template.underscore
  2. ext.pageTriage.external
  3. ext.pageTriage.init
  4. ext.pageTriage.util
  5. ext.pageTriage.views.list
  6. ext.pageTriage.defaultTagsOptions
  7. ext.pageTriage.externalTagsOptions
  8. ext.pageTriage.defaultDeletionTagsOptions
  9. ext.pageTriage.toolbarStartup
  10. ext.pageTriage.article
  11. ext.PageTriage.enqueue
  12. ext.pageTriage.views.toolbar *

From https://github.com/wikimedia/mediawiki-extensions-PageTriage/blob/91e80c8003dd441577b526fb1bbd4b212a3854a2/extension.json#L108

This is still 9 more than the recommended three as per:
https://www.mediawiki.org/wiki/Wikimedia_Performance_Team/Page_load_performance
https://www.mediawiki.org/wiki/ResourceLoader/Developing_with_ResourceLoader

Based on a quick review of the extension, I see there are only 5 distinct load scenarios

$ git grep -E 'addModule|mw.loader'
includes/Hooks.php:             $outputPage->addModules( 'ext.pageTriage.toolbarStartup' );
includes/Hooks.php:             $outputPage->addModules( [ 'ext.pageTriage.article' ] );
includes/Hooks.php:         $outputPage->addModules( 'ext.PageTriage.enqueue' );
includes/SpecialNewPagesFeed.php:       $out->addModules( [
modules/ext.pageTriage.toolbarStartup/ext.pageTriage.toolbarStartup.js: mw.loader.using( 'ext.pageTriage.views.toolbar' )

If I am pessimistic and assume none of these scenarios are subsets (i.e. happen always together on the same page view), and if we assume each of these is unique and unlikely to be used by the same person in the same browsing session (i.e. we want to save data by not loading something that is likely loaded later anyway), and if we assume there is common functionality among these that is sufficiently large to not be worth embedding in multiple bundles (so we assume we need a "shared" module with that multiple module depend on), then that would make for at most 6 modules.

Krinkle triaged this task as Medium priority.

It seems like a single module would suffice, or maybe two? AFAIK the two scenarios are 1) Special:NewPagesFeed and 2) viewing articles that you arrived at after visiting Special:NewPagesFeed.

Change 665183 merged by jenkins-bot:

[mediawiki/extensions/PageTriage@master] Merge defaultTagsOptions and defaultDeletionTagsOptions RL modules

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

I'm sorry that I haven't handled this task. I recently returned from a long bout of unexpected inactivity, and while I plan to resume my contributions here on Phabricator its unfair to claim tasks that I might not work on when others may be interested in handling them. I'm removing myself as the assignee in a batch-action, but if someone feels that I really should be the one to handle this task feel free to re-assign me and I'll take a look.