In Astro's Islands architecture, only parts of the page are interactive. How does this affect the amount of JavaScript loaded by the browser?
Think about how loading less code upfront helps the page load faster.
Islands architecture sends JavaScript only for the interactive parts (islands) of the page. This means less JavaScript is loaded initially, improving performance.
In Astro's Islands architecture, what is the behavior of non-interactive parts of the page?
Consider what static HTML means for performance and interactivity.
Non-interactive parts are rendered as plain HTML without JavaScript, so they load fast and do not consume extra resources.
Given an Astro page with multiple interactive islands, how does hydration behave compared to traditional SPA hydration?
Think about how breaking the page into islands changes hydration scope.
Islands architecture hydrates only the interactive parts separately, reducing JavaScript work and improving performance.
Which code snippet correctly defines an interactive island component in Astro?
Astro uses special directives on components to mark islands.
In Astro, you mark a component as an island by adding a client directive like client:load directly on the component tag.
Given this Astro code snippet, why does the interactive island fail to hydrate?
<MyButton />
Assume MyButton is a React component that should hydrate on client load.
<MyButton />
Check if the component has the required client directive for hydration.
In Astro, components must have a client directive like client:load to hydrate on the client. Without it, the component renders as static HTML only.