From Server to Client: Mastering Hydration in Angular
summary
Explains how Angular’s SSR sends rendered HTML while the browser downloads JS, then applies provideClientHydration to bind interactivity; demo shows five lazy-loaded chunks and a working event replay that replays three pre-hydration clicks. Covers with incremental hydration flags, triggers (hover/viewport/interaction/idle/timer), hydrateWhen/hydrateOn/hydrateNever, and the --no-hmr tip so components don’t all hydrate in dev. Notes tools (Angular DevTools), ngSkipHydration, afterNextRender hook, and pitfalls: DOM must match, avoid direct DOM APIs, and factor in added server cost and complexity.
AI-written summary · about
