All syntax guides
Short, practical guides on programming syntax, language fundamentals, and the tools developers reach for every day.
3,965 guides across 14 topics
Topics
Popular guides
Most readLatest guides
Page 18 of 397Next.js Environment Variables: NEXT_PUBLIC_, Build-Time Inlining, and Runtime Config
The prefix decides whether a value is compiled into the browser bundle or stays on the server. One image, two environments, and the choice that follows from it.
Next.js Authentication: Sessions, Cookies, and Server-Side Protection
HttpOnly cookies set only in actions, an async cookies() API, and one data-access layer. Middleware is an optimistic gate; the page that reads data is the only real check.
Next.js i18n: Locale Routing, Middleware Negotiation, and Dictionaries
A [lang] segment gives every page a static, cacheable URL per language and middleware negotiates once. Where static rendering silently becomes dynamic, and how hreflang stays honest.
Next.js ISR: Route Revalidate, revalidateTag, and On-Demand Invalidation
Two clocks and one trigger: route revalidate seconds, fetch-level tags, and a webhook that calls revalidateTag. A timer is a ceiling on freshness, never a guarantee.
Next.js Parallel Routes and Intercepting Routes: Slot Layouts and Modals
Named slots render several pages in one layout, and (.) interception makes a click open over the page while a direct link renders the full route. Why every slot needs default.tsx.
Next.js Image and Font Optimization: priority, sizes, and remotePatterns
Why an image without sizes downloads 1600 pixels on a phone, what priority is for, the positioned parent that fill requires, and how next/font removes font shift.
Next.js Metadata API: generateMetadata, Open Graph, sitemap.ts, and robots.ts
metadataBase decides whether share previews work at all. Title templates, dynamic metadata with cached loaders, and sitemap generation that stays fresh.
Next.js loading, error, and not-found: Streaming and Suspense Boundaries
Three files, three React primitives. What each catches, why a layout's own error escapes its error.tsx, and the errors a boundary never sees.
Next.js Middleware: Matchers, Redirects, Rewrites, and Why It Is Not an Auth Guard
One function before routing, on the edge runtime. Matcher grammar, redirect versus rewrite, and the bypass that makes in-page authorization mandatory.
Next.js Route Handlers: Methods, Cookies, and Streaming Responses
route.ts is plain HTTP inside the App Router. Reading the body once, setting cookies two ways, opting into caching in v15, and streaming with a ReadableStream.