4 ms·
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?
by mariusor 2y ago
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?
- debugnik 2y agoYou'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).