Skip to content

docs: settle whether Turbopack traces without standalone — it does - #272

Merged
jouwdan merged 1 commit into
mainfrom
claude/mei-138-nft-json-without-standalone
Aug 27, 2026
Merged

docs: settle whether Turbopack traces without standalone — it does#272
jouwdan merged 1 commit into
mainfrom
claude/mei-138-nft-json-without-standalone

Conversation

@jouwdan

@jouwdan jouwdan commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Answers MEI-138, the question MEI-134 left open. Documentation only — nothing needed reverting either way, as the ticket predicted.

The answer: yes, and the include globs are applied too

MEI-134 established that outputFileTracingIncludes is honoured, but every measurement came from output: 'standalone'. next.config.mjs skips standalone when VERCEL is set, and which configurations Turbopack emits trace files for is decided inside the Rust binary — not readable out of next/dist.

Two builds of apps/community, differing in nothing but that setting:

output unset (VERCEL=1) output: 'standalone'
standalone/ tree absent present
.nft.json emitted (excluding the standalone tree's copies) 136, of which 132 routes 136, of which 132 routes
a route's .nft.json (covered by '/**') 2958 files, 1318 @swc/helpers, 324 under esm/, 3 LICENSE identical
routes carrying no esm/ entry 0 of 132 0 of 132
next-server.js.nft.json (not covered by '/**') 5 @swc/helpers, none under esm/ 5 @swc/helpers, none under esm/

The route figures reproduce MEI-134's numbers exactly (1318 / 324), which independently corroborates that measurement. So the glob is load-bearing on every route this app builds, not only on the Docker and self-hosted paths — the second of the ticket's two branches ("the glob is inert on Vercel") is ruled out.

Two traps worth recording, both of which I hit

The ticket's own commands would have produced a wrong reading, so the docs now warn about both:

  1. grep -c is misleading here. Each .nft.json is one long line, so grep -c 'swc/helpers/esm' reports 1 for a file holding 1318 matches. It looked like the includes were not being applied until I parsed the JSON. Real counts need json.load/jq.
  2. next-server.js.nft.json is at the dist root, not under server/. Looking for it under server/ reports it absent in both builds, which reads like a difference between them and is not one. A standalone build also leaves a second copy of every route's file inside standalone/, which inflates a naive find | wc -l by 132.

What this does not establish

That Vercel's own builder assembles a function from those files. That is the documented mechanism and the reason to expect it, but it was not measured and cannot be from a local build. The docs say so explicitly rather than implying the stronger claim.

The narrow consequence, per the ticket: a packages/db/migrations/**/* entry was worth trying for the missing migration files on Vercel rather than dismissed as inert. vercel.md gains a clause saying so — while keeping MEI-133's schema check as the better design, for the lock-contention and function-timeout reasons that bullet already gives.

Changes

File Change
docs/contributing/development.md New paragraph beside the glob with the table above, the reproduction command, and the two measurement traps. Also corrects MEI-134's "three" @swc/helpers entries in next-server.js.nft.json — it measures five now.
docs/getting-started/deployment/vercel.md The installer bullet's "nothing lists them in outputFileTracingIncludes either" was accurate but incomplete; it now notes that listing them would not have been inert, so the schema check reads as a choice rather than the only option.

Both probe builds (.next-probe, .next-probe-standalone) were deleted, as the ticket instructed — git status is clean apart from the two documents.

Validation

  • pnpm verify passes (exit 0) — 467 test files, 8189 tests, lint, guards, all three typechecks.
  • pnpm docs:links:check and pnpm site:docs:check pass, so the new cross-links and the #building-where-vercel-looks anchor resolve.
  • The two probe builds themselves both exited 0.

Generated by Claude Code

MEI-134 established that outputFileTracingIncludes is honoured, but every
measurement came from a build with output: 'standalone'. next.config.mjs
skips standalone when VERCEL is set, so the glob's behaviour on the one
deployment that builds without it was unmeasured, and Turbopack decides it
inside the Rust binary where next/dist cannot be read for an answer.

Two builds of apps/community differing in nothing but that setting produce
identical tracing output: 136 .nft.json files either way, every one of the
132 route files carrying 1318 @swc/helpers entries with 324 under esm/, and
next-server.js.nft.json — outside the '/**' key — carrying five and none
under esm/ in both. The glob is load-bearing on every route, not only for
Docker and self-hosting.

Recorded beside the glob, with the reproduction and the two traps the
measurement has: grep -c reports 1 on a single-line .nft.json, and
next-server.js.nft.json sits at the dist root rather than under server/.

What this does not establish is that Vercel's builder assembles a function
from those files, so vercel.md gains a clause saying the migration-files
problem had a second possible solution rather than none, while keeping the
schema check as the better design for the reasons already given there.

MEI-134's "three" @swc/helpers entries in next-server.js.nft.json measures
five now; corrected in passing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GVdrZfcwVhvJpZWUKWxYs9
@jouwdan
jouwdan merged commit befdd97 into main Aug 27, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants