Page MenuHomePhabricator

Icon styles loaded twice on Gather special pages
Closed, ResolvedPublic

Description

ext.gather.icons is loaded via addModuleStyles (in the special page execute function) and via addModules the onSkinMinervaDefaultModules hook to make sure an icon shows up in the left menu.

addModules always adds the styles AND the JavaScript of a module via JavaScript
addModuleStyles adds the styles of a module via a link tag in the head of the page
Neither know anything about each other. When addModules is run it loads all the styles and JS as a module may have JS that has not been loaded by addModuleStyles as a result we are effectively loading the stylesheet twice.

What we probably want to do is this:

  • Split out the icon for the left menu into its own module and add this via onSkinMinervaDefaultModules

We should do this before pushing to stable as HTML and the module name will be cached when added via addModuleStyles

Details

Related Changes in Gerrit:

Event Timeline

Jdlrobson raised the priority of this task from to Needs Triage.
Jdlrobson updated the task description. (Show Details)
Jdlrobson moved this task to In Analysis on the Gather Sprint Enwiki board.
Jdlrobson added subscribers: Jdlrobson, • Jhernandez.

Proposed solution of splitting the menu icon to a new module and add it via hook sounds good.

Should remove also loading the icons from the hook

		// FIXME: abuse of the hook.
		$skin->getOutput()->addModules( 'ext.gather.icons' );

Moving to Ready

Change 203088 had a related patch set uploaded (by Jhernandez):
Don't load icons twice

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

Change 203088 merged by jenkins-bot:
Don't load icons twice

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

Jdlrobson moved this task from Product triage to Bug backlog on the Gather board.
Jdlrobson moved this task from Bug backlog to In sprint on the Gather board.