Skip to content

v0.1.0

Choose a tag to compare

@sbesh91 sbesh91 released this 17 May 02:43
· 210 commits to main since this release

hono-preact v0.1.0

A small full-stack framework. Hono on the edge, Preact in the browser, manifest driven routes, typed RPC, streaming everywhere.

What's in v0.1

  • Manifest-driven routes. `defineRoutes([...])` is the manifest; the Vite plugin reads it at build time and emits the loader/action wire. No filesystem routing.
  • Method-style loader and action refs. `loader.useData()`, `loader.invalidate()`, `action.useAction()` instead of context registries.
  • Zero-config Vite. `defineApp()` is one line in `vite.config.ts`.
  • Framework-provided client entry. ``, ``, ``, `useRouteChange()`. Your `client.tsx` is gone.
  • Streaming loaders and forms. Async generators all the way through SSR, hydration, and client-side reloads.
  • Multi-loader routes. A page can declare `serverLoaders.X`, `serverLoaders.Y`, etc., each with its own `.View()` boundary, all running in parallel.
  • Stable nested layouts. Layout groups survive intra-group navigation; layout-owned state persists.
  • Single guards list. `defineServerGuard` / `defineClientGuard` on a single `guards: [...]` array. Opposite-env bodies tree-shake out.
  • Typed Hono context on every seam. `ctx.c` is `Context`; no casts when calling Hono helpers like `getSignedCookie`, `verify`, etc.
  • One package, three subpaths. `hono-preact`, `hono-preact/server`, `hono-preact/vite`. Nothing else to install (plus the documented peer deps).

Known limitations

  • `` posts to `/__actions` rely on `SameSite=Lax` cookies for CSRF protection. Explicit-origin CSRF middleware on `/__actions` is not yet user-configurable (#43).
  • No `create-hono-preact` scaffold yet (#47). Quick-start is a four-file copy/paste.
  • Streaming-loader responses currently drop `Set-Cookie` headers silently (#48). Pinned with a test; documented in `/docs/loaders`. Cookie rotation during a streaming loader is a known gap.
  • View transitions wrap link clicks but not browser back/forward navigation yet.

Docs

Full docs: https://framework.sbesh.com/docs · Demo: https://framework.sbesh.com/demo

Install

```bash
pnpm add hono-preact hono preact preact-iso preact-render-to-string hoofd
pnpm add -D vite
```