Skip to content

Add benchmarks/tanstack-com: the real tanstack.com as a 3-flavor benchmark (react / redact / octane) - #207

Merged
trueadm merged 5 commits into
mainfrom
claude/tanstack-com-bench
Jul 20, 2026
Merged

trueadm merged 5 commits into
mainfrom
claude/tanstack-com-bench

Conversation

@trueadm

@trueadm trueadm commented Jul 20, 2026 •

Copy link
Copy Markdown
Collaborator

What

Phase 2 of the TanStack Start benchmark (Phase 1): TanStack's production website, pinned at TanStack/tanstack.com@3b4add9c and built three ways on identical app code and pinned content:

Flavor Engine How
react stock React 19 react/ + BENCH_DIST=dist (redact alias off — upstream's DISABLE_REDACT path)
redact @tanstack/redact (Tanner's React-compatible engine) same source, BENCH_REDACT=true build → dist-redact — the alias map production actually deploys
octane Octane on @octanejs/tanstack-start octane/ — Phase 2c scaffold boots; shell port lands next

Permission: 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@edf55759 docs/ (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:

  • Docs: TANSTACK_DOCS_LOCAL=true forces upstream's own local-files docs mode in production, reading the pinned snapshot. Negative control proven: a broken snapshot dir 404s with fetchFs warnings — no GitHub fallback.
  • Auth/users/doc-feedback/shop server fns: answer exactly what upstream serves an anonymous visitor (states upstream produces without touching Postgres/Shopify).
  • Sponsors + npm/GitHub stats: fixed fixtures; the homepage npm summary is null — a legitimate upstream cache-miss state rendering the designed static fallbacks.
  • Partner ad rotation: seeded via BENCH_PARTNER_SEED.

Redact-under-node finding (worth relaying to Tanner)

Running the redact flavor on plain node needs ssr.noExternal: true in addition to the redact() 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

  • react flavor: 13/13 benchmark routes 200 (5–100ms), clean server logs
  • redact flavor: 5/5 spot-checked routes 200, real content
  • octane scaffold: / 200 with doctype + theme bootstrap via nitro .output
  • pnpm typecheck clean (after pinning the vendored app's TypeScript to catalog:default — a second TS major re-keys shared peer instances (lexical) across the workspace and breaks their types), format:check clean, evals corpus regenerated

Next (follow-up PRs)

  • Phase 2c: port the shell to octane (Navbar, LibraryLayout, markdown subsystem, homepage). Any octane bug it exposes gets fixed in packages/octane on this branch-line — never worked around (policy pinned in the README).
  • Phase 2d: 3-way structural compare gate + same-spec Playwright + perf suite, reusing the Phase 1 harness patterns.

🤖 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 at 3b4add9c, 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, Node serve.mjs instead of Workers). Router docs are vendored from TanStack/router at edf55759 under content/repos/router/. All flavors use ssr.noExternal: true so redact under Node does not mix stock React with the redact renderer.

Repo hygiene: ignore dist-redact and .content-collections in .gitignore / .prettierignore; workspace already includes benchmarks/tanstack-com/*.

Reviewed by Cursor Bugbot for commit b82d6a3. Bugbot is set up for automated code reviews on this repo. Configure here.

…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]>
@vercel

vercel Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
octane-website Skipped Skipped Jul 20, 2026 8:45pm
octane-website-mcp Skipped Skipped Jul 20, 2026 8:45pm

Request Review

@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 20, 2026 20:35 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 20, 2026 20:36 Inactive
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9289920. Configure here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 20, 2026 20:41 Inactive
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]>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Fix All in Cursor

❌ 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;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 92ed9c4. Configure here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@trueadm
trueadm force-pushed the claude/tanstack-com-bench branch from 92ed9c4 to 9dd7d81 Compare July 20, 2026 20:41
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 20, 2026 20:42 Inactive
…ench

# Conflicts:
#	packages/octane-evals/datasets/train/user-apps-v1/manifest.jsonl
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 20, 2026 20:42 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 20, 2026 20:43 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 20, 2026 20:44 Inactive
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]>
@vercel
vercel Bot temporarily deployed to Preview – octane-website-mcp July 20, 2026 20:45 Inactive
@vercel
vercel Bot temporarily deployed to Preview – octane-website July 20, 2026 20:45 Inactive
@trueadm
trueadm merged commit d1b9b41 into main Jul 20, 2026
22 checks passed
@trueadm
trueadm deleted the claude/tanstack-com-bench branch July 20, 2026 21:04

This branch was previously deployed

2 inactive deployments
Preview – octane-website-mcp — b82d6a30 Deployed Jul 20, 2026 by vercel[bot]
Preview – octane-website — b82d6a30 Deployed Jul 20, 2026 by vercel[bot]
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.

1 participant