Page MenuHomePhabricator

Reduce number of distinct module bundles registered by TimedMediaHandler
Open, Needs TriagePublic

Description

For context and rationale, see:

This extension has long been one of the largest extensions in terms of its share in the startup.js payload for all page views in production. From Grafana: Startup manifest size it currently registers 54 module bundles which transfer about 2KB on every page view during the critical path just to communicate the client about their existence.

I've thus far restisted the temptation to reduce this proactively knowing that a lot of this will be cut away once the transition from Kaltura to video.js completes (ref T100106).

However, I think there's a number of modules here even ignoring the legacy Kaltura parts that can potentially be reduced, and we may be able to do some very quick/easy consolidation or removal of unused modules besides that as well.

Event Timeline

Change 681509 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/TimedMediaHandler@master] mwembed: Remove unused "iScroll" module

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

Change 681510 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/TimedMediaHandler@master] mwembed: Merge "mw.Api" into "mw.MediaWikiPlayerSupport" bundle

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

Change 681511 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/TimedMediaHandler@master] ext.tmh.player.dialog: Move player inline styles into this bundle

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

Change 681512 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/TimedMediaHandler@master] mw.MwEmbedSupport: Bundle Spinner and jquery.loadingSpinner

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

I've shaken out about 5 modules to start with (based on a quick script that looks for modules in extension.json with either 0 or 1 dependency to it; and then confirming with git-grep that it has no loading logic in PHP or JS, and also via Codesearch no references to it from anywhere.

These 5 would be enough to get our registry size back to at least where we were in January which would be nice. TMH didn't regress this quarter, but it's overdue to slim down a bit, and it was the easy target to free up some budget.

Change 681509 merged by jenkins-bot:

[mediawiki/extensions/TimedMediaHandler@master] mwembed: Remove unused "iScroll" module

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

Change 681510 merged by jenkins-bot:

[mediawiki/extensions/TimedMediaHandler@master] mwembed: Merge "mw.Api" into "mw.MediaWikiPlayerSupport" bundle

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

Change 681511 merged by jenkins-bot:

[mediawiki/extensions/TimedMediaHandler@master] ext.tmh.player.dialog: Move player inline styles into this bundle

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

Change 681512 merged by jenkins-bot:

[mediawiki/extensions/TimedMediaHandler@master] mw.MwEmbedSupport: Bundle Spinner and jquery.loadingSpinner

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

Change 683985 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/TimedMediaHandler@master] Bundle videojs-resolution-switcher with ext.tmh.player.inline

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

Change 683985 merged by jenkins-bot:

[mediawiki/extensions/TimedMediaHandler@master] Bundle videojs-resolution-switcher with ext.tmh.player.inline

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

Change 699461 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/TimedMediaHandler@master] Bundle `mw-info-button` with ext.tmh.player.inline

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

Change 699461 merged by jenkins-bot:

[mediawiki/extensions/TimedMediaHandler@master] Bundle `mw-info-button` with ext.tmh.player.inline

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