# TanStack Start (React)

TanStack Start (React) scores 17 of 28 points on 14 speed features: 10/14 on first-paint levers and 7/14 on other features. Rank 8 of 23, tied with TanStack Start (Solid), Waku, Analog, Void (Svelte). Labels: 5 1st-party, 3 Experimental, 4 Third-party, 2 Manual.

- Version checked: @tanstack/react-start 1.169.1 (pinned; latest 1.169.7 as of 2026-11-24), Vite ^8.0.0 (?inline CSS; Unpic; own catalog cache)
- Performance guide: [Code Splitting | TanStack Router Docs](https://tanstack.com/router/latest/docs/framework/react/guide/code-splitting)
- Issue tracker: https://github.com/TanStack/router/issues
- Books demo port: [tanstack-books](https://github.com/MaxwellCohen/tanstack-books)

## Summary

| Feature | Group | Label | Points |
| --- | --- | --- | --- |
| [Production CSS inlining](https://framework-compare.vercel.app/features/css-inlining.md) | First-paint levers | Experimental | 1 |
| [Font optimization](https://framework-compare.vercel.app/features/font-optimization.md) | First-paint levers | Third-party | 1 |
| [Image pipeline](https://framework-compare.vercel.app/features/image-pipeline.md) | First-paint levers | Third-party | 1 |
| [Data/HTML caching](https://framework-compare.vercel.app/features/caching.md) | First-paint levers | 1st-party | 2 |
| [Route prefetching](https://framework-compare.vercel.app/features/route-prefetching.md) | First-paint levers | 1st-party | 2 |
| [Streaming SSR](https://framework-compare.vercel.app/features/streaming-ssr.md) | First-paint levers | 1st-party | 2 |
| [Early Hints / preload headers](https://framework-compare.vercel.app/features/early-hints.md) | First-paint levers | Experimental | 1 |
| [Islands / partial hydration / lazy slices](https://framework-compare.vercel.app/features/islands.md) | Other features | Experimental | 1 |
| [Per-route render modes](https://framework-compare.vercel.app/features/render-modes.md) | Other features | 1st-party | 2 |
| [Fine-grained client reactivity](https://framework-compare.vercel.app/features/reactivity.md) | Other features | 1st-party | 2 |
| [Built-in bundle analysis](https://framework-compare.vercel.app/features/bundle-analysis.md) | Other features | Third-party | 1 |
| [Third-party script strategies](https://framework-compare.vercel.app/features/third-party-scripts.md) | Other features | Manual | 0 |
| [Portable multi-host deployment](https://framework-compare.vercel.app/features/multi-host-deployment.md) | Other features | Third-party | 1 |
| [Service worker / offline support](https://framework-compare.vercel.app/features/service-worker.md) | Other features | Manual | 0 |

## First-paint levers

### Production CSS inlining

Label: **Experimental** (1 of 2 points).

[`server.build.inlineCss`](https://tanstack.com/start/latest/docs/framework/react/guide/css-styling) (experimental) inlines manifest CSS. This port does not use it; it imports the CSS with `?inline` and passes it through `head()`.

```tsx
import appCss from '../styles.css?inline'
// ...
export const Route = createRootRoute({
  head: () => ({
    styles: [{ children: appCss }],
  }),
})
```

*From this repo's `tanstack-books/src/routes/__root.tsx` (`optimized` branch).*

### Font optimization

Label: **Third-party** (1 of 2 points).

Import [`@fontsource`](https://fontsource.org) in your global CSS; there is no preload, so the font is discovered from the inlined CSS. No first-party font module is documented; the [production checklist](https://tanstack.com/start/latest/docs/framework/react/guide/production-checklist) only says to check font loading.

```css
@import '@fontsource-variable/geist';
```

*From this repo's `tanstack-books/src/styles/global.css` (`optimized` branch).*

### Image pipeline

Label: **Third-party** (1 of 2 points).

Use [Unpic](https://unpic.pics) (`@unpic/react`) URL transforms plus IPX/Nitro or the host CDN, chosen in `vite.config.ts`. No first-party image pipeline is documented ([production checklist](https://tanstack.com/start/latest/docs/framework/react/guide/production-checklist) only says to check large images and dimensions).

```tsx
import { Image as UnpicImage } from '@unpic/react'
// ...
<UnpicImage {...props} cdn={imageCdn} options={options} />
```

*From this repo's `tanstack-books/src/components/ui/image.tsx` (`optimized` branch; options handling simplified).*

Art direction with `<picture>` (Manual, not scored):

Nothing to enable: no first-party `<picture>` component is documented ([production checklist](https://tanstack.com/start/latest/docs/framework/react/guide/production-checklist)). Third-party `@unpic/react` exports a [`<Source>`](https://unpic.pics/img/react/) component (`media`, `type`) for use inside a hand-written `<picture>`; this port does not use it, and because the `<picture>` is still hand-written the cell stays 🔧, as for Next's `getImageProps()`.

Wrap the port's Unpic `<Image>` in a hand-written `<picture>`, and add `<Source>` from `@unpic/react` for each art-directed variant. Pass `<Source>` the same CDN settings the port's `Image` wrapper uses.

```tsx
// src/features/book/components/book-cover.tsx
import { Source } from '@unpic/react'
import { Image } from '@/components/ui/image'
import { imageCdn } from '@/lib/image-config'
// …
const small = src ?? EMPTY_IMAGE_URL
const size = { layout: 'constrained', width: COVER_IMAGE_WIDTH, height: COVER_IMAGE_HEIGHT } as const

return (
  <picture>
    <Source
      {...size}
      media="(min-width: 768px)"
      src={getLargeBookImageUrl(small)}
      cdn={imageCdn}
      options={imageCdn === 'ipx' ? { ipx: { baseURL: '/_ipx' } } : undefined}
    />
    <Image {...size} alt={title} src={small} sizes={sizes} priority={priority}
           className="absolute inset-0 size-full object-cover" objectFit="cover" unstyled />
  </picture>
)
```

### Data/HTML caching

Label: **1st-party** (2 of 2 points).

Use [static prerendering](https://tanstack.com/start/latest/docs/framework/react/guide/static-prerendering) plus per-route `Cache-Control` / `stale-while-revalidate` headers, which the [ISR guide](https://tanstack.com/start/latest/docs/framework/react/guide/isr) describes; the CDN does the revalidating, so there is no framework data cache.

```ts
export const Route = createFileRoute('/posts/$id')({
  headers: () => ({
    'Cache-Control': 'public, s-maxage=3600, stale-while-revalidate=86400',
  }),
})
```

*From [the ISR guide](https://tanstack.com/start/latest/docs/framework/react/guide/isr) (its Vercel example; the guide's generic example also sets `max-age=3600`).* This port uses `src/lib/catalog-cache.ts` plus a request middleware that sets document `Cache-Control` headers in `src/start.ts`:

```ts
const result = await next()
const headers = new Headers(result.response.headers)
headers.set('Cache-Control', hostDocumentCacheControl())
```

*From this repo's `tanstack-books/src/start.ts` (`optimized` branch; abridged).*

Gotchas:

- TanStack's ISR is a headers pattern, not a framework cache: `s-maxage` plus `stale-while-revalidate` only helps if your CDN honors them.

### Route prefetching

Label: **1st-party** (2 of 2 points).

Router [preloading](https://tanstack.com/router/latest/docs/framework/react/guide/preloading) is off by default; `defaultPreload: 'intent' | 'viewport' | 'render'` turns it on. This port sets `'intent'` and wraps links with `FastLink`.

```ts
const router = createTanStackRouter({
  routeTree,
  defaultPreload: 'intent',
})
```

*From this repo's `tanstack-books/src/router.tsx` (`optimized` branch; other options omitted).*

Gotchas:

- Preloading is off until you set `defaultPreload`.
- `defaultPreloadStaleTime: 0` makes data loaded on hover stale at once, so the click loads it again. Use 0 only when an outside cache such as TanStack Query handles reuse.

### Streaming SSR

Label: **1st-party** (2 of 2 points).

The default server entry uses `defaultStreamHandler` ([server entry point](https://tanstack.com/start/latest/docs/framework/react/guide/server-entry-point)), so [streaming SSR](https://tanstack.com/router/latest/docs/framework/react/guide/ssr) is on without a flag. Return a promise from a loader without awaiting it and render it with [`<Await>`](https://tanstack.com/router/latest/docs/framework/react/guide/deferred-data-loading).

```tsx
export const Route = createFileRoute('/posts/$postId')({
  loader: async () => {
    const slowDataPromise = fetchSlowData()
    const fastData = await fetchFastData()
    return { fastData, deferredSlowData: slowDataPromise }
  },
})
// ...
<Await promise={deferredSlowData} fallback={<div>Loading...</div>}>
  {(data) => <div>{data}</div>}
</Await>
```

*Adapted from [the TanStack Router deferred data loading guide](https://tanstack.com/router/latest/docs/framework/react/guide/deferred-data-loading) (comments omitted).*

### Early Hints / preload headers

Label: **Experimental** (1 of 2 points).

[Early Hints](https://tanstack.com/start/latest/docs/framework/react/guide/early-hints) are marked experimental. Start collects route assets and route `head().links` and calls `onEarlyHints` in your server entry; your code sends the 103 with the runtime's own API, because "Start does not send Early Hints automatically". `responseLinkHeader` puts the same links in a `Link` header for a CDN to convert.

```tsx
// src/server.ts
import handler, { createServerEntry } from '@tanstack/react-start/server-entry'

export default createServerEntry({
  fetch(request) {
    return handler.fetch(request, {
      onEarlyHints: ({ phase, links }) => {
        if (phase !== 'static' || !links.length) return

        // Send `links` with your runtime-specific 103 API.
      },
    })
  },
})
```

*From [the TanStack Start Early Hints guide](https://tanstack.com/start/latest/docs/framework/react/guide/early-hints).*

## Other features

### Islands / partial hydration / lazy slices

Label: **Experimental** (1 of 2 points).

[`<Hydrate when={visible()}>`](https://tanstack.com/start/latest/docs/framework/react/guide/deferred-hydration) keeps the server HTML, splits the child into its own chunk, and defers hydration (`load`, `idle`, `visible`, `media`, `interaction`, `condition`, `never`).

```tsx
import { Hydrate } from '@tanstack/react-start'
import { visible } from '@tanstack/react-start/hydration'

<Hydrate when={visible()}>
  <Reviews />
</Hydrate>
```

*From [the deferred hydration guide](https://tanstack.com/start/latest/docs/framework/react/guide/deferred-hydration).* `<ClientOnly>` is different: it skips SSR rather than deferring hydration. Experimental [Server Components](https://tanstack.com/start/latest/docs/framework/react/guide/server-components) are also available via `rsc: { enabled: true }` and `@vitejs/plugin-rsc`. This port uses neither.

Gotchas:

- `<Hydrate>` is a newer API: check the linked guide for current behavior.

### Per-route render modes

Label: **1st-party** (2 of 2 points).

Per-route [`ssr: true | false | 'data-only'`](https://tanstack.com/start/latest/docs/framework/react/guide/selective-ssr) with a `defaultSsr`, plus a global [SPA mode](https://tanstack.com/start/latest/docs/framework/react/guide/spa-mode). Prerendering is configured in the plugin, and ISR is a headers pattern rather than a render mode.

```tsx
export const startInstance = createStart(() => ({
  defaultSsr: false,
}))
```

```tsx
export const Route = createFileRoute('/posts/$postId')({
  ssr: false,
  component: () => <div>This component is rendered on the client</div>,
})
```

*From [the selective SSR guide](https://tanstack.com/start/latest/docs/framework/react/guide/selective-ssr). The guide says `'data-only'` keeps `beforeLoad` and `loader` on the server while skipping server rendering of the component.*

Gotchas:

- `ssr: false` still runs on the client only; `'data-only'` is the middle option.

### Fine-grained client reactivity

Label: **1st-party** (2 of 2 points).

React; the first-party [React Compiler](https://react.dev/learn/react-compiler) is added as a Babel preset to the React Vite plugin. It is not enabled in this port (`vite.config.ts` calls `viteReact()` with no compiler preset).

Example of building it yourself:

Add the React Compiler preset through `@rolldown/plugin-babel` next to `viteReact()`. The compiler memoizes components and hooks at build time, so fewer components re-render when state changes.

```ts
// vite.config.ts
import { defineConfig } from 'vite'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import viteReact, { reactCompilerPreset } from '@vitejs/plugin-react'
import babel from '@rolldown/plugin-babel'

export default defineConfig({
  plugins: [
    tanstackStart(),
    viteReact(),
    babel({ presets: [reactCompilerPreset()] }),
  ],
})
```

Source: [React: React Compiler installation](https://react.dev/learn/react-compiler/installation)

Gotchas:

- The React Compiler is opt-in: add its Babel preset to the React Vite plugin.

### Built-in bundle analysis

Label: **Third-party** (1 of 2 points).

No first-party analyzer is documented ([production checklist](https://tanstack.com/start/latest/docs/framework/react/guide/production-checklist)); use [rollup-plugin-visualizer](https://github.com/btd/rollup-plugin-visualizer), not configured.

Example of building it yourself:

Add `rollup-plugin-visualizer` to the plugin list. `vite build` then writes a treemap of the bundle to `stats.html`.

```ts
// vite.config.ts
import { defineConfig } from 'vite'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import viteReact from '@vitejs/plugin-react'
import { visualizer } from 'rollup-plugin-visualizer'

export default defineConfig({
  plugins: [
    tanstackStart(),
    viteReact(),
    visualizer({ filename: 'stats.html', gzipSize: true }),
  ],
})
```

Source: [rollup-plugin-visualizer: README](https://github.com/btd/rollup-plugin-visualizer)

### Third-party script strategies

Label: **Manual** (0 of 2 points).

Route `head().scripts`, `<Scripts/>`, and `ScriptOnce` emit or run tags but have no loading-strategy API ([production checklist](https://tanstack.com/start/latest/docs/framework/react/guide/production-checklist) only says to review third-party scripts). You wire the tag by hand:

```tsx
head: () => ({
  scripts: [{ children: themeScript }],
}),
```

*From this repo's `tanstack-books/src/routes/__root.tsx` (`optimized` branch; here an inline theme script, but the same field emits any script tag).*

### Portable multi-host deployment

Label: **Third-party** (1 of 2 points).

Nitro presets (a separate project, `nitrojs/nitro`) plus the host-maintained Cloudflare (`@cloudflare/vite-plugin`) and Netlify (`@netlify/vite-plugin-tanstack-start`) Vite plugins, which the TanStack [hosting](https://tanstack.com/start/latest/docs/framework/react/guide/hosting) guide documents as its official setups; none of the three is published by TanStack. This port implements all three branches; it scores 🧪 by the same rule as React Router and Next.

```ts
if (isCloudflare) {
  const { cloudflare } = await import('@cloudflare/vite-plugin')
  plugins.push(cloudflare({ viteEnvironment: { name: 'ssr' } }))
} else if (isNetlify) {
  const netlify = (await import('@netlify/vite-plugin-tanstack-start')).default
  plugins.push(netlify())
} else {
  plugins.push(nitro())
}
```

*From this repo's `tanstack-books/vite.config.ts` (`optimized` branch; Nitro `rollupConfig` option omitted).*

Gotchas:

- The Cloudflare and Netlify Vite plugins are maintained by the hosts.

### Service worker / offline support

Label: **Manual** (0 of 2 points).

No service worker or offline guide exists in the [TanStack Start docs](https://tanstack.com/start/latest/docs/framework/react/overview). Hand-write the worker and register it from the root route.

Example of building it yourself:

Put a hand-written worker in `public/` and register it with an inline script from the root route's `head`.

```js
// public/sw.js
const CACHE = 'books-v1'; // change the name on each deploy

self.addEventListener('activate', (event) => {
  event.waitUntil(
    caches.keys().then((keys) => Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k)))),
  );
});

self.addEventListener('fetch', (event) => {
  const { request } = event;
  if (request.method !== 'GET' || new URL(request.url).origin !== location.origin) return;
  // Network first, so pages stay current. The cached copy answers when offline.
  event.respondWith(
    fetch(request)
      .then((response) => {
        const copy = response.clone();
        caches.open(CACHE).then((cache) => cache.put(request, copy));
        return response;
      })
      .catch(() => caches.match(request)),
  );
});
```

```tsx
// src/routes/__root.tsx
const swScript = `if('serviceWorker' in navigator)addEventListener('load',function(){navigator.serviceWorker.register('/sw.js')});`;
// …
    scripts: [{ children: themeScript }, { children: swScript }],
```

Source: [Using Service Workers (MDN)](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers) · [TanStack Start document head](https://tanstack.com/router/latest/docs/framework/react/guide/document-head-management)

## Other performance features

experimental [`transformAssets`](https://tanstack.com/start/latest/docs/framework/react/guide/cdn-asset-urls) for CDN asset URLs.

## Deployments of the Books demo

| Branch | Note | Vercel | Netlify | Cloudflare |
| --- | --- | --- | --- | --- |
| `main` | vibe port | https://tanstack-books.vercel.app | https://tanstack-books.netlify.app | https://tanstack-books.to-email-max.workers.dev |
| `optimized` | cache + fonts | https://tanstack-books-optimized.vercel.app | https://tanstack-books-max-optimized.netlify.app | https://tanstack-books-optimized.to-email-max.workers.dev |

## Benchmark, 2026-11-28

Tool: PageSpeed Insights v5 (Lighthouse lab run), mobile strategy. 3 measured runs per deployment, median reported; cold runs are left out of the median when a warm run exists. Each build's figure is the average of its hosts' medians (vercel, netlify, cloudflare). Pages measured: book list (/) and one book (/10145787). Times are lab values from one run on 2026-11-28. FCP is the Lighthouse estimate for simulated Slow 4G; Raw FCP, where shown, is the first paint in the real, unthrottled load that estimate is built from. Builds in the same FCP band (https://framework-compare.vercel.app/measured.md) are a tie, so read "fastest first" as band order.

| Page | Build | Branch | Hosts | Performance | FCP | Raw FCP | LCP | TBT | CLS |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| book list (/) | baseline | `main` | cloudflare, netlify, vercel | 82 | 1.52 s | 1.00 s | 4.66 s | 4 ms | 0.000 |
| book list (/) | optimized | `optimized` | cloudflare, netlify, vercel | 94 | 0.93 s | 0.26 s | 2.75 s | 6 ms | 0.001 |
| one book (/10145787) | baseline | `main` | cloudflare, netlify, vercel | 94 | 1.51 s | 1.02 s | 2.89 s | 2 ms | 0.000 |
| one book (/10145787) | optimized | `optimized` | cloudflare, netlify, vercel | 99 | 0.93 s | 0.26 s | 1.86 s | 0 ms | 0.001 |

Full run: https://framework-compare.vercel.app/benchmark.md

---

HTML version: https://framework-compare.vercel.app/frameworks/tanstack-start-react · All pages: https://framework-compare.vercel.app/llms.txt · Data: https://framework-compare.vercel.app/api/index.json
