Skip to content

feat: migrate to TanStack Start + React on Cloudflare - #33

Merged
jackmcpickle merged 5 commits into
mainfrom
cursor/tanstack-start-migration-4484
Aug 6, 2026
Merged

feat: migrate to TanStack Start + React on Cloudflare#33
jackmcpickle merged 5 commits into
mainfrom
cursor/tanstack-start-migration-4484

Conversation

@jackmcpickle

@jackmcpickle jackmcpickle commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

Migrates tokenmaxer.quest from Hono + hono/jsx SSR to TanStack Start + React on Cloudflare Workers, while keeping the existing Hono JSON/API, agent markdown, OG images, reporter script, and cookie mutation routes.

Architecture

  • TanStack Start serves browser HTML via file routes + createServerFn loaders (src/routes/*, src/core/api/*)
  • Hono keeps /api/*, /tokentally.mjs, /llms*, *.md, OG PNGs, /invite, /auth, /h/*/join
  • Custom Worker entry (src/server.ts) dispatches by path + Accept / Sec-Fetch-Mode
  • Shared React page components under src/pages/* (converted from hono/jsx)

Patterns

Adapted from delacour-agent-skills (dlc-scaffold-tanstack): file routes, createServerFn, server-only DB access. Uses Cloudflare Vite plugin instead of Nitro bun (required for existing Workers/D1/KV deploy).

Verification

  • pnpm check green locally (362 tests)
  • pnpm build + pnpm preview smoke (HTML pages, API, agent markdown, reporter)
  • Browser QA on local preview and on Cloudflare-deployed host (https://tokenmaxer.quest — Workers Builds for this PR; asset hashes match the branch build)
  • Agent negotiation fix: only Sec-Fetch-Mode: navigate counts as browser (Workers/Vite injects cors)

Notable follow-ups

  • Branch preview alias URL was not posted in the CF PR comment; version preview subdomain could not be resolved without account API access. Functional verification used the Workers Builds deployment that is serving the custom domain with this PR’s assets.
Open in Web Open in Cursor 

cursoragent and others added 3 commits August 6, 2026 13:59
- Add vite.config.ts with cloudflare, tanstackStart, and react plugins
- Add router, root/index routes, and server entry re-exporting TanStack handler
- Update tsconfig for React JSX and vite/client types
- Point wrangler main to src/server.ts
- Update dev/build/preview/deploy scripts for Vite
- Add .output and node_modules/.vite to gitignore

Co-authored-by: Jack McNicol <jackmcpickle@users.noreply.github.com>
Create file routes for all minimum HTML pages, reusing existing page
components with createServerFn loaders that call cached-aggregate and
Cloudflare env bindings. Add site.api.ts and board.api.ts server functions,
request-auth helpers, embedded Layout support, and font preconnects in root.

Co-authored-by: Jack McNicol <jackmcpickle@users.noreply.github.com>
Convert pages to React, serve HTML via TanStack Start file routes and
createServerFn loaders, and keep Hono for API/agent/OG/reporter/cookie
routes. Preserve existing functionality and unit tests.

Co-authored-by: Jack McNicol <jackmcpickle@users.noreply.github.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
tokentally 99b19b0 Aug 06 2026, 02:16 PM

@socket-security

socket-security Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedvite@​7.3.6 ⏵ 8.2.198 +110082 +196 -1100
Addedreact@​19.2.81001008497100
Addedreact-dom@​19.2.81001009298100

View full report

cursoragent and others added 2 commits August 6, 2026 14:11
Treat only Sec-Fetch-Mode navigate as a browser signal so Workers/Vite
injected cors mode does not force HTML for curl/agents. Stop validateSearch
from rewriting bare URLs with default query params.

Co-authored-by: Jack McNicol <jackmcpickle@users.noreply.github.com>
TanStack regenerates src/routeTree.gen.ts with its own formatting,
which was failing CI oxfmt --check.

Co-authored-by: Jack McNicol <jackmcpickle@users.noreply.github.com>
@jackmcpickle
jackmcpickle marked this pull request as ready for review August 6, 2026 14:26
@jackmcpickle
jackmcpickle merged commit 6724d0d into main Aug 6, 2026
5 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