3 ms·
> The core barrier here comes down to the different templated-rendering systems. This shouldn't be a barrier at all. The rendering system a component uses shou
by spankalee 7y ago
> The core barrier here comes down to the different templated-rendering systems.
This shouldn't be a barrier at all. The rendering system a component uses should be an entirely encapsulated implementation detail of the component. Components should absolutely not have to use the same template system to be used together.
This is something web components get very, very correct.
> Web components are nearly useless without having a story for reactive rendering
There are libraries that address just that specific need, like lit-html which I maintain. Again, it's an implementation detail of the component.
> What we need is a browser standard for templated/reactive rendering of DOM content (data + template = DOM)
While rendering should be an implementation detail, I still agree with you here, simply because templating is such a universal need that the platform should provide some primitives to help developers.
The current best proposal in this area is Template Instantiation: https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Template-Instantiation.md https://github.com/w3c/webcomponents/blob/gh-pages/proposals...
The main idea is that it lets you mark up a <template> with references that will be cloned along with the template contents. These references can then be used to dynamically update the cloned instance. You can accelerate most template systems with these primitives. It's critical because the DOM doesn't have any other way to clone a chunk of DOM along with references to specific nodes in that tree without manually walking the clone's tree.
- jeffmcmahan 7y agoThank you for your work on lit-html. I use it daily. What a great tool.
- smaudet 7y ago'rendering should be an implementation detail', right so I need to download 3 overly complicated template engines for every website instead of one? Seems like modern UI dev is just nuts... You can attempt to standardize all you want, the problem is that some companies wanted to put things on their rails and not share the controls...vs just enhancing html itself as was done in past. But SPAs are not documents, modern web is nothing but highly optimized UI delivery, not fast UI nor descriptive UI. Seems... a bit misguided of an effort when the SPA makers are not clamoring for change and things largely 'work' from a dev perspective already.