# Pracht

Pracht scores 26 of 28 points on 14 speed features: 14/14 on first-paint levers and 12/14 on other features. Rank 1 of 23. Labels: 13 1st-party, 0 Experimental, 0 Third-party, 1 Manual.

- Version checked: @pracht/core 1.0.1 (npm latest), @pracht/image 0.6.1, Vite ^8.3.2 (inlineCss, @pracht/image, ISG, prefetch; Fontsource fonts)
- Performance guide: [Performance — pracht docs](https://pracht.resynapse.dev/docs/performance)
- Issue tracker: https://github.com/JoviDeCroock/pracht/issues
- Books demo port: [pracht-books](https://github.com/MaxwellCohen/pracht-books)

## Summary

| Feature | Group | Label | Points |
| --- | --- | --- | --- |
| [Production CSS inlining](https://framework-compare.vercel.app/features/css-inlining.md) | First-paint levers | 1st-party | 2 |
| [Font optimization](https://framework-compare.vercel.app/features/font-optimization.md) | First-paint levers | 1st-party | 2 |
| [Image pipeline](https://framework-compare.vercel.app/features/image-pipeline.md) | First-paint levers | 1st-party | 2 |
| [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 | 1st-party | 2 |
| [Islands / partial hydration / lazy slices](https://framework-compare.vercel.app/features/islands.md) | Other features | 1st-party | 2 |
| [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 | 1st-party | 2 |
| [Third-party script strategies](https://framework-compare.vercel.app/features/third-party-scripts.md) | Other features | 1st-party | 2 |
| [Portable multi-host deployment](https://framework-compare.vercel.app/features/multi-host-deployment.md) | Other features | 1st-party | 2 |
| [Service worker / offline support](https://framework-compare.vercel.app/features/service-worker.md) | Other features | Manual | 0 |

## First-paint levers

### Production CSS inlining

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

Set [`inlineCss: true`](https://pracht.resynapse.dev/docs/styling) on the `@pracht/vite-plugin` options.

```ts
plugins: [pracht({ adapter, inlineCss: true })],
```

*From this repo's `pracht-books/vite.config.ts` (`optimized` branch; other plugin options omitted).*

### Font optimization

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

[`defineFont()`](https://pracht.resynapse.dev/docs/fonts) from `@pracht/core` generates `@font-face` rules and preload links by default; fallback-metric overrides (`sizeAdjust`, `ascentOverride`, ...) are opt-in with hand-supplied values, and there is no build-time download or subsetting, so it is not equivalent to `next/font`.

```ts
export const interRegular = defineFont({ family: "Inter", src: "/fonts/inter-400.woff2", weight: 400 });
// head: { fonts: [interRegular, interBold] }
```

*Adapted from [the fonts docs](https://pracht.resynapse.dev/docs/fonts).* This port chose `@fontsource-variable/geist` in `src/styles/global.css` instead.

### Image pipeline

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

[`@pracht/image`](https://pracht.resynapse.dev/docs/images) ships loaders inside the package (`vercelLoader`, `netlifyLoader`, `cloudflareLoader`, `defaultLoader`, `passthroughLoader`; `createImageHandler` from `@pracht/image/node`), plus `placeholder="blur"`, `priority`, and build-time `?pracht` imports. `netlifyLoader` was added in `@pracht/image` 0.5.0; this port uses it on Netlify (`@pracht/image` 0.6.1).

```ts
plugins: [prachtImage(), pracht({ adapter, inlineCss: true })],
```

```tsx
import { Image } from '@pracht/image';
// ...
<Image
  alt={title}
  blurDataURL={placeholder}
  fill
  placeholder={placeholder ? 'blur' : 'empty'}
  priority={priority}
  sizes={sizes}
  src={resolved}
/>
```

*From this repo's `pracht-books/vite.config.ts` and `src/features/book/components/book-cover.tsx` (`optimized` branch; some props omitted).*

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

[`@pracht/image`](https://pracht.resynapse.dev/docs/images) emits `srcset`/`sizes`; `getImageProps()` likewise returns plain `img` attributes, with no `<picture>` component. Hand-write the `<picture>` from those attributes, as in the Next snippet above. No Pracht-specific code example was found in the docs.

Call `getImageProps()` from `@pracht/image` once per art-directed source, then write the `<picture>` yourself. The loader configured in the port's `src/lib/images.ts` still builds every `srcset` URL.

```tsx
// src/features/book/components/book-cover.tsx
import { getImageProps } from '@pracht/image';
import { EMPTY_IMAGE_URL, getLargeBookImageUrl } from '@/features/book/book-constants';
import '@/lib/images';
// …
const small = src ?? EMPTY_IMAGE_URL;
const common = { alt: title, fill: true, priority, sizes };
const { srcset: desktop } = getImageProps({ ...common, src: getLargeBookImageUrl(small) });
const mobile = getImageProps({ ...common, src: small });

return (
  <picture>
    <source media="(min-width: 768px)" srcset={desktop} sizes={sizes} />
    <img {...mobile} className="size-full object-cover" onError={() => setFailedSrc(small)} />
  </picture>
);
```

### Data/HTML caching

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

[`ISG`](https://pracht.resynapse.dev/docs/rendering) (`render: "isg"` with `revalidate: timeRevalidate(3600)`, or `webhookRevalidate()`) is a per-route rendering mode. This port uses `isg` on both routes and adds `src/lib/catalog-cache.ts` for host-aware data caching.

```ts
route('/', './routes/home.tsx', {
  id: 'home',
  render: 'isg',
  revalidate: timeRevalidate(3600),
}),
```

*From this repo's `pracht-books/src/routes.ts` (`optimized` branch; `shell` omitted).*

Gotchas:

- A route's own `headers()` Cache-Control overrides the adapter's ISG/CDN headers.

### Route prefetching

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

Use the [`prefetch`](https://pracht.resynapse.dev/docs/prefetching) route option or `<Link>` prop; the default is `intent` (`hover` is an alias), with `viewport`, `none`, and link-only `render` also available.

```tsx
<Link route="book" prefetch={eagerPrefetch ? 'viewport' : 'intent'} />
```

*Adapted from this repo's `pracht-books/src/features/book/components/book-card.tsx` (`optimized` branch; other props omitted).*

### Streaming SSR

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

Set the route option [`streaming: true`](https://pracht.resynapse.dev/docs/data-loading) and wrap slow loader values in `defer()`. It needs `render: "ssr"` and full hydration. Pages-router files use `export const STREAMING = true`.

```ts
route("/product/:id", () => import("./routes/product.tsx"), {
  render: "ssr",
  streaming: true,
});
```

*From [the Pracht data loading docs](https://pracht.resynapse.dev/docs/data-loading) ("Streaming the document").*

### Early Hints / preload headers

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

Nothing to enable for the header: rendered pages, and prerendered SSG/ISG pages on the Node, Cloudflare, Vercel, and Netlify adapters, send a preload `Link` header for their stylesheets ([performance guide, Early hints](https://pracht.resynapse.dev/docs/performance)). On the [Node adapter](https://pracht.resynapse.dev/docs/adapters/node), `earlyHints: true` sends the 103 itself, including the page's scripts, before the loaders run.

```ts
nodeAdapter({ earlyHints: true });
```

*From [the Pracht performance guide](https://pracht.resynapse.dev/docs/performance).*

## Other features

### Islands / partial hydration / lazy slices

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

Set `hydration: "islands"` per route, with interactive components discovered from `src/islands/`; `hydration: "none"` gives a zero-JS page ([islands](https://pracht.resynapse.dev/docs/islands)).

```ts
route("/", "./routes/home.tsx", {
  render: "ssg",
  hydration: "islands",
});
```

*Adapted from [the islands docs](https://pracht.resynapse.dev/docs/islands).* [`server islands`](https://pracht.resynapse.dev/docs/server-islands) render a fragment per request with cookies and middleware context while the surrounding page stays SSG/ISG. This port sets neither, so it uses full hydration.

Gotchas:

- Server islands are a newer API: check the linked guide for current behavior.

### Per-route render modes

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

Set `render: "ssg" | "ssr" | "isg" | "spa"` per route in `src/routes.ts` ([rendering modes](https://pracht.resynapse.dev/docs/rendering)). Both routes in this port use `isg`.

```ts
route('/:id', './routes/book.tsx', {
  id: 'book',
  render: 'isg',
  revalidate: timeRevalidate(3600),
}),
```

*From this repo's `pracht-books/src/routes.ts` (`optimized` branch; `shell` omitted).*

### Fine-grained client reactivity

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

Preact; [signals](https://preactjs.com/guide/v11/signals/) are an opt-in `@preact/signals` package from the Preact team, counted as first-party the way Vue's reactivity is for Nuxt; Pracht's own docs do not mention it. This port does not use them, and no code example was found in the docs.

Example of building it yourself:

Install `@preact/signals`. Passing the signal itself into JSX (`{count}`, not `{count.value}`) binds it straight to the text node, so the component does not re-render when it changes.

```tsx
// src/components/counter.tsx
import { signal } from '@preact/signals'

const count = signal(0)

export function Counter() {
  return (
    <div>
      <p>Count: {count}</p>
      <button onClick={() => count.value++}>click me</button>
    </div>
  )
}
```

Source: [Preact: Signals](https://preactjs.com/guide/v11/signals/)

### Built-in bundle analysis

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

[`pracht build --analyze`](https://pracht.resynapse.dev/docs/performance) prints per-route gzip and raw sizes; `--json` for scripts. Per-route `budgets` can fail the build (`--no-budget-fail` to opt out; [CLI](https://pracht.resynapse.dev/docs/cli)).

```bash
pracht build --analyze
```

*From [the performance guide](https://pracht.resynapse.dev/docs/performance).*

### Third-party script strategies

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

Use [`<Script>`](https://pracht.resynapse.dev/docs/head) from `@pracht/core` with `strategy="beforeHydration" | "afterHydration" (default) | "idle" | "visible"`. On `hydration: "none"` routes only `beforeHydration` runs. This port does not use it; its only script is an inline theme script in the shell's `head()`.

```tsx
import { Script } from "@pracht/core";
// ...
<Script strategy="idle" src="https://example.com/chat-widget.js" />
```

*Adapted from [the head and headers docs](https://pracht.resynapse.dev/docs/head).*

### Portable multi-host deployment

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

Use [`adapters`](https://pracht.resynapse.dev/docs/adapters) for Node, Vercel, Netlify, and Cloudflare.

```ts
const adapter = isCloudflare
  ? cloudflareAdapter()
  : process.env.NETLIFY
    ? netlifyAdapter()
    : vercelAdapter();
// ...
pracht({ adapter, inlineCss: true })
```

*From this repo's `pracht-books/vite.config.ts` (`optimized` branch; other plugins omitted).*

### Service worker / offline support

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

No service worker support is documented in the [Pracht docs](https://pracht.resynapse.dev/docs/performance). Hand-write the worker, serve it from `public/`, and register it from the shell.

Example of building it yourself:

Put a hand-written worker in `public/` and register it with an inline script from the shell'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/shells/public.tsx
const swScript = `if('serviceWorker' in navigator)addEventListener('load',function(){navigator.serviceWorker.register('/sw.js')});`;
// … in the shell's head()
    script: [{ children: themeScript }, { children: swScript }],
```

Source: [Using Service Workers (MDN)](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers) · [Pracht shells](https://pracht.resynapse.dev/docs/shells)

## Other performance features

see the [performance guide](https://pracht.resynapse.dev/docs/performance).

## Deployments of the Books demo

| Branch | Note | Vercel | Netlify | Cloudflare |
| --- | --- | --- | --- | --- |
| `main` | vibe port | https://pracht-books.vercel.app | https://pracht-books.netlify.app | https://pracht-books.to-email-max.workers.dev |
| `optimized` | cache + fonts | https://pracht-books-optimized.vercel.app | https://pracht-books-max-optimized.netlify.app | https://pracht-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 | 86 | 1.51 s | 0.40 s | 4.16 s | 0 ms | 0.000 |
| book list (/) | optimized | `optimized` | cloudflare, netlify, vercel | 93 | 0.98 s | 0.93 s | 3.08 s | 1 ms | 0.000 |
| one book (/10145787) | baseline | `main` | cloudflare, netlify, vercel | 97 | 1.51 s | 0.24 s | 2.56 s | 3 ms | 0.001 |
| one book (/10145787) | optimized | `optimized` | cloudflare, netlify, vercel | 100 | 0.82 s | 0.24 s | 1.41 s | 4 ms | 0.001 |

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

---

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