Open-Source Wikis

/

Next.js

/

By the numbers

vercel/next.js

By the numbers

Data collected on 2026-04-30 against commit 4ba05cc300cd3f196bdcebe56de2f6811171bb68 on the canary branch.

Size

The repository is dual-language: TypeScript/JavaScript for the framework runtime and CLI, Rust for the compiler and bundler.

xychart-beta horizontal
    title "Lines of source code by area"
    x-axis ["TypeScript (packages/next/src)", "Rust (crates/ + turbopack/crates)", "MDX docs", "JavaScript (packages)"]
    y-axis "Lines of code" 0 --> 280000
    bar [273149, 269139, 71035, 11389]
Area Lines Files
TypeScript in packages/next/src/ 273,149 1,592
Rust in crates/ + turbopack/crates/ 269,139 948
Documentation (MDX) in docs/ 71,035 many
JavaScript in packages/ (excl. compiled) 11,389 many
Other counts Value
Total git commits (since 2016-10-05) 33,861
Cargo workspace Cargo.toml files 69
Vendored compiled packages in packages/next/src/compiled/ 141
Example apps in examples/ 229
Test files 1,714

The flagship packages/next package has 1,592 TypeScript files and a 273k-line src/ tree. The Rust side is comparably sized at 269k lines split across 948 files in 69 Cargo crates.

Activity

The project moves quickly. Recent commit volume is sustained at thousands of commits per quarter.

Window Commits
Last 90 days 1,325
Last 6 months 2,330
Total 33,861

Most-changed top-level paths in the last 90 days

Path Touches
packages/next/ 3,965
turbopack/crates/ 3,835
test/e2e/ 2,332
docs/01-app/ 359
test/production/ 339
test/development/ 314
crates/next-core/ 261
evals/evals/ 203
test/integration/ 182
packages/create-next-app/ 179
packages/next-routing/ 173

The packages/next core, the Turbopack subtree, and the e2e test suite together account for the majority of activity.

Bot-attributed commits

Of the 2,330 commits in the last 6 months:

  • 41 commits with [bot] in the subject line (≈1.8%)
  • 51 commits with [bot] in the Co-authored-by: trailer (≈2.2%)

These numbers are a lower bound — they only count commits that explicitly attribute work to a bot. Commits made with inline AI assistance (Copilot, Cursor, ChatGPT) leave no trace in git history.

Complexity

Largest source files

The biggest files are the App Router renderer, the build orchestrator, and the segment cache.

File Lines Why it's big
packages/next/src/server/app-render/app-render.tsx 8,759 The App Router renderer — RSC + SSR + PPR pipeline
packages/next/src/build/index.ts 4,401 Build pipeline orchestration
packages/next/src/client/components/segment-cache/cache.ts 3,112 Client-side segment cache
packages/next/src/server/base-server.ts 3,070 Shared server logic for Node + Edge
packages/next/src/build/webpack-config.ts 2,936 webpack config generator
packages/next/src/server/use-cache/use-cache-wrapper.ts 2,861 The 'use cache' directive runtime
packages/next/src/shared/lib/router/router.ts 2,630 Pages Router state machine
packages/next/src/server/config.ts 2,321 Config loader and validator
packages/next/src/build/adapter/build-complete.ts 2,215 Adapter for hosting platforms
packages/next/src/server/config-shared.ts 2,201 Config types and defaults
packages/next/src/server/next-server.ts 2,178 Node.js production server
packages/next/src/client/components/router-reducer/ppr-navigations.ts 2,061 PPR navigation reducer
packages/next/src/build/templates/app-page.ts 2,028 Template compiled into user bundles

TODO / FIXME / HACK comments

packages/next/src/ contains 729 lines tagged TODO, FIXME, or HACK. Many are scoped to specific features (cache components migration, Turbopack parity gaps) and turn over with releases.

Dependency surface

The root package.json lists ~270 lines of dependencies (devDependencies plus pinned overrides). The framework itself bundles 141 third-party packages into packages/next/src/compiled/ so users do not transitively pull them in. Notable inclusions: webpack 5, postcss, browserslist, busboy, async-sema, the @opentelemetry/* family, and the entire Babel toolchain.

Per-area pulse

Area Source files Tests Recent activity (90d)
App Router runtime packages/next/src/server/app-render/ (~70 files) test/e2e/app-dir/ (1000+ tests) very high
Pages Router packages/next/src/server/render.tsx, pages/ test/integration/ moderate
Build pipeline packages/next/src/build/ (~150 files) test/production/ high
Dev server packages/next/src/server/dev/ (~22 files) test/development/ high
Turbopack turbopack/crates/ (54 crates) turbopack/crates/turbopack-tests/ very high
next-swc crates/next-custom-transforms/ fixture-based moderate

For per-subsystem dives, see the systems, packages, crates, and turbopack sections.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

By the numbers – Next.js wiki | Factory