News for hackers. Stuff that matters.
Re:Web Components could replace frontend frameworks? by ricardobeat on Thursday April 11, 2019 @09:07PM (#19640961)
As expected, no mention of server-side rendering.
Re:Web Components could replace frontend frameworks? by JackuB on Friday April 12, 2019 @02:24AM (#19642464)
This was exactly the reason I’ve abandoned them. As mentioned in other comments, they look like a good way to create a design/component system in them, because of the interop with any frontend JS framework (who doesn’t want that?!). So you deal with clunky CSS sharing and theming capabilities and there might be some solutions on the horizon. But now you want to build a static website with it (landing page, docs, blog…) and you can’t pre-render them, because there is no declarative Shadow DOM element https://github.com/w3c/webcomponents/blob/gh-pages/proposals... (rejected https://github.com/whatwg/dom/issues/510). Yeah, you can pre-render them without the Shadow DOM. Then if you want to make those chunks of HTML into WCT on load (sort of rehydration), it will trigger repaints, as you have to remove the chunk of HTML, put it into WCT and parse everything again. Or you don’t put it into Shadow Root, to prevent repaint - but at that point, if your components can work this way, why even use WCT?
Re:Web Components could replace frontend frameworks? by westbrookjo on Thursday April 11, 2019 @11:37PM (#19641742)
You can server side render a `video` element just the same way you would a `custom-element`. We've been doing it for years and there's no reason to think anything about that has changed. If you're looking to deep SSR which is arguable as far as benefit, check out approaches like https://github.com/ionic-team/stencil-ssr-starter
Re:Web Components could replace frontend frameworks? by georgecalm on Thursday April 11, 2019 @11:58PM (#19641857)
I think the difference is that the browser already contains the shadow dom needed to render the video tag. But for a custom tag it would need to fetch, parse and execute your component code before it can begin to render.
Re:Web Components could replace frontend frameworks? by westbrookjo on Saturday April 13, 2019 @06:29PM (#19656149)
That's an interesting read. I'm thinking on whether the real question is what is the declarative difference between the video tag, which by normal application lets everyone feel find about that content hidden by the shadow DOM vs the APIs we're developing for our custom elements. There seems to be an important piece of learning, not just for SSR, but for custom element development in general, that I think we can build off of.
Re:Web Components could replace frontend frameworks? by pjmlp on Friday April 12, 2019 @03:20AM (#19642729)
Server-side rendering should be JavaScript free and done in battle tested framework (TM) since the early 2000's, plenty to chose from.