Skip to content

Releases: honojs/middleware

@hono/typia-validator@0.1.3

13 Jun 11:54
4767bd0

Choose a tag to compare

Patch Changes

@hono/inertia@0.6.0

13 Jun 02:57
c309ae5

Choose a tag to compare

Minor Changes

  • #1934 35682a73136e7483bfd22e14659e9a307155f296 Thanks @ashunar0! - feat(inertia): add infinite scroll with scroll()

    Adds a scroll() helper that wraps a paginated page payload with the metadata
    the Inertia client's <InfiniteScroll> adapter needs to keep loading more items
    as the user scrolls:

    users: scroll({
      data: await db.users.page(currentPage),
      currentPage,
      lastPage: 10,
      pageName: 'users_page',
      matchOn: 'id',
    })

    The value travels as-is; the renderer emits page.scrollProps[key] = { previousPage, nextPage, currentPage, pageName } on every response and opts the
    prop into the merge protocol — defaulting to append, switched to prepend
    when the client sends X-Inertia-Infinite-Scroll-Merge-Intent: prepend. The
    optional matchOn is forwarded as page.matchPropsOn for client-side dedupe.
    Mirrors Inertia::scroll(...) in inertia-laravel 3.x.

@hono/inertia@0.5.0

06 Jun 01:45
67bd126

Choose a tag to compare

Minor Changes

  • #1932 5318463bd4be3b6c7abb6f5c46a61bd1d5b36ca6 Thanks @ashunar0! - feat(inertia): add merge props with merge(), prepend(), and deepMerge()

    Adds three helpers that mark a prop for client-side combination on the
    next partial reload, instead of the default replace behavior:

    • merge(data, { matchOn? }) — appends array items / shallow-spreads object keys.
    • prepend(data, { matchOn? }) — same as merge() but inserts at the start.
    • deepMerge(data, { matchOn? }) — recurses into nested arrays/objects (use for
      wrapper-shaped paginated props like { data: [...], meta: {...} }).

    The value travels as-is; the renderer advertises which keys to combine via the
    new page.mergeProps / page.prependProps / page.deepMergeProps arrays and
    emits dot-paths on page.matchPropsOn for the client's dedupe logic.

    import { deepMerge, inertia, merge, prepend } from '@hono/inertia'
    
    app.use(inertia())
    
    app.get('/feed', (c) =>
      c.render('Feed', {
        posts: merge(await db.posts.page(n), { matchOn: 'id' }),
        notifications: prepend(await fetchNotifications(), { matchOn: 'id' }),
        conversations: deepMerge(
          { data: await db.messages.page(n), meta: { nextCursor } },
          { matchOn: 'data.id' }
        ),
      })
    )

    The merge metadata is emitted on every response (initial + partial) so the
    client knows which keys to combine on the next partial reload. Full page visits
    always replace props entirely.

@hono/session@0.2.1

05 Jun 06:35
3693128

Choose a tag to compare

Patch Changes

@hono/ua-blocker@0.1.31

04 Jun 10:24
9ab38f7

Choose a tag to compare

Patch Changes

@hono/inertia@0.4.0

02 Jun 23:39
7981d31

Choose a tag to compare

Minor Changes

  • #1911 c5758a6e4b3ca44c8c03a06effc2e6c7134e4d25 Thanks @{! - feat(inertia): add deferred props with defer()

    Adds a defer(resolver, group?) helper that defers a prop until after the
    initial render. On the initial response the resolver is skipped and the
    prop key is advertised via page.deferredProps[group]; the Inertia client
    then issues one partial reload per group, at which point the resolver runs
    and the value is sent down.

    import { defer, inertia } from '@hono/inertia'
    
    app.use(inertia())
    
    app.get('/', (c) =>
      c.render('Dashboard', {
     id: 1 },                       // sent on initial response
        posts: defer(() => fetchPosts()),      // fetched after mount
        stats: defer(() => fetchStats(), 'secondary'),
      }),
    )

    Multiple deferred props that share a group are fetched together. The
    default group is "default".

@hono/oidc-auth@1.8.3

01 Jun 11:38
b504a34

Choose a tag to compare

Patch Changes

@hono/inertia@0.3.0

28 May 12:00
1e8892a

Choose a tag to compare

Minor Changes

  • #1904 a1334f21e77cea7db953825d35f58c271aa7b9fb Thanks @ashunar0! - add server-side support for Inertia.js partial reloads. Honors the X-Inertia-Partial-Component, X-Inertia-Partial-Data (only), and X-Inertia-Partial-Except headers, and accepts function-valued props (() => T | Promise<T>) that are evaluated lazily — function props excluded from a partial reload are never invoked, so heavy data fetching can be skipped.

@hono/ua-blocker@0.1.30

22 May 04:45
8f084ad

Choose a tag to compare

Patch Changes

@hono/mcp@0.3.0

16 May 09:31
f0da2ae

Choose a tag to compare

Minor Changes

  • #1774 9575cbc4b8b32bb1605a465a414a9728f1a6ef9b Thanks @bookernath! - relax Accept header validation to accept application/json, text/event-stream, or */* individually, improving compatibility with Gemini CLI, Java MCP SDK, Open WebUI, and curl. Add strictAcceptHeader option for strict MCP spec compliance.