PAITS Cheat Sheet Frontend & Web Engineering Intermediate Updated 2026-10-23

React 19 & Next.js App Router: RSC, Streaming & Caching Cheat Sheet

React Server Components wire format, Suspense streaming boundaries, Server Actions, and CSP nonce propagation.

Executive Summary: Architectural guide to React 19 and Next.js App Router: RSC serialization rules, selective hydration with `<Suspense>`, optimistic UI updates, and Core Web Vitals (LCP/INP/CLS) tuning.

Key Equations & Invariants

Core Web Vitals Good Thresholds
\text{LCP} \le 2.5\text{s}, \quad \text{INP} \le 200\text{ms}, \quad \text{CLS} \le 0.10

Evaluated at the 75th percentile (p75) of real-user field loads across mobile and desktop.

1. Server Components vs. Client Components Decision Matrix

Server Components execute exclusively on the server and contribute **0 KB** to the client JavaScript bundle. Pass Server Components as `children` props into Client Components (the Donut Pattern) to avoid pulling server-only trees into the client bundle.

CapabilityServer Component (Default)Client Component ('use client')
Direct DB / Secret / Filesystem AccessYes (Safe)No (Leaks to bundle)
Client Bundle Size Impact0 KB JSIncluded in client chunks
React Hooks (useState, useEffect)NoYes
Browser APIs (window, EventSource)NoYes
Streaming via <Suspense>Yes (Progressive HTML + Flight)Renders fallback until chunk resolves
The 'Donut Pattern': Composing Server Data Inside Interactive Client Shellstsx
// ClientSidebarShell.tsx ('use client')
export function ClientSidebarShell({ children }: { children: React.ReactNode }) {
  const [open, setOpen] = useState(true);
  return <aside data-open={open}>{children}</aside>;
}

// page.tsx (Server Component)
export default async function CoursePage() {
  return (
    <ClientSidebarShell>
      <Suspense fallback={<CurriculumSkeleton />}>
        <ServerCurriculumTree /> {/* Stays 100% on server! */}
      </Suspense>
    </ClientSidebarShell>
  );
}

Common Production & Interview Pitfalls

Frequently Asked Questions

Q: Does 'use client' mean the component is skipped during Server-Side Rendering (SSR)?

No! Client Components are still pre-rendered to initial HTML on the server during SSR for fast First Contentful Paint, then hydrated on the client.