0
0
Astroframework~5 mins

client:idle for deferred hydration in Astro - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does client:idle do in Astro?

client:idle tells Astro to wait until the browser is idle before hydrating a component. This means the component loads only when the user is not busy, improving page speed.

Click to reveal answer
beginner
Why use client:idle instead of client:load?

client:idle delays hydration until the browser is free, reducing initial load work. client:load hydrates immediately after page load, which can slow down the user experience.

Click to reveal answer
intermediate
How does client:idle improve user experience?

By hydrating components only when the browser is idle, it avoids blocking important tasks. This keeps the page responsive and fast for the user.

Click to reveal answer
intermediate
When should you avoid using client:idle?

Avoid client:idle for components that need to be interactive immediately, like buttons or forms visible on page load.

Click to reveal answer
advanced
What browser API does client:idle rely on to detect idle time?

client:idle uses the requestIdleCallback API to run hydration when the browser is idle.

Click to reveal answer
What does client:idle do in Astro?
AHydrates a component only on user click
BHydrates a component immediately on page load
CHydrates a component when the browser is idle
DPrevents hydration of a component
Which API does client:idle use to detect idle time?
ArequestIdleCallback
BsetTimeout
CrequestAnimationFrame
DIntersectionObserver
When is client:idle NOT a good choice?
AFor components that need immediate interaction
BFor large images
CFor components that appear below the fold
DFor static content
What is a main benefit of using client:idle?
AMore animations on page
BLoads components on user scroll
CDisables JavaScript
DFaster initial page load
How does client:idle affect JavaScript execution?
ARuns JavaScript only after user clicks
BRuns JavaScript when browser is idle
CRuns JavaScript immediately
DPrevents JavaScript from running
Explain how client:idle works in Astro and why it helps performance.
Think about when the browser is free to do extra work.
You got /5 concepts.
    Describe scenarios when you should and should not use client:idle for component hydration.
    Consider user interaction needs.
    You got /4 concepts.