Re: [w3c/webcomponents] [templates] Ensure that template instantiation actually improves the platform (#704)

I read all of this, and although I'm very excited about Template Instantiation, I agree with @dmitriid that it's quite high level, bring mustache syntax, often use as a top abstraction template engine, as the only solution for truly dynamic HTML.

If there was something like a native patch api, this wouldn't have been required, as the template could have been generated by any abstraction.

I'd like to emphasise the need for this sort of API cause since 10 years, developers have come up with different solutions and abstraction for this very problem...

DOMChangeList API seems to offer a similar approach to what Template Instance does, in the sense that once you figure out changes, you can delegate that to a low-level DOM API that already applies them for you.

My personal experience working with JSX at least, us that it's very nice to be able to use JS in a declarative way to build your template. You don't need to learn any new DL and it just works, letting you write template logic as you please. 

The problem I see with a DOM diffing low-level API is only one.
As mentioned above, you don't always need DOM diffing. You could create a DOMChangeList based on the amount of changes coming from state changes. For specific cases, that would be more efficient.

So, I do agree that we require a way for the underlying API to know where changes will happen in the document. In that way, the low-level API can choose which technique is best to apply, based on his knowledge of the template and where changes are.

Ultimately, I disagree in general with statements like 'Template Instantiation does not bring anything to the table, it does add much', just because of what I wrote above...

But I don't like for the native standard to choose the template syntax you should use.
If there was a way to change the proposal to support JS instead of mustache, I don't know maybe a template strings like solution...



-- 
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/704#issuecomment-489422462

Received on Sunday, 5 May 2019 12:35:36 UTC