secondsky/claude-skills / plugins/tanstack-start/skills/tanstack-start
tanstack-start
VerifiedTanStack Start (RC) full-stack React with server functions, SSR, Cloudflare Workers. Use for Next.js migration, edge rendering, or encountering hydration, auth, data pattern errors.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 6.4 KB |
| references/cloudflare-hosting-and-env.md | markdown | 2.6 KB |
| references/devtools-and-llm-support.md | markdown | 1.2 KB |
| references/execution-and-auth.md | markdown | 2.1 KB |
| references/navigation-and-preloading.md | markdown | 1.6 KB |
| references/quickstart-and-layout.md | markdown | 2.8 KB |
| references/rendering-modes.md | markdown | 2.0 KB |
| references/routing-and-data-loading.md | markdown | 2.3 KB |
| references/server-functions-and-middleware.md | markdown | 2.9 KB |
| scripts/bootstrap-cloudflare-start.sh | script | 1.1 KB |
references/rendering-modes.md
View on GitHub# Rendering Modes & Hydration
## SSR, Data-Only, or CSR
- Default: routes render + hydrate on the server (`ssr: true`).
- Per-route override:
```tsx
export const Route = createFileRoute('/chart')({
ssr: 'data-only', // options: true | false | 'data-only'
loader: () => getChartData(),
component: Chart,
})
```
- Make SSR opt-in/off by default:
```ts
// app/start.ts
export const start = createStart(() => ({ defaultSsr: false }))
```
- Use the functional form for context-aware SSR: `ssr: ({ params, search }) => search.value?.preview ? 'data-only' : true`.
## SPA Mode (global CSR)
Disable all SSR (loaders + components) when you want a pure SPA but keep Start’s router + server functions:
```ts
export const start = createStart(() => ({
spaMode: true,
defaultPreloadStaleTime: 0,
}))
```
## Static Prerender (SSG)
Enable Vite plugin prerendering to emit static HTML during `npm run build`:
```ts
// vite.config.ts
plugins: [
tanstackStart({
prerender: {
enabled: true,
autoStaticPathsDiscovery: true, // crawl links and static routes
autoSubfolderIndex: true, // /page/index.html output
},
}),
]
```
- Exclude routes with params from auto-discovery; add them via `pages` or ensure crawlable links.
- Combine with Cloudflare Workers Assets/Pages for zero-runtime hosting when no server functions are used.
## Hydration Error Playbook
- Make server + client deterministic: hoist locale/time zone to cookies, avoid `Date.now()` in render, seed random IDs.
- Use `<ClientOnly>` for inherently client-side widgets (e.g., canvas, relative time).
- Prefer `ssr: 'data-only'` instead of suppressing hydration when markup differs.
- Only use `suppressHydrationWarning` for tiny, known-different fragments (timestamps).
## Pending UI for non-SSR routes
- First route with `ssr: false` or `'data-only'` shows `pendingComponent` (or `defaultPendingComponent`) while the client loads.
- Set `minPendingMs` to avoid flash during hydration for CSR-heavy routes.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |