Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Where is this "alleged" though? From one of the paragraphs behind my link:

> This won't appear in your page until you grab a reference to it with JavaScript and then append it to the DOM



Your link isn't showing the declarative shadow DOM, this does:

https://web.dev/articles/declarative-shadow-dom#how_to_build...

And the example below that one shows how to hydrate declarative shadow roots with JS custom elements, so the path to progressive enhancement should be clear.

I say alleged because I haven't had the chance to try it beyond a toy example.


I'm not sure what you meant when you said "without JS". To actually use templates you need JS. Yes you can declare them, but what's the point?


You've ignored the part where the declarative template is immediately attached to its parent as a shadow root by the parser, and its siblings become the slot children. You don't need to instance or register anything with JS there, just copy-paste the template (admittedly lame, but kinda the same repetition as SSR today, just less involved and with a shadow root).




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: