3 ms·
Web Components can't be (pre-) rendered server side, right? I wouldn't chose a technology that comes with this limitation.
by andix 3y ago
Web Components can't be (pre-) rendered server side, right? I wouldn't chose a technology that comes with this limitation.
- DrScientist 3y agoWrong. ( https://www.google.com/search?q=SSR+of+webcomponents https://www.google.com/search?q=SSR+of+webcomponents ) Though I'd admit it doesn't have the beautiful simplicity as concating some strings.
- demurgos 3y agoThere's the declarative shadow DOM proposal for this but I don't think it's ready yet.
- _heimdall 3y agoThat really depends on how you want to use web components. I have used custom elements quite a few times with Astro, mostly leveraging custom elements for life cycle events. I end up with a `.astro` file that server renders the HTML and adds a script to define the custom element. In the browser its more pike cheap hydration - the custom element doesn't re-render anything up front, it will just grab references to the server rendered DOM nodes and setup event handlers. I know Lit has an SSR helper, though I haven't used it myself I think its supposed to make server rendering you lit web components much easier.