Page MenuHomePhabricator

Inline Hogan templates in mobile.startup
Closed, ResolvedPublic5 Estimated Story Points

Description

In preparation for removing Hogan we will slowly move templates out of ResourceLoader and into source code. We will begin by scoping this work to mobile.startup to uncover any issues with this approach.

Previously:

template: mw.template.get( 'mobile.talk.overlays', 'SectionAddOverlay.hogan' ),

Now:

template: util.templateRender(`
  <div class="overlay-header-container header-container position-fixed">
        {{>contentHeader}}
        {{>saveHeader}}
  </div>

  <div class="overlay-content"></div>
`);

Acceptance criteria

  • A util wrapper function has been created in mobile.startup/util.js - this in future will allow us to swap all hogan renders for a mustache render. It takes template source code and returns a template with a render function.
  • All the files in mobile.startup have been inlined.
  • Increase in JS bundlesizes should be consistent with the removal of the size of ResourceLoader's mobile.startup module.

Sign off steps

  • Create task(s) for the remaining Hogan templates in MobileFrontend.

Event Timeline

Jdlrobson moved this task from Incoming to Upcoming on the Web-Team-Backlog board.
Jdlrobson set the point value for this task to 5.Apr 2 2019, 4:30 PM

Change 501048 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Templates are inlined in mobile.startup

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

Change 501048 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Templates are inlined in mobile.startup

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

Jdlrobson updated the task description. (Show Details)