HOW NEXT.JS
ACTUALLY WORKS
The React framework for the web. Conventions, patterns, and architecture extracted from the vercel/next.js repository by sourcebook.
WHAT_MATTERS
-
→
TypeScript strict mode is OFF — agents shouldn't add strict type annotations
-
→
This is a monorepo — check workspace dependencies before modifying shared code
-
→
Generated files detected — editing them directly will break builds
-
→
packages/next/src/shared/lib/invariant-error.ts is a hub file (imported by 54 files) — changes here ripple everywhere
KEY_FINDINGS
Strict mode is OFF. Don't add strict type annotations that would break existing patterns.
HIGHPath aliases configured: development-sandbox, next-test-utils, next-webdriver, e2e-utils, test-data-service, test-log, router-act, @next/playwright. Use these instead of relative imports.
HIGHThis is a monorepo. Changes may affect multiple packages. Check workspace dependencies before modifying shared code.
HIGHTests use Jest. Test utilities in: turbopack/crates/turbopack-tracing/tests/node-file-trace/integration/ts-paths/fixtures/root.js.
HIGH4 test files
Generated files detected (test/integration/relay-graphql-swc-single-project/queries/__generated__/pagesQuery.graphql.ts, test/integration/relay-graphql-swc-multi-project/project-b/__generated__/pagesBQuery.graphql.ts, test/integration/relay-graphql-swc-multi-project/project-a/__generated__/pagesAQuery.graphql.ts, examples/with-xata/utils/xata.codegen.ts, examples/with-typescript-graphql/codegen.ts, ...). Do NOT edit these directly — modify the source/schema they are generated from.
HIGH19 generated files
Hub files (most depended on): packages/next/src/shared/lib/invariant-error.ts (imported by 54 files); packages/next/src/server/config-shared.ts (imported by 49 files); packages/next/src/server/route-modules/app-page/module.compiled.js (imported by 48 files); packages/next/src/server/request/params.ts (imported by 45 files); packages/next/src/shared/lib/app-router-types.ts (imported by 42 files). Changes here have the widest blast radius.
HIGHCircular import chains detected: describe.ts → compose.ts → index.ts → runner.ts; index.ts → runner.ts; module.js. Avoid adding to these cycles.
HIGH+ 1 MORE FINDINGS (MEDIUM CONFIDENCE)
UI components live in: turbopack/benchmark-apps/mui/components, test/production/typescript-basic/app/components, test/production/pages-dir/production/fixture/components. Add new components here.
MED3 component directories