Performance: client:load directive
MEDIUM IMPACT
This affects the page's initial load speed by deferring JavaScript execution until after the page is fully loaded.
<MyComponent client:load />
<MyComponent client:idle />
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| client:load | Minimal extra DOM nodes | Triggers 1 reflow after load | Paint cost delayed but minimal | [OK] Good |
| client:idle | Minimal extra DOM nodes | Reflows delayed until idle | Paint cost delayed, may cause input lag | [!] OK |
| client:visible | Minimal extra DOM nodes | Reflows triggered on visibility | Paint cost depends on scroll | [!] OK |
| Static (no directive) | Minimal extra DOM nodes | No reflows from JS | No additional paint cost | [✓] Best |