Page MenuHomePhabricator

Make OOjs UI in MediaWiki more lightweight, so that we can load it by default on every page without issue
Closed, ResolvedPublic

Description

Trying to use the JavaScript version of OOUI in MediaWiki is extremely heavy. This caused issues for Echo when it tried to use it (T112401) and will probably cause problems in the future. Even lazy-loading is problematic because the progress bars you'd use to indicate that something is being loaded...are also in the giant oojs-ui module.

From mw.loader.inspect() – post-ResourceLoder minification but pre-gzip:

ModuleBeforeas of wmf.13
oojs-ui(-core)225KB111.7 KiB
oojs-ui-toolbarsN/A35.0 KiB
oojs-ui-widgetsN/A90.6 KiB
oojs-ui-windowsN/A47.5 KiB
oojs-ui(-core).styles89.5KB49.3 KiB
oojs-ui.styles.icons129KB77.6 KiB
oojs-ui.styles.indicators24.8KB15.4 KiB
oojs-ui.styles.textures7.3KB4.1 KiB

This is a tracking bug for ways to make it more lightweight.

Related Objects

Event Timeline

Legoktm raised the priority of this task from to Needs Triage.
Legoktm updated the task description. (Show Details)
Legoktm added subscribers: Legoktm, matmarex.
Jdforrester-WMF renamed this task from Make using OOjs UI in MediaWiki more lightweight (tracking) to Make using OOjs UI in MediaWiki more lightweight.Nov 4 2015, 2:08 PM
Jdforrester-WMF raised the priority of this task from Medium to High.
Jdforrester-WMF set Security to None.

Per discussion on wikitech-l, @Jdlrobson suggested last week (see Wikitech-l: Re: Who owns (or should own) OOjs UI?) that this general area might be a good Wikimedia-Developer-Summit-2016 topic. Is there any interest from anyone involved here? People I could envision being part of a conversation (among others): @Legoktm, @Jdforrester-WMF, @Volker_E, @Anomie, @Jdlrobson. This task and its blockers seems like something worth at least informal discussion.

Change 267799 had a related patch set uploaded (by Jforrester):
resources: Load OOjs UI from its four parts

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

Change 267799 merged by jenkins-bot:
resources: Load OOjs UI from its four parts

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

Jdforrester-WMF renamed this task from Make using OOjs UI in MediaWiki more lightweight to Make using OOjs UI in MediaWiki more lightweight, then load it by default on every page.Apr 2 2016, 3:48 PM
Krinkle renamed this task from Make using OOjs UI in MediaWiki more lightweight, then load it by default on every page to Make OOjs UI in MediaWiki more lightweight.Jun 10 2016, 12:26 PM

@Krinkle: Why did you revert the change to the scope of this, agreed back in January at the developer summit?

Loading OOjs UI on every page isn't a goal in itself. (Aside from legacy components, we never load stuff unconditionally in MediaWiki). We want to be able to use it on any page (which isn't semantically the same as loading it on all pages).

In order to allow usage on any page, it needs to be more lightweight. This task tracks getting OOjs UI in MediaWiki lightweight enough.

There isn't going to be a commit that will literally just load oojs-ui on all pages.

Once this task is resolved, we can allow any part of core, skins or extensions to add OOjs UI components to a page without worrying about the added size of loading oojs-ui.

It's also okay if Echo and/or Vector will unconditionally have an OOjs UI component on all pages.

I'm merely saying that from a code stability and maintainability perspective want to keep a link between loading OOjs UI and there being one or more OOjs UI elements in the output. Which means if someone has a custom skin on their wiki, or if doesn't have certain extensions installed or whatever in theory, it wouldn't load OOjs UI. This is merely in principle. In practice, yes, from an end-user perspective of most wikis, it'll be loaded everywhere.

In order to allow usage on any page, it needs to be more lightweight. This task tracks getting OOjs UI in MediaWiki lightweight enough.

No it doesn't. That task was complete as judged by Performance in February.

Jdforrester-WMF renamed this task from Make OOjs UI in MediaWiki more lightweight to Make OOjs UI in MediaWiki more lightweight, so that we can load it by default on every page without issue.Jun 10 2016, 2:05 PM

This task tracks getting OOjs UI in MediaWiki lightweight enough.

No it doesn't. That task was complete as judged by Performance in February [2016].

Yes, that was after this task was created -

@Legoktm created task with description [September 2015]:

This is a tracking bug for ways to make it more lightweight.

What's keeping this task open still?

@Legoktm created task with description [September 2015]:

This is a tracking bug for ways to make it more lightweight.

What's keeping this task open still?

Agreed.