Hydration is pure overhead
builder.io
Hydration is pure overhead
1–10 of 84 posts
Re: Hydration is pure overhead
#2We've been doing SSR all along, folks: server side templates.
Yeah, HTML was pretty hamstrung as a hypermedia, which made for mediocre UX, but that's been fixed by libraries like unpoly, hotwire, or, my own, htmx.
Re: Hydration is pure overhead
#3Sometimes you just have to laugh. We've been doing SSR all along, folks: server side templates. Yeah, HTML was pretty hamstrung as a hypermedia, which made for mediocre UX, but that's been fixed by libraries like unpoly, hotwire, or, my own, htmx.
Re: Hydration is pure overhead
#4Is the idea to take advantage of the server's horsepower to get something on the screen fast by sending pre-rendered HTML and then wait while the browser runs the code to basically re-create the page for interactivity?
(it's been a while since i've done traditional front-end web dev)
Re: Hydration is pure overhead
#5Re: Hydration is pure overhead
#6"Something i wanted to mention is both the React team and nextjs team are aware of this and are working on a solution to address needing to load Javascript on the client. Its called React Server Components
React Server Components Documentation https://reactjs.org/blog/2020/12/21/data-fetching-with-react...
Nextjs Blog on Server Components https://vercel.com/blog/everything-about-react-server-compon...
Nextjs Documentation on Server Components (Alpha) https://nextjs.org/docs/advanced-features/react-18/server-co...
We can try it out today on a platform that supports a node environment. This is from nextjs docs. I have a few thoughts on Svelte, but just wanted to point this out!"
With Server Components, there's zero client-side JavaScript needed, making page rendering faster.
Re: Hydration is pure overhead
#7At the end of the article, there's his solution: https://qwik.builder.io/guide/overview
> Qwik is a new kind of web framework that can deliver instant loading web applications at any size or complexity. Your sites and apps can boot with less than 1kb of JS
Re: Hydration is pure overhead
#8This is confusing to me. From the article it sounds like the javascript is run on the server producing markup. That markup is sent to the browser for rendering then the javascript is requested by the browser. When the javascript arrives it is run again on the browser to re-generate the DOM with event handlers attached. If that is correct then why is the javascript run on the server to begin with and not just sent dir…
Servers are often weaker than many consumer computers anyways, so I don’t thin it’s because it can render faster than your own browser.
Re: Hydration is pure overhead
#9This doesn't seem like a great tradeoff to me. Sure, maybe you save time during component initialization, but while that is happening the user is digesting the information anyway. Then once they make their decision to act, there's no extra delay to produce the next state. However, with a "just in time" event binding, now the user has to wait (slightly) longer after they've already made their decision, which seems worse.
Re: Hydration is pure overhead
#10Quoted post unavailable.
I'd also argue that having a static build tool that generates HTML will also allow you to write more HTML and more complex HTML, as you can abstract away reusable components. So there are benefits even if you are serving non-interactive HTML pages. Just cache the React build output.