Performance: Hydration behavior
HIGH IMPACT
Hydration affects how quickly a server-rendered Angular app becomes interactive on the client side.
bootstrapApplication(AppComponent, { providers: [provideClientHydration({ strategy: 'lazy' })] }); // Hydrates components on interactionbootstrapApplication(AppComponent, { providers: [provideClientHydration()] }); // Hydrates entire app eagerly| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Eager hydration of full app | High (all components processed) | Multiple reflows during hydration | High paint cost due to layout thrashing | [X] Bad |
| Lazy hydration on interaction | Low (only active components) | Single or minimal reflows | Lower paint cost, smoother rendering | [OK] Good |