#TIL that there soon might be a way to declaratively make custom HTML elements w...
Artyom Bologov @aartaka@merveilles.town
#TIL that there soon might be a way to declaratively make custom HTML elements without #JavaScript... kinda.
https://github.com/WICG/declarative-partial-updates
This proposal specifies a way to use XML processing instructions and <template for="name"> syntax to build declarative reusable elements. This is heavily under-specified, but seems to be the only / best way to handle custom elements without ever touching JavaScript.
Examples from #HTML spec <https://html.spec.whatwg.org/multipage/scripting.html#the-template-element> already work in Chromium but not in Firefox. Examples from the proposal don’t work anywhere yet. But I really want them to work and I think I’m just doing something wrong with XML processing instructions <https://developer.mozilla.org/en-US/docs/Web/API/ProcessingInstruction>. I want to make it work, so I’ll play some more!
MDN is suspiciously terse on that part of the spec. I might as well extend it if it works!