On Jun 3, 2014 2:56 PM, "Sumana Harihareswara" <suma...@wikimedia.org> wrote:
> Some folks were testing [Knockoff]
> out and need to report back to the list with their verdicts.

Who? Tell us more!

> In the
> meantime, some developers (such as the Mobile and Flow teams) have
> short-term needs that can't wait up for Knockoff to become a complete
> solution, and so are working out interim standardizations outside of
> this mailing list so that they can move forward while Knockoff work
> continues. (Not sure what all of them are.)

MobileFrontend has been using Hogan JS templating since January 2013.

Flow recently chose handlebars JS templating because it has a working
fast PHP re-implementation (lightncandy) to support no-JavaScript
clients.

For client-side templating you need ResourceLoader to supply the
templates to the client. Jon Robson has developed the Mantle
extension[1] that implements
* a ResourceLoaderTemplateModule that does this
* JS functions that abstract getting a template, compiling and caching
it, and rendering it
* specific implementations of these functions for the handlebars and
hogan JS libraries.

MobileFrontend and Flow will start using this shared code in
production in the next few weeks or so.

In order for Flow to share templates between front-end JS and server
PHP, Flow has had to write helper functions in both JS and PHP[2].
Some like message i18n, human-friendly timestamps, escaping, etc. are
more generic than others.

These experiences in generalized JS template support and developing
helper functions across JS and PHP could inform Knockoff development.
So far the Flow team is doing well with handlebars/lightncandy
templating but we're not advocating it over Knockout/Knockoff. The
reactive model-view updating of Knockout (in JavaScript) is an
attractive additional feature missing from Hogan and handlebars
templating; again, Flow couldn't wait.

> Should I be saying Knockoff or Knockout?
From the RFC page, Gabriel WIcke & Matthew Walker's "Knockoff"
templates are KnockoutJS compatible. AIUI, GW&MW have a JS compiler
that compiles them into GW&MW's "Knockoff - Tassembly" intermediate
representation, and their goal is to to render templates in the latter
format from both PHP and JavaScript. In JavaScript you'd still load
the Knockout JS for its reactive model-view updates.

Hope this helps. No slight intended to any others working on GW&MW MW KO code :)

[1] https://www.mediawiki.org/wiki/Extension:Mantle#Templates
[2] https://www.mediawiki.org/wiki/Flow/Architecture/Templating

--
=S Page  WikiMedia Features engineer

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to