Re: [w3c/webcomponents] [templates] Consider ${foo} instead of {{foo}} (#688)

> We wanted to support a very small subset of JavaScript without supporting arithmetic or any other kind of operators but || and . and possibly [~] in the default template processor.

That is my biggest concern. Is it absolutely necessary? where do you draw the line between JavaScript and the subset that you want to support? Based on historical discussions at TC39, we have seen people attempting to implement a subset of JS over and over again, no-one has succeed at that (at least that I know of), in fact, most of them ended up supporting the entire thing or disapearing.

Look at handlebars for example:

> Identifiers may be any unicode character except for the following:
Whitespace `! " # % & ' ( ) * + , . / ; < = > @ [ \ ] ^ \` { | } ~`
> To reference a property that is not a valid identifier, you can use segment-literal notation, [: `{{#each articles.[10].[#comments]}}`

I'm sure @wycats will have some strong opinions about this.

If developers have a way to provide those expressions via abstractions on top of the processCallback or any other similar mechanism to evaluate the expressions, we should be fine. Lets library to compete for the best syntax, just provide the mechanism for the processing of the parts.

-- 
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/688#issuecomment-341818618

Received on Friday, 3 November 2017 20:31:08 UTC