Skip to content

v0.5.0

Choose a tag to compare

@sbesh91 sbesh91 released this 01 Jun 01:52
· 131 commits to main since this release

hono-preact v0.5.0: release notes

Released: 2026-05-31

v0.4.0 shipped the View Transitions toolkit: the APIs to name elements, run
lifecycle hooks, react to navigation direction, and persist elements across a
swap. v0.5.0 is the release where those transitions actually animate. The
framework now captures the outgoing route as the old snapshot at the right
moment, so directional slides and shared-element morphs play on every kind of
navigation, on stock preact-iso with no fork. Everything here is additive and
opt-in. There are no breaking changes.

Highlights

View transitions animate on every navigation

The v0.4.0 integration started each transition from onRouteChange, which
preact-iso fires after the new route has already swapped into the DOM, so
the browser captured the new page as both snapshots and nothing animated.
v0.5.0 drives transitions from a render scheduler (options.debounceRendering,
the seam Preact uses to schedule a flush) installed once from the client entry.
When a flush is the result of a navigation, it is wrapped in
document.startViewTransition so the current route is captured before the swap.
This covers link clicks, programmatic route(), and back/forward uniformly,
with no per-navigation wiring and no event interception.

The work runs on stock github:preactjs/preact-iso#v3; an interim fork hook was
explored and then dropped.

Shared-element morphs across cold navigations

A navigation into a route that suspends (its loader or lazy view is still
loading) now animates element morphs, not just slides. A list-row title that
shares a view-transition-name with the destination header morphs into it even
on a first visit. The coordinator holds the outgoing snapshot until the route's
shell commits, with a short bounded grace window for a morph partner that loads
with the route's data, and a timeout backstop so a stalled or superseded
navigation can never freeze the page.

Public subscribeViewTransitionTypes API

subscribeViewTransitionTypes(fn) is a new non-hook framework export for
registering route-aware view-transition types globally, from outside the
component tree (for example a side-effect module that wants every navigation
touching a section to use a particular treatment). useViewTransitionTypes now
delegates to it. This replaces the previous __subscribePhase internal escape
hatch for that use case.

Demo and docs transitions

The demo app gains directional slides, card-to-detail morphs, and a reverse
slide for in-app up-navigation. The documentation site gets a calmer treatment:
docs pages cross-fade and zoom slightly with no horizontal motion, and the docs
sidebar is lifted out of the transition so it neither fades nor zooms with the
content.

Client-redirect double-mount fix

A client middleware that redirected during initial-page hydration previously
left both the original route and the redirect target stacked in the DOM. The
root cause is expected Preact Suspense + hydration behavior, so the fix lives on
the consumer side: PageMiddlewareHost renders the server children during
hydration and applies the client middleware outcome (redirect, render, or deny)
in a post-hydration effect, keeping SPA semantics with no full reload.

Breaking changes

None. v0.5.0 is a drop-in upgrade from v0.4.0.

Upgrading

npm install hono-preact@0.5.0

Scaffold a new app with the matching CLI:

npm create hono-preact@0.5.0

View transitions are opt-in: import the helpers you want from hono-preact and
the scheduler is installed by the generated client entry. Existing apps need no
changes.