Repository navigation
Add benchmarks/tanstack-com: the real tanstack.com as a 3-flavor benchmark (react / redact / octane) - #207
Conversation
…hmark (react/redact/octane) Phase 2 of the TanStack Start benchmark: TanStack's production website, pinned at TanStack/tanstack.com@3b4add9c (with Tanner's permission — the repo is unlicensed; benchmark-fixture use only), built and served three ways on identical app code and pinned content. react flavor (benchmarks/tanstack-com/react): vendored app trimmed from 160 to 29 route files (home, blog, libraries, router landing, docs chain, static pages, txt/xml endpoints). Cloudflare/Sentry/GA/devtools removed; DB/auth/Shopify server-fn seams stubbed to upstream's exact anonymous-visitor responses; sponsors + npm/GitHub stats fixed fixtures; partner rotation seeded (BENCH_PARTNER_SEED). Docs content is a pinned snapshot of TanStack/router@edf55759 docs/, served through upstream's own local-files mode via a TANSTACK_DOCS_LOCAL production knob (negative control: broken snapshot dir 404s — no GitHub fallback). Node serving via srvx serve.mjs; blog trimmed to the 12 newest posts. Upstream originals preserved beside every rewritten file as *.upstream.*.txt. redact flavor (same dir, BENCH_REDACT=true → dist-redact): @tanstack/redact (Tanner's React-compatible engine) aliased over react/react-dom exactly as production deploys it. Running it under node needs the redact() vite plugin plus ssr.noExternal: true — any externalized react-consumer (visx, ai-react, devtools) loads stock React beside redact's renderer and crashes with a null dispatcher; the Workers build masks this by bundling everything. Bundling is now symmetric across flavors so the server builds stay config-identical. octane flavor (benchmarks/tanstack-com/octane): Phase 2c scaffold on @octanejs/tanstack-start (nitro .output server, tailwind+typography, theme bootstrap) — boots and serves; the shell port lands next. Both built flavors serve every benchmark route 200, fully offline. The vendored app pins typescript to catalog:default — a second TS major re-keys shared peer instances (lexical) across the workspace and breaks their types. Co-Authored-By: Claude Fable 5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
| NODE_ENV=production PORT=4200 BENCH_PARTNER_SEED=bench \ | ||
| TANSTACK_DOCS_LOCAL=true TANSTACK_LOCAL_REPOS_DIR=$PWD/content/repos \ | ||
| node react/serve.mjs # react flavor | ||
| BENCH_DIST=dist-redact ... node react/serve.mjs # redact flavor |
There was a problem hiding this comment.
Shared dist overwrites flavors
Medium Severity
BENCH_REDACT toggles aliases but never sets build.outDir, so react and redact builds both write to dist/. Serving via BENCH_DIST=dist-redact depends on a manual rename the README only mentions in a comment, so a normal sequential build can leave one flavor missing or overwrite the other.
Reviewed by Cursor Bugbot for commit 9289920. Configure here.
There was a problem hiding this comment.
Fixed in 9dd7d81 — BENCH_REDACT=true now sets build.outDir: 'dist-redact' directly (the Start plugin honors the top-level outDir), so each flavor owns its output tree and a sequential two-flavor build cannot overwrite the other. The manual-rename step is gone from the README flow. Verified by building both flavors fresh and serving them side by side (/ and the docs route → 200 on each).
BENCH_REDACT=true now writes dist-redact/ directly (build.outDir), so a sequential two-flavor build can never overwrite the other flavor's artifacts; the manual-rename step is gone from the README flow. Verified both flavors building fresh and serving side by side (/, docs → 200 each). Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 92ed9c4. Configure here.
| res.setHeader('Content-Type', MIME[path.extname(file)] ?? 'application/octet-stream'); | ||
| fs.createReadStream(file).pipe(res); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Static path join escapes root
High Severity
path.join(clientDir, pathname) drops clientDir because pathname is absolute (URL paths start with /). The static handler therefore resolves against the filesystem root, so requests like /etc/passwd can be served when that file exists, and normal client assets under dist/client never hit this fast path.
Reviewed by Cursor Bugbot for commit 92ed9c4. Configure here.
There was a problem hiding this comment.
Addressed in b82d6a3. For the record, the described mechanism doesn't occur: path.join (unlike path.resolve) never discards the base for a '/'-prefixed segment — join(clientDir, '/etc/passwd') → <clientDir>/etc/passwd — and .. is rejected after decodeURIComponent, so assets were served through this branch and escapes weren't possible (same conclusion as the identical finding on #197, verified against the live server there and again here). That said, since the pattern keeps tripping review, the invariant is now explicit: a path.relative containment check gates the fast path. Re-verified on the running server: client asset → 200 text/javascript; --path-as-is /etc/passwd → 404; encoded traversal → 404.
92ed9c4 to
9dd7d81
Compare
…ench # Conflicts: # packages/octane-evals/datasets/train/user-apps-v1/manifest.jsonl
Co-Authored-By: Claude Fable 5 <[email protected]>
path.join (unlike path.resolve) keeps clientDir as the base for '/'-prefixed pathnames and '..' is rejected post-decode, so the handler was already contained — but the invariant now has an explicit path.relative containment check so it doesn't need that argument. Verified: client assets still 200 through the fast path; absolute-path and encoded-traversal probes 404. Co-Authored-By: Claude Fable 5 <[email protected]>


What
Phase 2 of the TanStack Start benchmark (Phase 1): TanStack's production website, pinned at TanStack/tanstack.com@
3b4add9cand built three ways on identical app code and pinned content:reactreact/+BENCH_DIST=dist(redact alias off — upstream'sDISABLE_REDACTpath)redact@tanstack/redact(Tanner's React-compatible engine)BENCH_REDACT=truebuild →dist-redact— the alias map production actually deploysoctane@octanejs/tanstack-startoctane/— Phase 2c scaffold boots; shell port lands nextPermission: tanstack.com's repo is unlicensed; this port exists with Tanner's permission (2026-07-20) as an in-repo benchmark fixture only. Docs content is a pinned snapshot of TanStack/router@
edf55759docs/(MIT).Determinism
All benchmark routes serve fully offline: no network, no secrets. Every delta from upstream is confined to external-service seams, documented in
benchmarks/tanstack-com/README.md, applied identically to every flavor, and preserves the upstream original beside the rewrite (*.upstream.*.txt). Highlights:TANSTACK_DOCS_LOCAL=trueforces upstream's own local-files docs mode in production, reading the pinned snapshot. Negative control proven: a broken snapshot dir 404s withfetchFswarnings — no GitHub fallback.null— a legitimate upstream cache-miss state rendering the designed static fallbacks.BENCH_PARTNER_SEED.Redact-under-node finding (worth relaying to Tanner)
Running the redact flavor on plain node needs
ssr.noExternal: truein addition to theredact()vite plugin: any externalized react-consumer (the visx sponsor pack on/was the trigger; also ai-react, devtools) resolves stock React at runtime beside redact's renderer and crashes with a null dispatcher. The Workers deployment masks this by bundling everything unconditionally. Bundling is now symmetric across flavors so server builds stay config-identical for the perf comparison.Verification
/200 with doctype + theme bootstrap via nitro.outputpnpm typecheckclean (after pinning the vendored app's TypeScript tocatalog:default— a second TS major re-keys shared peer instances (lexical) across the workspace and breaks their types),format:checkclean, evals corpus regeneratedNext (follow-up PRs)
Navbar,LibraryLayout, markdown subsystem, homepage). Any octane bug it exposes gets fixed inpackages/octaneon this branch-line — never worked around (policy pinned in the README).🤖 Generated with Claude Code
Note
Low Risk
Benchmark-only fixture and documentation vendoring with no production runtime changes; large diff size is mostly pinned content and upstream app copy.
Overview
Introduces
benchmarks/tanstack-com: TanStack’s production site pinned at3b4add9c, trimmed to ~29 benchmark routes and served three ways on the same app code—stock React (dist/),@tanstack/redact(BENCH_REDACT=true→dist-redact/), and an Octane scaffold on@octanejs/tanstack-start(shell port in progress).Upstream-only changes stay at external seams (anonymous auth/shop, synthetic sponsors/stats, local docs via
TANSTACK_DOCS_LOCAL, seeded partner rotation, inert search modal, Nodeserve.mjsinstead of Workers). Router docs are vendored from TanStack/router atedf55759undercontent/repos/router/. All flavors usessr.noExternal: trueso redact under Node does not mix stock React with the redact renderer.Repo hygiene: ignore
dist-redactand.content-collectionsin.gitignore/.prettierignore; workspace already includesbenchmarks/tanstack-com/*.Reviewed by Cursor Bugbot for commit b82d6a3. Bugbot is set up for automated code reviews on this repo. Configure here.