v0.4.0
hono-preact v0.4.0: release notes
Released: 2026-05-29
v0.4.0 is the View Transitions release. v0.3.0 shipped the same-document slice
(useOptimistic({ transition: true })); this release adds the cross-route
toolkit, so navigating between pages can animate shared elements, run lifecycle
hooks, react to navigation direction, and keep elements alive across the swap.
Everything here is additive and opt-in. There are no breaking changes.
Highlights
Named elements (toolkit A)
useViewTransitionName opts an element into a named view transition so the
browser can match it across a DOM swap (a thumbnail growing into a hero image, a
list row morphing into a detail panel). startViewTransition wraps an arbitrary
DOM update in document.startViewTransition() with a graceful fallback when the
browser lacks support.
Transition lifecycle (toolkit B)
configureViewTransitions registers a global config that observes and customizes
each transition: prepare the DOM before the snapshot, react once the transition
is running, and skip transitions you don't want. Typed via ViewTransitionConfig
and ViewTransitionPhase.
Transition types and direction (toolkit C)
Navigation direction (forward, back, replace) is published as CSS transition
types on the document and exposed to components through
useViewTransitionDirection() (ViewTransitionDirection), so UI can render
direction-aware animations.
Persist across routes (toolkit D)
<Persist> keeps an element mounted across navigations (for example a media
player that keeps playing), coordinating with the view-transition snapshot so the
persisted element doesn't flicker.
Backpressure-aware multi-loader streaming
The server HTML stream for multi-loader routes now respects backpressure, so a
slow client can't make a fast multi-loader response buffer unboundedly in memory.
Breaking changes
None. v0.4.0 is a drop-in upgrade from v0.3.0.
Upgrading
npm install hono-preact@0.4.0Scaffold a new app with the matching CLI:
npm create hono-preact@0.4.0The View Transitions toolkit is opt-in: import the helpers you want from
hono-preact. Existing apps need no changes.