The Next.js App Router fundamentally reshaped how we think about server-client boundaries. By defaulting to React Server Components, we keep hefty dependencies on the server and send zero client bundle overhead for static views.
Component Boundary Guidelines
Keep client components as close to the leaves of the render tree as possible.
- Server Components: Fetch data, access databases, verify secrets.
- Client Components: Handle user interactions, stateful animation triggers, and browser APIs.
// Server component fetching directly export default async function ProjectsPage() { const projects = await getProjects(); return <ProjectGrid items={projects} />; }
Strict Validation at the Edge
Never trust client input. Use Zod schemas on the server to validate mutations before touching persistence layers.