Pages

Topics

Tools

↑↓navigate↵openescclose

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

Latest guides

3D illustration of key-value chips split into a browser lane and a sealed server cube
Next.js

Next.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.jsConfigurationDeploymentSecurity
3D illustration of a shield gate before server components with an HttpOnly cookie token passing through
Next.js

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.jsAuthenticationSecurityCookies
3D illustration of a globe with locale URL segments branching into dictionary folders
Next.js

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.jsi18nRoutingSEO
3D illustration of cached page slabs with a countdown dial refreshing one and a webhook invalidating another
Next.js

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.jsISRCachingPerformance
3D illustration of parallel route slots rendering beside a page with a modal card sliding over it
Next.js

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.jsApp RouterRoutingReact
3D illustration of a picture frame splitting into resolution variants and a font card with a swap arrow
Next.js

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.jsPerformanceImagesFonts
3D illustration of a page card emitting a social preview image and a structured sitemap tree
Next.js

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.jsSEOMetadataSitemap
3D illustration of a page frame streaming content chunks with skeleton placeholders and an error shield
Next.js

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.jsApp RouterStreamingError Handling
3D illustration of request arrows passing a filter gate that branches into pass, rewrite and redirect paths
Next.js

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.jsMiddlewareRoutingSecurity
3D illustration of HTTP request blocks hitting a handler gate that answers with JSON and a chunked stream
Next.js

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.

Next.jsRoute HandlersAPIStreaming