News for hackers. Stuff that matters.
Re:HTML Web Components by goeiedaggoeie on Monday November 13, 2023 @11:53AM (#38252283)
This is the main issue for me with webcomponents, they are not SSR friendly.
Re:HTML Web Components by kaba0 on Monday November 13, 2023 @12:03PM (#38252396)
Do you want SSR for SEO, or for fast first interaction? Because if the latter, then arguably some form of webcomponents might be theoretically better optimizable by browsers than DOM-element soups.
Re:HTML Web Components by nicoburns on Monday November 13, 2023 @12:45PM (#38252897)
> then arguably some form of webcomponents might be theoretically better optimizable by browsers than DOM-element soups.

Arguably they might be less optimisable than regular web frameworks, as they make it difficult to coordinate between different components on the page.

Re:HTML Web Components by goeiedaggoeie on Monday November 13, 2023 @03:31PM (#38254985)
This is a good point, but I would counter, perceived speed of rendering from a user perspective is more important than time to interact with the app/site (a reasonable time to interact is however very important.

Good load order and only loading in the content and JS above the fold initially helps a ton.

JS frameworks are huge and I am still saddened that proper tree shaking and optimization got left by the way side in how the modern web has evolved. I worked with google closure in advanced modes and the closure components for a few years and the compiler was absolutely astounding (and the components designed with the compiler in mind) in code splitting, tree shaking and minimization.

Re:HTML Web Components by kaba0 on Monday November 13, 2023 @03:34PM (#38255020)
Oh, google closure was absolutely ahead of its time!
Re:HTML Web Components by jmull on Monday November 13, 2023 @12:17PM (#38252572)
Consider the approach this article suggests.

You want to have the tags and content appear in the web component (not rendered by JS) which makes it easily and immediately available to crawlers.

Re:HTML Web Components by toasted-subs on Monday November 13, 2023 @05:29PM (#38256251)
You can pre-generate them on the client though.