Skip to content

Protocol support ​

The adapter implements the Inertia.js v3 protocol, and the lists below say which parts.

Core protocol ​

  • HTML on the first visit and JSON on Inertia visits, both from c.var.inertia.render()
  • Lazy function props that run only when the response includes them
  • Vary: X-Inertia on every response
  • Asset versioning with a 409 and X-Inertia-Location on a version mismatch for GET requests, using the Vite plugin or manifestVersion
  • 302 to 303 conversion after PUT, PATCH, DELETE and QUERY on Inertia requests
  • A redirect back to the Referer when a handler returns an empty 200, and c.var.inertia.back() for doing it yourself
  • Shared props with the share option and per request with c.var.inertia.share()
  • Partial reloads with X-Inertia-Partial-Data and X-Inertia-Partial-Except. Excluded props never run, and errors is always included
  • Validation errors from the session with withErrors(), shared as errors and encoded as {} when empty
  • Error bags with X-Inertia-Error-Bag, following Laravel's rules
  • Flash data kept across redirects and version mismatches with the session option
  • Prop reset with X-Inertia-Reset
  • Fragment redirects. A redirect to a URL with # becomes a 409 with X-Inertia-Redirect, and preserveFragment() keeps the request's fragment
  • Custom status codes with c.status() before rendering
  • XSS-safe page embedding with serializePage

Optional features ​

  • Always props with always
  • Optional props with optional
  • Deferred props with deferred, including groups
  • Rescued deferred props with deferred(fn).rescue(), which reports errors to onRescue
  • Merge props with merge, prepend and deepMerge
  • Match keys and merge paths for merged props with matchOn(), append(path) and prepend(path)
  • Infinite scroll with scroll and X-Inertia-Infinite-Scroll-Merge-Intent
  • Once props with once, including keys, expiry and X-Inertia-Except-Once-Props
  • Combined prop types, such as deferred(fn).merge().once()
  • Nested props: prop types and lazy functions inside objects, and dot paths in partial reloads
  • Live props with live() or .live(), broadcastProperties() and socketId() (client 3.11+)
  • Precognition with inertiaValidator(), which takes any Standard Schema such as Zod, Valibot or ArkType
  • External redirects with c.var.inertia.location()
  • Flash data with c.var.inertia.flash()
  • History encryption with encryptHistory()
  • History clearing with clearHistory(), which also works when the handler redirects
  • Server-side rendering in the same process or through an Inertia SSR server, with a fallback to client rendering reported to onSsrError
  • BigInt props with preserveBigIntegers
  • Server-provided head elements with the head prop
  • View data for the root template that stays out of the page object, with viewData()
  • DevTools protocol with the devtools option
  • Cache-Control on adapter responses with the cacheControl option
  • Testing helpers in @brachkow/hono-inertia/testing