Page MenuHomePhabricator

Swap Hogan for Mustache
Closed, DuplicatePublic

Description

Hogan.js is used in MobileFrontend and non-standard given Mustache's existence in core. By removing Hogan, we get a smaller and maintained library, a consistent way to render server and client templates and we unblock teams like performance (see T127268).

Precursors:

  • All templates are generated by a util wrapper function
  • All templatePartials are gone.
  • RelatedArticles no longer uses templates and/or mediawiki.template.hogan

Developer notes

renderTemplate: function ( templateSourceCode ) {
  return mw.template.compile( templateSourceCode, 'hogan' );
}

will be swapped with

renderTemplate: function ( templateSourceCode ) {
  return mw.template.compile( templateSourceCode, 'mustache' );
}

Acceptance criteria

  • We have QAed all features prior to merge.
  • It is possible to revert the patch if we hit any problems
  • The mediawiki.template.hogan module is kept but marked as deprecated for any pages that continue to use it (for cached HTML) to allow us to revert if necessary.

Event Timeline

Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptApr 1 2019, 11:55 PM
Jdlrobson changed the task status from Open to Stalled.Apr 2 2019, 12:00 AM
Jdlrobson triaged this task as Normal priority.
Jdlrobson updated the task description. (Show Details)
Krinkle awarded a token.
Krinkle moved this task from Limbo to Watching on the Performance-Team (Radar) board.
pmiazga changed the task status from Stalled to Open.May 2 2019, 7:38 PM
pmiazga added a subscriber: pmiazga.
pmiazga updated the task description. (Show Details)May 2 2019, 7:39 PM
Restricted Application removed a subscriber: Liuxinyu970226. · View Herald TranscriptMay 2 2019, 9:07 PM