--- id: wiki-2026-0508-next-js-and-modern-web title: Next.js and Modern Web category: 10_Wiki/Topics status: verified canonical_id: self aliases: [Next.js, Next 16, Modern React] duplicate_of: none source_trust_level: A confidence_score: 0.9 verification_status: applied tags: [nextjs, react, rsc, server-actions, web] raw_sources: [] last_reinforced: 2026-05-10 github_commit: pending tech_stack: language: typescript framework: nextjs-16 --- # Next.js and Modern Web ## 매 한 줄 > **"매 Next.js 16 = React 19 + RSC + Turbopack + edge-first"**. 2016 SSR helper → 2024 App Router → 2026 RSC default. 매 React 의 fullstack-y reference impl. Vercel runtime 외 의 self-host (Node, Docker, Cloudflare) 의 mature. ## 매 핵심 ### 매 capability - **App Router**: file-based routing + RSC + nested layouts. - **Server Components**: zero JS by default. - **Server Actions**: form/mutation 의 RPC. - **Streaming**: Suspense boundary 의 progressive render. - **Turbopack**: Rust bundler, prod build 5x faster. - **Edge runtime**: V8 isolates, sub-50ms cold start. ### 매 rendering mode - **Static (SSG)**: build-time, default for no-data routes. - **Dynamic (SSR)**: per-request. - **ISR**: stale-while-revalidate. - **PPR (Partial Pre-rendering)**: 매 static shell + dynamic streamed (16+ stable). ### 매 응용 1. Marketing + dashboard combo: PPR. 2. E-commerce: ISR + edge personalize. 3. AI chat app: Server Actions + streaming response. ## 💻 패턴 ### App Router file structure ``` app/ layout.tsx # root layout (server) page.tsx # / products/ page.tsx # /products [id]/ page.tsx # /products/123 loading.tsx # Suspense fallback error.tsx # error boundary api/ cart/ route.ts # /api/cart ``` ### Server component data fetch ```tsx // app/products/[id]/page.tsx import { db } from "@/lib/db"; import { notFound } from "next/navigation"; export default async function Page({ params }: { params: Promise<{ id: string }> }) { const { id } = await params; const product = await db.product.findUnique({ where: { id } }); if (!product) notFound(); return
{product.name}
; } export async function generateStaticParams() { const products = await db.product.findMany({ select: { id: true } }); return products.map((p) => ({ id: p.id })); } ``` ### Server Action ```tsx // app/contact/actions.ts "use server"; import { revalidatePath } from "next/cache"; import { z } from "zod"; const Schema = z.object({ email: z.string().email(), body: z.string().min(1) }); export async function sendMessage(_: unknown, form: FormData) { const parsed = Schema.safeParse(Object.fromEntries(form)); if (!parsed.success) return { error: parsed.error.flatten() }; await db.message.create({ data: parsed.data }); revalidatePath("/contact"); return { ok: true }; } ``` ```tsx // app/contact/page.tsx "use client"; import { useActionState } from "react"; import { sendMessage } from "./actions"; export default function Page() { const [state, action, pending] = useActionState(sendMessage, null); return (