v0.6.0
hono-preact v0.6.0: release notes
Released: 2026-06-14
v0.6.0 is the largest release since the framework's first cut. It lands the
backlog from the primitives DX review: a client-navigation toolkit, typed route
params, single-source page guards, a form lifecycle, a content-glob route
helper, an LLM-facing documentation layer, and a hardened public/internal
boundary. It carries a handful of breaking changes, all small and mechanical to
migrate.
It also debuts a companion package: hono-preact-ui@0.1.0, a standalone
library of unstyled, accessible Preact UI primitives (Dialog, Popover, Tooltip,
Menu, Context Menu, Select, Combobox). It versions independently and is released
on its own line; see its own notes.
Highlights
Client navigation toolkit
Three additions make in-app navigation a first-class, typed concern:
useNavigate()returns an imperativenavigate(href, options)for navigating
from event handlers and effects, not just<a>clicks.usePrefetch()(and the standaloneprefetch()) warm a route's code and
loader data on intent, for example on link hover or focus, so the destination
is ready before the click.- Active-route detection:
useRouteMatch()anduseRouteActive()report
whether a route is current (with exact/nested options), andNavLinkis a
link that styles itself from that state.
Typed route params
useParams() reads the current route's params, and defineLoader(routeId) /
serverRoute type a loader against the params its route actually declares. The
typing is pure type-level inference keyed off the route tree: no codegen, no
build step, no generated registry to keep in sync.
Single-source page guards
A route node now takes a use array of guards that gates both the route's
render and its loader/action RPC from one place, and inherits down the tree to
child routes. This replaces the previous split where definePage({ use })
guarded render and a separate convention guarded the server calls. One list,
one source of truth, applied uniformly.
Form lifecycle
Progressively-enhanced forms and actions gain onSuccess, onError,
invalidate, and reset hooks, plus shared invalidation so a successful
mutation can refresh the loader data it affected. Custom Select/Combobox inputs
from hono-preact-ui also reset correctly on a native form reset.
Content-glob routes
contentRoutes() turns an import.meta.glob map of content modules (MDX/markdown
pages) into route definitions in one call, so a docs or content site declares its
routes from the filesystem instead of by hand.
LLM-facing documentation and scaffolding
The project now ships machine-readable docs and agent-aware scaffolding:
- Generated
llms.txtandllms-full.txtso coding assistants can load an
accurate, current description of the framework's API. create-hono-preactscaffolds anAGENTS.mdinto new apps, and a new
add-agentsCLI command adds it to an existing app.- Several framework error messages were sharpened to say what went wrong and
what to do about it.
Hardened public/internal boundary
The framework's advanced and framework-emitted plumbing moved behind explicit
/internal/runtime entry points, leaving the main entry points a curated public
surface. Most apps import only the public API and are unaffected; the change
matters only if you reached into internals.
Breaking changes
All of these are mechanical to migrate.
- Page guards moved to the route node. Declare guards as a
usearray on the
route instead ofdefinePage({ use }).Pageno longer acceptsuseor
location. The singleuselist now gates render and loader/action RPC
together, so the separateloaderUse/actionUseconvention is gone. useRouteChangeremoved. Run post-navigation work from
useViewTransitionLifecycle({ onAfterSwap })instead (theRouteChangeHandler
type was removed with it).getViewTransitionDirectionremoved. Navigation direction is now delivered
to the view-transition types callback:subscribeViewTransitionTypesand
useViewTransitionTypesreceive{ to, from, direction }, wheredirection
is the still-exportedNavDirection.- A few advanced exports moved behind
/internal/runtime. The mutableenv
binding and framework-emitted server plumbing (the loaders handler, resolver
factories) are no longer on the main entry points. If you imported them
directly, pull them fromhono-preact/internal/runtime(or
hono-preact/server/internal/runtime). Typical apps never imported these.
Upgrading
npm install hono-preact@0.6.0Scaffold a new app with the matching CLI:
npm create hono-preact@0.6.0Then apply the breaking-change migrations above. If you don't use page guards,
useRouteChange, or framework internals, v0.6.0 is a drop-in upgrade.
The UI component library is released separately:
npm install hono-preact-ui@0.1.0