[Bug 15454] [Templates]: Consider pattern substitution

https://www.w3.org/Bugs/Public/show_bug.cgi?id=15454

--- Comment #3 from Thaddee TYL <thaddee.tyl@gmail.com> 2012-03-21 22:03:19 UTC ---
(In reply to comment #1)
> I disagree that templates should _have_ a substitution system, but I fully
> support the idea that they should make applying a substitution system easy.

100% agreed.

> Rather than try to force a 'one size fits all' model, I suggest it is more
> worthwhile to provide a good model to define templates in the markup and a
> useful pattern to plug an "applier" in.  There are already numerous existing,
> well established projects that do substitution on templates as strings and if
> you look at how different they are in feature and philosophy - it seems
> infinitely better to allow individual, established (and new upstart) vendors to
> compete on that front.

What seems certain for me is that such a substitution system should be
hackable in JS, which means that it needs a JS api.

The way I see this mechanism is a box (the component), which is ready
to receive a certain JSON object. It applies the JSON object one item
at a time, making each of the items fit in the patterns it defines, as
if in a jigsaw puzzle.

What should the template's interface we provide look like?

Something like `render(Object model, any data)`? Should we specify the
"applier" in the template, not in the renderer? What do you think?

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 21 March 2012 22:03:23 UTC