Daniel Lyons' Notes

hydration (web development)

In web development, hydration refers to the process where client-side JavaScript takes server-rendered static HTML and turns it into a dynamic, interactive web page by attaching event handlers, syncing application state, and enabling lifecycle methods. This allows a web page to load quickly with static content first (thanks to server-side rendering) while subsequently becoming interactive as the JavaScript runs on the client. Frameworks like React, Vue, and Angular use hydration to combine fast initial loads and SEO benefits with rich client-side interactivity. Hydration typically involves reusing the existing DOM rather than rebuilding it, improving performance metrics like First Input Delay (FID) and Largest Contentful Paint (LCP).

hydration (web development)
Interactive graph