Page MenuHomePhabricator

Lazy infuse OOUI widgets on Special:Preferences
Closed, ResolvedPublic

Description

We spend about 4-500ms infusing widgets that aren't even visible in the first tab.

Related Objects

Event Timeline

Esanders created this task.Sep 7 2018, 6:56 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 7 2018, 6:56 PM

Change 458866 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/core@master] Lazy-infuse OOUI widgets by tab

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

This drops to 200ms after the patch above, most of which is the massive language dropdown.

This drops to 200ms after the patch above, most of which is the massive language dropdown.

Can we ultra-lazy that one widget to only infuse on click?

Probably, although that might make for strange interactions. Might be better than the performance hit, given how slow it is.

We could also change it in a dialog picker, like the VE language widget.

Probably, although that might make for strange interactions. Might be better than the performance hit, given how slow it is.

Lazy-init post-domready?

We could also change it in a dialog picker, like the VE language widget.

Yeah, but that'd be a rendering that non-JS users couldn't edit, right?

Lazy-infusing a widget on click might indeed lead to weird interactions, but it should be perfectly possible to infuse it as normal, but not generate all the MenuOptionWidgets until the dropdown handle is clicked. You could do that in a subclass of DropdownInputWidget, but really vanilla DropdownInputWidget could work that way too…

Something very similar is already implemented in mw.rcfilters.ui.MenuSelectWidget (which fills itself from the toggle() method), surely it will also work for DropdownInputWidget, which is much simpler.

Lazy-init post-domready?

Well with the current patch, the first set of widgets don't initialise until the tab is ready.

Change 458866 merged by jenkins-bot:
[mediawiki/core@master] Lazy-infuse OOUI widgets by tab

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

Do we want to fix up the language widget in this task too?

given no infusion happens until after tabs are ready, I don't think it's'a major issue anymore

Esanders closed this task as Resolved.Sep 12 2018, 9:58 AM
Esanders claimed this task.

Filed as separate task: T204111