liveBook · Manning

Hydration

As explained in Fast by Default

Hydration is the process of attaching client-side behavior and state to HTML that was rendered before JavaScript became active.

Hydration attaches event listeners and client-side state to HTML rendered before JavaScript becomes active. It preserves SSR’s fast content display but creates an interaction gap: enhanced controls may look ready while clicks do nothing. section 5.2.1

The misleadingly ready button

A server-rendered page can display a button immediately, yet the button remains inactive until hydration finishes. Frustrated users may click repeatedly; when JavaScript takes over, multiple actions can fire. section 5.2.1

Hydration exposes the trade-off between fast content and usable interaction. Richer pages can accumulate longer hydration work, so fast rendering metrics alone do not guarantee responsive experiences. section 5.2.1

Table 5.1 Web rendering approaches
Rendering approach
Category
Waits for
Trade-offs
Server-Side Rendering
All-at-once
All data before sending HTML
Response blocked by server’s slowest data source
Client-Side Rendering
All-at-once
All JavaScript before rendering
User sees blank screen or loading indicator
Streaming SSR
Progressive
Nothing; sends chunks as ready
Added complexity
Islands
Progressive
Nothing; hydrates components independently
Architectural constraints

Compare hydration’s SSR context with client-side rendering, streaming SSR, and independently hydrated islands. section 5.2.1

How Fast by Default covers it

How deep it goes
Defines event-listener and state attachment, but stops short of implementation details or code.
Examples
Uses an apparently active button, repeated clicks, and Wix’s large-scale interaction-performance problem.
What it assumes
Assumes HTML, JavaScript, server-side rendering, and client-side rendering while distinguishing native from enhanced interactions.
What you can do after
Diagnose interaction gaps where server-rendered controls appear ready before JavaScript enhancement completes.
How it connects
Connects hydration with server-side rendering, client-side rendering, event listeners, client-side state, streaming SSR, and islands architecture.

Also explained in

Compare how 3 books explain hydration →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Fast by Default. The section links point to the parts of the book it draws on.