@Krinkle made a start to extracting rendering from PHP into Mustache but this was reverted due to a lack of discussion. I am raising this task now to have that conversation. While I don't think an RFC is necessary, a discussion is definitely in order. Feel free to edit description/comment.
Acceptance criteria
It's done when the following is true:
- All HTML construction happens in Mustache.
- There is no change to the HTML output from MediaWiki, the Vector skin, nor any other skin. There is zero impact on end-users, gadget authors, etc. This can easily be verified by generating HTML before and after the patchset and diffing the result (which will be empty)
Motivation
The intention is to formalise the one-direction travel of information. So that once done, it's ParserOutput + User => Vector skin; which only invokes a Mustache template. Removing the indirection of QuickTemplate, and removing the use of inline db queries and variants, would allow us to:
- More easily maintain Vector by making the source code live in one file that provides a high-level view of the skin's template.
- Support an API driven frontend (T140664)
- render logged-in views nearly as fast as logged-out views (not counting Varnish of course)
- opens up numerous possibilities for doing that last step (data + Mustache) at the edge, in a service, or client-side.
- Allow skin developers who may not be as familiar with PHP to work with client side technologies - CSS and Mustache (skin boilerplates can be provided for the necessary PHP)
- Make code more readable by removing the baton passing and confusion around where to put things that occurs between SkinTemplate and Skin.
- Longer term, skins could be reduced to folders containing just CSS and Mustache templates (see https://github.com/jdlrobson/SimpleSkins/tree/master/skins/SimpleSkinVector) making skin development incredibly easy! See also T217158: RFC: Skin templating