[w3c/webcomponents] [templates] How featureful should the default processor be? (#682)

>From what I can tell the proposal includes the following features:

- Stripping leading/trailing whitespace from expressions, so you can do `{{ x }}` instead of `{{x}}`.
- Path searching with dots, so you can do `{{x.y}}`. (But not brackets, so you cannot do `{{x["y"]}}`.)
- Fallback with `||`. Doesn't appear to be in the formal spec. Does this use boolean semantics, so `false` or `0` trigger fallback? Or is it just `undefined` and `null`? Just `undefined`?

There's a lot of potential for scope creep here. I think the most minimal version omits all three of these so it's purely JavaScript property lookup. I'm not sure if that'd be too restrictive, or OK.

Note that Mustache doesn't allow any of these, I am pretty sure, and requires you to manipulate your data into an appropriate format beforehand. (Maybe it supports whitespace stripping?)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/682

Received on Thursday, 2 November 2017 04:23:51 UTC