Re:Enhance WASM: Back End Agnostic SSR for Web Components
by danielvaughn on Thursday April 11, 2024 @12:02PM
(#40003675)
That makes sense, though the first paragraph of that page talks about how web components depend on client-side javascript.
My confusion is that a web component by definition has to run client-side javascript. You're either (a) using javascript to port content from a template into your custom element, or (b) using javascript to attach a shadow dom to a custom element. I could be wrong about this, but I don't believe there's a way to send down a working web component from the server without accompanying client-side logic.
Re:Enhance WASM: Back End Agnostic SSR for Web Components
by 1shooner on Thursday April 11, 2024 @12:26PM
(#40003956)
>I don't believe there's a way to send down a working web component from the server without accompanying client-side logic.
Do you mean declarative shadow dom? That landed in FF 123, so I think it's now available on all major browsers.
Re:Enhance WASM: Back End Agnostic SSR for Web Components
by niutech on Friday April 12, 2024 @07:38PM
(#40018763)
Yes, this is Pure HTML Out-of-Order Streaming without JS and it works in every web browser: https://github.com/niutech/phooos
SSR doesn't mean that you can't use web component frameworks, just that the framework must be able to both (1) produce and manipulate DOM in the browser as output, and (2) render the same components into HTML strings on the server. I believe frameworks with this capability are categorized as "isomorphic" frameworks.
Enhance WASM essentially makes Web Components an isomorphic component framework, with a bonus (for some) of not having to use a server-side JavaScript runtime.