Performance: Vue components in Astro
MEDIUM IMPACT
Using Vue components in Astro affects page load speed and interaction responsiveness by adding client-side JavaScript and hydration costs.
--- import MyVueComponent from '../components/MyVueComponent.vue'; --- <MyVueComponent client:idle />
--- import MyVueComponent from '../components/MyVueComponent.vue'; --- <MyVueComponent client:load />
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| client:load hydration | Hydrates full component DOM | Triggers 1 reflow per component | Moderate paint cost due to JS execution | [X] Bad |
| client:idle hydration | Hydrates component DOM after idle | Single reflow delayed | Lower paint cost, less blocking | [OK] Good |