Page MenuHomePhabricator

Audit modules (2017)
Closed, ResolvedPublic

Description

T159911: Audit modules (2017) | T202154: Audit modules 2018: Reduce registry overhead


Focus for 2017 is to audit what we load by default, and aim to load fewer modules by default.

For different definitions of "default". Environments:

  • MediaWiki core default.
  • MediaWiki-Vagrant default.
  • Production and Beta Cluster wikis.

And for each, looking at:

  • Simple wikitext page. (unrestricted, with parser output)
  • Special:Blankpage. (unrestricted, without parser output)
  • Special:Preferences, Special:UserLogin. (restricted, without parser output)

Event Timeline

Krinkle created this task.Mar 8 2017, 4:39 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 8 2017, 4:39 AM

Change 341750 had a related patch set uploaded (by Krinkle):
[mediawiki/core] Skin: Preload jquery.tablesorter based on rough heuristics

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

Change 341751 had a related patch set uploaded (by Krinkle):
[mediawiki/core] Skin: Only load jquery.makeCollapsible if needed

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

Change 341845 had a related patch set uploaded (by Krinkle):
[mediawiki/core] Remove support for jquery.placeholder shim

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

Gilles moved this task from Inbox to Doing on the Performance-Team board.Mar 9 2017, 9:46 PM
Krinkle triaged this task as High priority.Mar 9 2017, 9:59 PM

Change 342669 had a related patch set uploaded (by Krinkle):
[mediawiki/extensions/NavigationTiming] ext.navigationTiming: Only load eventlogging when needed

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

Change 341750 merged by jenkins-bot:
[mediawiki/core] Skin: Preload jquery.tablesorter based on rough heuristics

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

Change 341751 merged by jenkins-bot:
[mediawiki/core] Skin: Only load jquery.makeCollapsible if needed

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

Peter added a subscriber: Peter.Mar 15 2017, 6:33 PM

Change 342669 merged by jenkins-bot:
[mediawiki/extensions/NavigationTiming] ext.navigationTiming: Only load eventlogging when needed

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

Krinkle renamed this task from Audit modules loaded by default (2017) to Audit modules (2017).Mar 21 2017, 2:49 AM

Change 341845 merged by jenkins-bot:
[mediawiki/core@master] Remove support for jquery.placeholder shim

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

Change 282505 had a related patch set uploaded (by Krinkle):
[mediawiki/core@master] [WIP] resourceloader: Merge legacy modules into base module request

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

Change 282505 merged by jenkins-bot:
[mediawiki/core@master] resourceloader: Fold legacy modules into base modules request

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

He7d3r added a subscriber: He7d3r.Apr 30 2017, 7:56 PM
Nirmos added a subscriber: Nirmos.May 10 2017, 10:52 AM

Should T145997 (now merged into T63007) be looked at in conjunction with this? A large proportion of gadgets are only relevant in a certain namespace, or during a certain action, but are loaded everywhere anyway. I can imagine that quite a lot of time and bytes could be saved by allowing gadget authors to set constraints on when and where gadgets should load.

Right, that solves the problem of loading a large script that is not relevant everywhere, but that also bypasses the minification. I was thinking we could have the best of two worlds, by moving conditions like

if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Watchlist' ) {
	//...
}

from the script to MediaWiki:Gadgets-definition.

Krinkle added a comment.EditedMay 26 2017, 10:32 AM

Right, that solves the problem of loading a large script that is not relevant everywhere, but that also bypasses the minification.

No, it does not. It registers two modules ("extra-toolbar-buttons", "extra-toolbar-buttons-core") both of which are a Gadget module, both are loaded through mw.loader from load.php with combination, minification and compression. It just means that instead of loading the module by default on every page, the second module is triggered by the first one. This is not importScript from action=raw. mw.loader.load() supports everything it normally does: multiple files, stylesheets, dependencies etc.

Ah, ok. I thought He7d3r linked to something like https://sv.wikipedia.org/wiki/MediaWiki:Gadget-teahouse.js or https://sv.wikipedia.org/wiki/MediaWiki:Gadget-Geonotice.js which solves one problem and creates another.

Ah, ok. I thought He7d3r linked to something like https://sv.wikipedia.org/wiki/MediaWiki:Gadget-teahouse.js or https://sv.wikipedia.org/wiki/MediaWiki:Gadget-Geonotice.js which solves one problem and creates another.

That is true in the case of refToolbar, which has a few importScript calls. The others use something like mw.loader.load( 'ext.gadget.********' );

Krinkle closed this task as Resolved.Jun 27 2017, 9:05 PM
Krinkle updated the task description. (Show Details)Aug 17 2018, 6:29 PM
Krinkle updated the task description. (Show Details)
Krinkle updated the task description. (Show Details)Tue, Aug 6, 7:13 PM