Migrate to TanStack Start and pin the Vercel preset

Vercel auto-detected the Hydrogen preset from the @shopify/hydrogen
dependency and failed building a 'hydrogen' Edge Function. The app is now
TanStack Start (SSR via Nitro), and vercel.json pins the tanstack-start
preset and installs with Corepack so Yarn 4 is used.

- Router factory with per-request QueryClient and SSR query dehydration
- Hono API mounted as a Start server route at /api/*
- Account reads in loaders go through server functions (cookies on SSR)
- Loaders prefetch listing pages so products are in the server HTML
- Add graphql peer dependency for gql.tada

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Rami Bitar
2026-10-03 11:35:35 -04:00
co-authored by Claude Opus 5.5
parent c447c51e82
commit 160e65f0ed
26 changed files with 732 additions and 249 deletions
+8 -6
View File
@@ -4,26 +4,30 @@
"private": true,
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "vite build && vite build --ssr server/node.ts --outDir dist/server",
"start": "NODE_ENV=production node dist/server/node.js",
"dev": "vite dev",
"build": "vite build",
"start": "node .output/server/index.mjs",
"typecheck": "tsc --noEmit && hydrogen gql check"
},
"packageManager": "yarn@4.18.0+sha512.fcb8716fe7cd0eece141ffc18b92193a9df9204c1ba83189c288835223fc0bbe64af473bab0d5e9927a7daeb5caf2bb07eb2787cc9338ca040ea125f2a1f2f7e",
"dependencies": {
"@fontsource-variable/geist": "^5.3.0",
"@fontsource-variable/geist-mono": "^5.3.0",
"@hono/node-server": "^2.1.3",
"@remixicon/react": "^4.9.0",
"@shopify/hydrogen": "0.0.0-preview-116d5d7-20260730141607",
"@tanstack/query-core": "^5.104.1",
"@tanstack/react-query": "^5.104.1",
"@tanstack/react-router": "^1.170.41",
"@tanstack/react-router-ssr-query": "^1.167.3",
"@tanstack/react-start": "^1.168.60",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
"framer-motion": "^12.42.2",
"graphql": "^17.0.2",
"hono": "^4.13.12",
"lucide-react": "^0.562.0",
"nitro": "3.0.260903-beta",
"radix-ui": "^1.6.7",
"react": "^19.3.0",
"react-dom": "^19.3.0",
@@ -31,9 +35,7 @@
"zustand": "^5.0.15"
},
"devDependencies": {
"@hono/vite-dev-server": "^0.26.1",
"@tailwindcss/vite": "^4.3.3",
"@tanstack/router-plugin": "^1.168.42",
"@types/node": "^26.6.4",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",