Page MenuHomePhabricator

mediawiki.diff page should not load oojs-ui on page load - causing performance issues on FlaggedRevisions sites
Closed, ResolvedPublicBUG REPORT


Russian Wikipedia uses FlaggedRevisions on anonymous pages which makes use of mediawiki.diff which is a utility module that pulls down OOjs UI. The library is large and not used on page views. This means readers of Russian WIkipedia are pulling down lots of unnecessary code.

This dependency seems to have been added in 360182a566e8 by @HMonroy to support the inline switch.

This doesn't need to be loaded on page load, so I suggest making this a soft dependency pulled in where needed.

Event Timeline

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

[mediawiki/core@master] Do not load oojs-ui on pages without diffs

Hey @HMonroy given mediawiki.diff 's usage inside FlaggedRevisions which is unmaintained I think it's super important we optimize this ASAP. I assume this code is only meant to load on diff pages and not article pages?

I'm marking this as a deploy blocker for next week, as I think although this bug has been present for a long time, it has a serious impact on our readers.

Change #1016622 merged by jenkins-bot:

[mediawiki/core@master] Do not load oojs-ui on pages without diffs

Thank you for the speedy fix!! I can confirm that calling mw.loader.using('mediawiki.diff') on non-diff pages no longer pulls in oojs-ui. I'll verify the fix later when this hits production

Jdlrobson claimed this task.
Jdlrobson added a project: Verified.