Astro allows components to be rendered on the server, client, or both. How does choosing a deployment target affect where components render?
Think about where your code runs: server or browser.
Astro's deployment target determines if components are pre-rendered on the server or hydrated on the client. This choice impacts performance and user experience.
You deploy an Astro site as static files to a CDN. What is the effect on client-side interactivity?
Consider how static files can run JavaScript in the browser.
Static deployment serves pre-built HTML and JS. Client directives tell Astro which components need hydration for interactivity.
When deploying Astro to a serverless platform, how are lifecycle hooks like onMount or getStaticPaths affected?
Remember which hooks run on server vs client.
getStaticPaths runs at build time to generate pages. onMount runs in the browser after hydration, so serverless deployment does not change their behavior.
Choose the correct Astro component usage to hydrate a component only when the browser is idle.
<Component client:??? />
Which directive waits for browser idle time?
client:idle hydrates the component when the browser is idle, improving performance by delaying JavaScript execution.
Given this Astro component snippet, why does it fail to hydrate when deployed serverless?
<MyWidget client:load />
import MyWidget from '../components/MyWidget.astro'; export default function Page() { return <MyWidget client:load />; }
Consider how deployment targets affect JavaScript bundling and hydration.
Serverless platforms may require bundler configuration to include client-side JavaScript for hydration. Without it, client:load does not hydrate.
