Page MenuHomePhabricator

Stop serving menu and styles in the page HTML
Closed, ResolvedPublic

Description

The main menu is currently sent down the wire as HTML but only shown with JS. Let's change this.

  • Let's move the code for the main menu into a single mustache/hogan template.
  • Special:MobileMenu should use this template to render the menu on server side
  • Clicking the hamburger will render the MainMenu view, which will use this template.

This should reduce overall page HTML and reduce code duplication. Welcome to the future!

Event Timeline

Jdlrobson assigned this task to phuedx.
Jdlrobson raised the priority of this task from to Needs Triage.
Jdlrobson updated the task description. (Show Details)
phuedx removed phuedx as the assignee of this task.Apr 8 2015, 5:01 PM
phuedx set Security to None.

According to the page-ui-daily graph, search is clicked ~5 times more than the hamburger. Let's definitely render the menu when it's requested!

Exactly. It sounds like the design for the main menu is in flux but moving to templates will make this easier to manage in future.

We'll see. I certainly think it'll make it easier to change the menu design in the future.

This task can be resolved by working on T96172 and promoting the new design to beta/stable.

Jdlrobson renamed this task from Stop serving menu in the page HTML to Stop serving menu and styles in the page HTML.Apr 27 2015, 7:00 PM

Change 207844 had a related patch set uploaded (by Jdlrobson):
Generate menu HTML via JavaScript.

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

Change 207844 merged by jenkins-bot:
Generate menu HTML via JavaScript.

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