How next.js is put together
This is the Next.js monorepo (vercel/next.js, canary branch), a React framework for building web applications with server-side rendering, static generation, and the App Router. It is a hybrid Rust + TypeScript/JavaScript codebase: the JS/TS side lives under `packages/*` (managed as pnpm/lerna/turbo workspaces) and implements the framework, CLI, and tooling, while the Rust side (a Cargo workspace) implements Turbopack, the SWC-based `next-custom-transforms`, `next-api`/`next-core` build logic, and NAPI bindings compiled to native/WASM binaries consumed by the JS runtime. Data flow centers on compiling and bundling user application code (via Turbopack, webpack, or rspack) and serving it through the Next.js server/edge runtime. The repo is heavily test-driven with Jest and includes extensive error documentation under `errors/`.
Languages
Frameworks
Infrastructure
Major components
packages/next
The core Next.js framework, CLI, server, and runtime published as the `next` package.
turbopack (turbopack/crates/*)
Rust-based incremental bundler and its turbo-tasks reactive computation engine.
crates/next-core & next-api
Rust crates implementing Next.js build/compilation logic and the API surface consumed by the bundler.
crates/next-custom-transforms
SWC-based custom AST transforms (styled-jsx, emotion, relay, etc.) applied to user code.
crates/next-napi-bindings & crates/wasm
Compiles the Rust core into native NAPI addons and WASM for consumption by the JS layer.
rspack/crates/binding
Separate Cargo workspace providing rspack bundler bindings as an alternative to webpack/turbo.
test/ (Jest suites)
Extensive dev/start/deploy integration and unit test harness across webpack, rspack, and turbo bundlers.
errors/
MDX-documented error reference pages surfaced to users when the framework throws known errors.
Cut multiple 16.4 canary releases while trimming redundant route output and tuning caching and Turbopack internals.
5 weeksWeek of 2026-08-24
Week of 2026-08-24latest
Cut multiple 16.4 canary releases while trimming redundant route output and tuning caching and Turbopack internals.
Week of 2026-08-17
Opened the 16.4 canary line and advanced experimental prefetch/navigation APIs alongside Turbopack watcher and caching refinements.
Week of 2026-08-10
Reorganized client router modules and unified how navigation responses are cached, plus assorted image-cache and Turbopack fixes.
Week of 2026-08-03
Turned on several Turbopack optimizations by default and hardened Server Actions and file watching.
Week of 2026-07-27
Enabled the Turbopack build filesystem cache by default and fixed several adapter and fallback-shell edge cases.
Over the past few weeks, the Next.js team pushed steadily toward the 16.4 release while heavily investing in Turbopack (the new bundler) — improving caching, filesystem watching, chunking, and tree-shaking, and turning several optimizations on by default. Alongside this, a major thread of work reshaped how the router prefetches and caches navigation data (including new experimental prefetch/navigation APIs and adapter/deployment improvements), plus a continuous stream of documentation fixes, test stabilization, and routine React version upgrades.
Week by week
2026-08-24Cut multiple 16.4 canary releases while trimming redundant route output and tuning caching and Turbopack internals.latest6 changes
Refactor
Fewer redundant route entries in builds
Stopped emitting separate/duplicate route entries for dynamic RSC forms and per-prefetch segments, streamlining what a build produces.
Fix
More accurate error reporting
Errors bundled inside an AggregateError are now surfaced properly so developers can see the real cause.
Chore
React version upgrade
Bumped the bundled React to a newer dated build to stay current with upstream changes.
Fix
Cleaner dev startup
Stale Turbopack output is now swept from the output directory when the dev server starts, avoiding leftover files.
Docs
App Router documentation corrections
Fixed typos and correctness issues in the App Router docs, including proper export of generateStaticParams.
Refactor
Single stream drain listener
Reused one drain listener when piping Node streams through gzip instead of creating several, reducing overhead.
2026-08-17Opened the 16.4 canary line and advanced experimental prefetch/navigation APIs alongside Turbopack watcher and caching refinements.6 changes
Feature
New experimental prefetch and navigation APIs
Scaffolded and added unstable_prefetch() and unstable_navigation() for more explicit control over how pages are pre-loaded and navigated.
Fix
Touch-screen devtools fix
Fixed dragging of the on-screen dev indicator so it works correctly on touch devices.
Fix
Trailing slash preserved in exports
Static exports now keep the trailing slash during single-page-app fallback instead of dropping it.
Refactor
Deduplicated Pages Router chunks
Turbopack now avoids emitting duplicate app chunks for the Pages Router, reducing output size.
Feature
Clearer missing-root-layout error
Turbopack now shows a dedicated error when an app is missing its required root layout.
Docs
Cache Components migration guidance
Improved documentation for migrating synchronous I/O usage and clarified cache-lifetime bounds.
2026-08-10Reorganized client router modules and unified how navigation responses are cached, plus assorted image-cache and Turbopack fixes.6 changes
Refactor
Unified navigation response handling
Consolidated how server responses, prefetches, and the client cache represent navigation data into a single shared format.
Fix
Image disk-cache robustness
The image optimizer now rejects empty images and skips zero-byte entries when reading or building its on-disk cache.
Fix
Stale manifest cleanup
Turbopack now removes leftover manifests for routes that have been deleted.
Refactor
Metadata rendering overhaul
Extracted metadata resolution into reusable primitives and adopted a new selected-metadata approach for rendering page metadata.
Fix
Standalone output with adapters
Fixed missing runtime and file-tracing outputs so standalone builds work correctly with deployment adapters.
Chore
Global anchoring of async storage
Tied async local storage instances to global symbols to avoid duplication issues across module copies.
2026-08-03Turned on several Turbopack optimizations by default and hardened Server Actions and file watching.6 changes
Feature
Turbopack optimizations on by default
Enabled the shared runtime and CommonJS tree-shaking by default, making builds leaner without extra configuration.
Fix
Server Actions on fallback routes
Server Actions now work correctly on dynamic fallback routes and properly flush pending revalidations on error responses.
Fix
File-watching reliability
Improved how Turbopack's disk watcher is configured and fixed bugs in its polling-based file watcher.
Feature
Expanded minification support
Added support for server minification and broadened the experimental Turbopack minify option.
Docs
Authentication guide with Cache Components
Added a new guide and example showing how to handle authentication when using Cache Components.
Fix
Styled-JSX in adapter builds
Fixed missing styled-jsx styles during Pages Router server rendering on adapter-based builds.
2026-07-27Enabled the Turbopack build filesystem cache by default and fixed several adapter and fallback-shell edge cases.6 changes
Feature
Build filesystem cache on by default
Turned on Turbopack's build-time filesystem cache by default to speed up repeat builds.
Fix
Hybrid router not-found rendering
Fixed not-found page rendering when mixing Pages and App Router with deployment adapters.
Feature
Automated code review workflow
Added an automated code-review workflow to the project's CI to assist with pull requests.
Fix
Bot-aware responses without buffering
Respected the htmlLimitedBots setting in Cache Components without having to buffer the entire response.
Chore
Deprecation warning for useCache flag
Added a warning that the experimental.useCache option is deprecated to guide users off it.
Fix
Static fallback hydration fix
Corrected head-partial detection when hydrating a page from a static fallback shell.
Dependencies and code review
Dependency advisories
Security Watch
11 vulnerable packages (20 advisories) across 167 scanned dependencies.
shell-quote 1.7.3
2 advisories. Fixed in 1.9.0.
How it can be abusedAn attacker could send specially crafted shell command strings to code that calls shell-quote's parse(), making the parser slow down dramatically and hang the process, or exploit the quoting flaw to sneak newlines into commands meant to be safely escaped. Here that only matters for build scripts and internal tooling that run on trusted, developer-supplied input, so ordinary users of apps built with this framework are not affected.
- highGHSA-395f-4hp3-45gvshell-quote: Quadratic-complexity Denial of Service in `parse()` (CWE-407)
- criticalGHSA-w7jw-789q-3m8pshell-quote quote() does not escape newlines in object .op values
cross-spawn 6.0.5
1 advisory. Fixed in 7.0.5.
How it can be abusedThis package launches child processes and has a flaw where certain crafted command strings make it hang while processing them with an inefficient pattern match. In this repo it only runs during local development and builds, when developers or their own scripts run CLI commands like 'next build', so an attacker would need control over the command line arguments being spawned, which normal users of apps built with Next.js never have.
- highGHSA-3xgq-45jj-v275Regular Expression Denial of Service (ReDoS) in cross-spawn
dd-trace 4.12.0
1 advisory. Fixed in 5.100.0.
How it can be abusedAn attacker could send specially crafted W3C baggage headers with requests to a running server, and the flawed header parsing could exhaust resources and crash the process. This affects anyone serving an application that uses dd-trace to instrument its HTTP traffic; in this repo dd-trace is only used for internal tooling, not shipped to framework users.
- highGHSA-wxqq-gcq8-c443dd-trace-js: Improper parsing of W3C baggage headers may lead to DoS
image-size 1.2.1
2 advisories.
How it can be abusedAn attacker can send a specially crafted JXL, HEIF, or ICNS image that makes the parser loop forever, hanging the process. In this repo, image-size is used during image handling in the framework, so anyone building an app that processes untrusted user-supplied images through next/image could have their server or build freeze up.
- highGHSA-5p2g-fcmc-qvqqimage-size: JXL and HEIF parsers allow denial of service through infinite loops
- highGHSA-w3rx-r6r6-pgprimage-size: ICNS parser allows denial of service through an infinite loop
js-yaml 4.2.0
2 advisories. Fixed in 3.15.0.
How it can be abusedA malicious or crafted YAML file with deeply chained merge keys could make the parser hang the CPU for a long time when loaded, freezing a developer's build or CI run. This mainly affects people running Next.js development tooling or tests on untrusted YAML content, not production apps serving users.
- highGHSA-52cp-r559-cp3mjs-yaml: YAML merge-key chains can force quadratic CPU consumption
- highGHSA-5p4m-2wfm-xmqjJS-YAML: Quadratic CPU consumption in !!omap resolution (3.x and 4.x) — CVE-2026-59870 fix not backported
minimatch 3.0.4
4 advisories. Fixed in 10.2.3.
How it can be abusedAn attacker could craft a long or unusual file path that makes the pattern matcher hang while checking filenames during builds or file serving, freezing the process until it finishes. This mainly affects developers running builds and any server that matches user-influenced paths against glob patterns.
- highGHSA-23c5-xmqv-rm74minimatch ReDoS: nested *() extglobs generate catastrophically backtracking regular expressions
- highGHSA-3ppc-4f35-3m26minimatch has a ReDoS via repeated wildcards with non-matching literal in pattern
- highGHSA-7r86-cg39-jmmjminimatch has ReDoS: matchOne() combinatorial backtracking via multiple non-adjacent GLOBSTAR segments
- highGHSA-f8q6-p94x-37v3minimatch ReDoS vulnerability
moment 2.24.0
2 advisories. Fixed in 2.29.2.
How it can be abusedIf an app served or built with this codebase let outside users pick a locale name or feed dates into moment, an attacker could make it read files from other folders or send crafted strings that hang the CPU for a long time. In this repo moment is only used in build scripts and tests, not to handle real user input at runtime.
- highGHSA-8hfj-j24r-96c4Path Traversal: 'dir/../../filename' in moment.locale
- highGHSA-wc69-rhjr-hc9gMoment.js vulnerable to Inefficient Regular Expression Complexity
nanoid 3.1.30
2 advisories. Fixed in 3.3.16.
How it can be abusedAn attacker would need to control the size argument passed to nanoid in your code, since passing zero or a negative number makes the generator spin forever instead of returning an ID, hanging that request or process. Next.js itself uses nanoid with fixed sizes internally, so this mainly matters if your own application code feeds user input into nanoid's size parameter.
- highGHSA-28wg-ghj8-5hjvnanoid: non-secure generators can loop indefinitely with negative size
- highGHSA-2v37-7h3g-55p8nanoid: custom generators can loop indefinitely when size is zero
octokit 3.1.0
1 advisory. Fixed in 9.26.3.
How it can be abusedAn attacker could send crafted fake webhook requests to crash a service that uses octokit's webhook handling, knocking it offline until restarted. In this repo octokit is only used by internal development and CI scripts that talk to GitHub's API, so it never ships to end users of Next.js.
- highGHSA-pwfr-8pq7-x9qvUnauthenticated Denial of Service in the octokit/webhooks library
semver 7.3.7
1 advisory. Fixed in 7.5.2.
How it can be abusedAn attacker could feed a crafted version string, such as through a malicious package name or version in a lockfile or registry response, into code that parses versions with semver. The flawed regex then hangs the process for a long time. In Next.js this mainly affects developers running installs and builds, not end users visiting sites.
- highGHSA-c2qf-rxjj-qqgwsemver vulnerable to Regular Expression Denial of Service
ws 8.2.3
2 advisories. Fixed in 5.2.4.
How it can be abusedAn attacker could crash the development server by sending it crafted websocket requests, such as one with thousands of headers or many tiny message fragments that pile up in memory. Only developers running Next.js locally or anyone exposing a dev server would be hit; production apps do not ship this package.
- highGHSA-3h5v-q93c-6h6qws affected by a DoS when handling a request with many HTTP headers
- highGHSA-96hv-2xvq-fx4pws: Memory exhaustion DoS from tiny fragments and data chunks
Code review
No concrete code-level issues confirmed.
Get this report every week for your repos.
GitZoid learns each repo, reports what changed, and flags what needs attention. One flat price for the whole team.
$19 a month, flat · First 10 outputs free · No card required