Performance: client:visible for viewport-based loading
MEDIUM IMPACT
This pattern affects page load speed by deferring component loading until it enters the viewport, improving initial load and interaction readiness.
import MyWidget from './MyWidget.astro'; <MyWidget client:visible />
import MyWidget from './MyWidget.astro'; <MyWidget client:load />
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Immediate hydration | High (all components loaded) | Multiple reflows during hydration | High paint cost due to JS execution | [X] Bad |
| client:visible hydration | Low (only visible components) | Single reflow per visible component | Lower paint cost, deferred JS | [OK] Good |