▲ | troupo 9 days ago | |||||||
It's strange to see people downvoting this when custom elements still can't be properly rendered on the server. All the attempts are very framework specific, e.g. lit's list of caveats https://lit.dev/docs/ssr/overview/ (and shoelace referenced above depends on lit). There's nothing very special in sending a html tag and then attaching functionality to it with javascript when it's loaded in the browser. | ||||||||
▲ | spankalee 9 days ago | parent [-] | |||||||
Framework server rendering is framework specific... Seems like a framework problem. At least custom elements can just be including in framework-specific templates and be included in the rendered output, even if not deeply server-rendered. It's actually very difficult to do this correctly and at scale with a framework like React, because in React you need an ID and JS call to initialize each embedded component, when custom elements initialize themselves. Anyway, you have an axe to grind, so have fun with that. I'll see you next time I make a positive comment about web components I guess. | ||||||||
|