Summary of "TanStack Start is no joke."

What this video covers

Goal: Build a local monorepo containing Payload CMS as the backend and TanStack Start as the frontend, sharing types and calling Payload’s local API from TanStack Start.

Key technological concepts & product features

TanStack Start

Payload CMS

Integration patterns demonstrated

Monorepo setup

Calling Payload from TanStack Start

Because TanStack Start pages aren’t React Server Components yet, use server functions to fetch data from Payload:

File-based routing and dynamic routes

Types & shared typings

Practical implementation details, problems encountered & workarounds

Step-by-step checklist (high level)

  1. Create Payload backend: npx create-payload-app (blank template) — remove front-end if unused.
  2. Create TanStack Start app: pnpm create tanstack-start (enable file-based routing).
  3. Set up pnpm-workspace.yaml and top-level package.json scripts for dev, generate types, etc.
  4. Export Payload config & types from CMS source/index.ts for cross-package imports.
  5. Create collections (e.g., posts) in Payload with fields: title, slug, rich text, image relation.
  6. Generate types (script) and install needed packages (Zod, payload rich-text converter).
  7. In the TanStack Start route:
    • Create a server function (createServerFunction) with input validation (Zod).
    • Dynamically import Payload and CMS config in the server function handler.
    • Query Payload (payload.find) and return results.
    • In the route loader, call the server function and use useLoaderData in the component to render results.
  8. Handle images & rich text: cast media types, use image tooling (e.g., unpic), convert rich text to HTML for rendering.
  9. If encountering SSR/type issues: try Vite optimizeDeps exclude, regenerate types, or use JSON.stringify/JSON.parse as a temporary coercion.

Reviewer observations / opinions

Resources & references mentioned

Main speaker / sources

Category ?

Technology


Share this summary


Is the summary off?

If you think the summary is inaccurate, you can reprocess it with the latest model.

Video