docs: settle whether Turbopack traces without standalone — it does - #272
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
outputFileTracingIncludesis honoured, but every measurement came fromoutput: 'standalone'.next.config.mjsskips standalone whenVERCELis set, and which configurations Turbopack emits trace files for is decided inside the Rust binary — not readable out ofnext/dist.Two builds of
apps/community, differing in nothing but that setting:outputunset (VERCEL=1)output: 'standalone'standalone/tree.nft.jsonemitted (excluding the standalone tree's copies).nft.json(covered by'/**')@swc/helpers, 324 underesm/, 3LICENSEesm/entrynext-server.js.nft.json(not covered by'/**')@swc/helpers, none underesm/@swc/helpers, none underesm/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:
grep -cis misleading here. Each.nft.jsonis one long line, sogrep -c 'swc/helpers/esm'reports1for a file holding 1318 matches. It looked like the includes were not being applied until I parsed the JSON. Real counts needjson.load/jq.next-server.js.nft.jsonis at the dist root, not underserver/. Looking for it underserver/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 insidestandalone/, which inflates a naivefind | wc -lby 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.mdgains 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
docs/contributing/development.md@swc/helpersentries innext-server.js.nft.json— it measures five now.docs/getting-started/deployment/vercel.mdoutputFileTracingIncludeseither" 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 statusis clean apart from the two documents.Validation
pnpm verifypasses (exit 0) — 467 test files, 8189 tests, lint, guards, all three typechecks.pnpm docs:links:checkandpnpm site:docs:checkpass, so the new cross-links and the#building-where-vercel-looksanchor resolve.Generated by Claude Code