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

I see few issues here:

1. `${x}` is problematic because it might give the wrong assumptions. Is that a javascript expression? How is it evaluated? in which context? etc. This will go against users' intuitions in many ways.

2. we need to be very careful about allowing interpolation in UI elements. It is true that for very basic apps that are targeting a single locale, having interpolation in the template will be nice, but for more complex applications, doing interpolation in the template is probably not useful unless that you have one template per locale. How are you going to localize your template? I don't see any mention of this important user-case in the proposal.

3. I rather prefer to go with something very restrictive to begin with, and then relax when we feel more comfortable. few examples that are not clear after reading the proposal:  `{{ x y }}`, `{{ x.y }}`, `{{ x[y] }}`, `{{ x-y }}` and all sort of combinations including spaces, breakline, unicode chars, you name it. Again, is that a JS expression or is it a new language that looks a lot like JS and we will have to specify because it contains new things like `nullable`? what if we only allow `{{x}}` and `{{x.y.z}}`? if they want complex expressions, those should belong to the JS layer of this, in which case they do have getters and setters.

Note: we should not loose the focus, in my opinion, the goal of this proposal to provide a high-performant way to create and updating instances of templates following the principles of EWM. Let libraries to provide the abstractions, the interpolation aspect of it, etc., and focus on the low level pieces. The template is not JS, users should not be confused, it is just HTML.

-- 
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-341765326

Received on Friday, 3 November 2017 17:01:38 UTC