In web development,
Hydration
is a technique to add interactivity to server-rendered HTML. It’s a
technique in which client-side JavaScript converts a static HTML web
page into a dynamic web page by attaching event handlers to the HTML
elements.
However, attaching event handlers to the Document Object Model (DOM)
is not the most challenging or expensive part of hydration.
In this article, I’ll explain why I believe hydration is
overhead. It’s not the solution; it’s a hack that consumes memory
and slows down startup, especially on mobile. For the sake of this
article, let’s define overhead as work that can be avoided and still
leads to the same end result.