Page MenuHomePhabricator

Spike [4hrs]: Identify problematic Hogan templates when run as Mustache
Closed, DeclinedPublic

Description

The reading team is keen to migrate away from Hogan to Mustache so that we are consistent with the MediaWiki way of doing things and benefit from the larger MediaWiki universe making use of the same template language.

It should be possible for all our templates written in Hogan to run as Mustache. However this may not be the case. There are subtle differences.

  • Force all hogan templates to run with Mustache compiler. [1]
  • File bugs for any templates that have rendering issues when run as Mustache templates.

[1] there are 2 ways to do this:

  1. Create a script that renames all hogan templates to mustache. Update our module definitions to use the mustache files
  2. Update circuit mediawiki.template.hogan so that it uses the Mustache compiler.

#2 should be suitable for this task, but #1 would help us do the migration in future.

Known problems

{#foo}<h2>{{foo}}</h2>{{/foo}}

will render in Hogan if foo is not an empty string.
In mustache behaviour appears to be different. Any # tags have to be truthy or accessors e.g. foo= { foo: text }.

Event Timeline

Jdlrobson renamed this task from Spike: Identify problematic Hogan templates when run as Mustache to Spike [4hrs]: Identify problematic Hogan templates when run as Mustache.Aug 25 2016, 12:32 AM
Jdlrobson raised the priority of this task from Low to Needs Triage.
Jdlrobson created this task.
Jdlrobson added a project: Web-Team-Backlog.
MBinder_WMF subscribed.

@Jhernandez Can you give this a priority? As current tech lead. :) Also, if it doesn't need analysis anymore, please move on the backlog. Thx!

I think normal is fit unless there are special reasons for this.

Jdlrobson changed the task status from Open to Stalled.Apr 17 2017, 11:07 PM

I think this should be stalled until T155802 is completed. We need an answer on template pre-compiling in MobileFrontend as an alternative.

We're going to work on T155802. We can reopen if this becomes something we want to look into.