0
0
Astroframework~20 mins

Why Islands architecture optimizes performance in Astro - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Astro Islands Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How does Islands architecture reduce JavaScript load?

In Astro's Islands architecture, only parts of the page are interactive. How does this affect the amount of JavaScript loaded by the browser?

AIt bundles all JavaScript into one large file to improve caching.
BIt loads all JavaScript upfront but delays execution until user interaction.
CIt loads JavaScript only for interactive components, reducing total JS sent to the browser.
DIt removes JavaScript entirely and uses only HTML and CSS.
Attempts:
2 left
💡 Hint

Think about how loading less code upfront helps the page load faster.

component_behavior
intermediate
2:00remaining
What happens to non-interactive parts in Islands architecture?

In Astro's Islands architecture, what is the behavior of non-interactive parts of the page?

AThey continuously poll the server for updates.
BThey are hydrated with JavaScript but remain hidden until interaction.
CThey are converted into React components automatically.
DThey are rendered as static HTML and do not load any JavaScript.
Attempts:
2 left
💡 Hint

Consider what static HTML means for performance and interactivity.

state_output
advanced
2:00remaining
How does Islands architecture affect page hydration?

Given an Astro page with multiple interactive islands, how does hydration behave compared to traditional SPA hydration?

AThe entire page is hydrated as a single React app regardless of islands.
BOnly the interactive islands are hydrated individually, not the whole page at once.
CHydration is skipped entirely and replaced by server polling.
DHydration happens only after the user scrolls to each island.
Attempts:
2 left
💡 Hint

Think about how breaking the page into islands changes hydration scope.

📝 Syntax
advanced
2:00remaining
Identify the correct way to define an island in Astro

Which code snippet correctly defines an interactive island component in Astro?

A<MyComponent client:load />
B<Island client:load><MyComponent /></Island>
C<MyComponent client:visible></MyComponent>
D<Island client:idle><MyComponent /></Island>
Attempts:
2 left
💡 Hint

Astro uses special directives on components to mark islands.

🔧 Debug
expert
3:00remaining
Why does this Astro island not hydrate as expected?

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.

Astro
<MyButton />
AThe component is missing a client directive like <code>client:load</code> to enable hydration.
BThe component is not imported correctly, causing a runtime error.
CThe component is hydrated but hidden by CSS.
DAstro does not support React components as islands.
Attempts:
2 left
💡 Hint

Check if the component has the required client directive for hydration.