Skip to content

Inertia v3, QuickJS SSR & HTMX

Server-driven UI primitives in vertebra.framework.inertia, vertebra.framework.ssr, and vertebra.framework.htmx for Inertia v3 responses, pooled QuickJS or sidecar SSR, and HTMX helpers. See Frontend, Inertia & SSR for usage examples.

Subsystem Purpose
Inertia v3 Core Negotiate X-Inertia JSON versus initial HTML responses, handle 409 Conflict asset version changes, and support partial reloads.
Inertia v3 Props Control deferred props, shallow and deep client merges, infinite scroll pagination, and lazy evaluation.
QuickJS SSR Pre-render initial HTML inside the embedded QuickJS pool or an external Node or Bun sidecar.
HTMX Helpers Read HX-* request headers and emit trigger, retarget, push-URL, and out-of-band swap responses.

Inertia v3 Configuration & Responses

InertiaConfig

Bases: Struct

Configuration for the Inertia.js v3 middleware.

Attributes:

Name Type Description
enabledbool
Default: False
root_templatestr
Default: 'index.html'
versionstr | None
Default: None
ssrSSRConfig | None
Default: None
shared_datadict[str, Any]
static_propsdict[str, Any]
manifest_pathstr
Default: 'dist/.vite/manifest.json'
asset_manifestAssetManifest | None
Default: None
entrystr
Default: 'index.html'
asset_urlstr
Default: '/static/'
early_hintsbool
Default: True
csp_nonce_headerstr
Default: 'X-CSP-Nonce'
ssr_enabledbool

Return True when SSR configuration is present.

InertiaResponse

Bases: Struct

Value returned by an Inertia page handler.

Attributes:

Name Type Description
componentstr
propsdict[str, Any]
encrypt_historybool
Default: False
clear_historybool
Default: False

SyncInertiaMiddleware

Bases: _BaseInertiaMiddleware

Synchronous Inertia.js v3 protocol handler for Vertebra native handlers.

AsyncInertiaMiddleware

Bases: _BaseInertiaMiddleware

Asynchronous Inertia.js v3 protocol handler for Vertebra native handlers.

process

process(request, response)

Process an Inertia response into a full HTTP response asynchronously.

Inertia v3 Prop Descriptors

DeferredProp

Bases: Struct

A prop whose value is deferred until a subsequent partial reload.

Attributes:

Name Type Description
resolverCallable[[], Any]
groupstr
Default: 'default'
oncebool
Default: False
expires_inint | None
Default: None

MergeProp

Bases: Struct

A prop whose value is merged during partial reloads.

Attributes:

Name Type Description
resolverCallable[[], Any]
prependbool
Default: False

DeepMergeProp

Bases: Struct

A prop whose value is deep-merged during partial reloads.

Attributes:

Name Type Description
resolverCallable[[], Any]

OnceProp

Bases: Struct

A prop resolved only once; subsequent requests skip it if cached.

Attributes:

Name Type Description
resolverCallable[[], Any]
expires_inint | None
Default: None

ScrollProp

Bases: Struct

A prop carrying infinite-scroll pagination metadata.

Attributes:

Name Type Description
resolverCallable[[], Any]
page_namestr
Default: 'page'
current_pageint
Default: 1
next_pageint | None
Default: None
previous_pageint | None
Default: None

OptionalProp

Bases: Struct

A prop resolved only during partial reloads that explicitly request it.

Attributes:

Name Type Description
resolverCallable[[], Any]

QuickJS Server-Side Rendering

SSRConfig

Bases: Struct

Configuration for SSR execution backends and static site prerendering.

Attributes:

Name Type Description
modeLiteral['native', 'sidecar']
Default: 'native'
entrystr
Default: ''
bundle_pathstr | None
Default: None
sidecar_urlstr
Default: 'http://127.0.0.1:13714/render'
sidecar_portint
Default: 13714
pool_sizeint
Default: 4
timeout_msint
Default: 1000
timeoutfloat
Default: 2.0
prerender_routestuple[str, ...]
Default: ()
fallback_to_csrbool
Default: True

SSRResult

Bases: Struct

Result of an SSR render operation.

Attributes:

Name Type Description
htmlstr
Default: ''
headlist[str]
bodystr
Default: ''
statusint
Default: 200
fallback_csrbool
Default: False

SyncEmbeddedSSRClient

Embedded QuickJS isolate pool in the vertebra-bundler Rust extension (sync).

AsyncEmbeddedSSRClient

Embedded QuickJS isolate pool in the vertebra-bundler Rust extension (async).

from_config

from_config(config)

Instantiate an AsyncEmbeddedSSRClient from an SSRConfig.

render

render(page)

Render an Inertia page object asynchronously via the native QuickJS pool.

invalidate

invalidate(paths=None)

Invalidate cached modules in the QuickJS pool.

stop

stop()

Shut down the QuickJS isolate pool.

SyncSidecarSSRClient

Bases: _BaseSidecarSSRClient

Inertia SSR server managed as an external Node.js or Bun subprocess (sync).

AsyncSidecarSSRClient

Bases: _BaseSidecarSSRClient

Inertia SSR server managed as an external Node.js or Bun subprocess (async).

HTMX Request & Response Helpers

HxSwap

HxSwap = Literal[
    "innerHTML",
    "outerHTML",
    "beforebegin",
    "afterbegin",
    "beforeend",
    "afterend",
    "delete",
    "none",
]

HTMXRequest

Bases: Struct

Parsed HTMX request headers (HX-Request, HX-Target, HX-Trigger, HX-Boosted).

Attributes:

Name Type Description
is_htmxbool
Default: False
is_boostedbool
Default: False
is_history_restore_requestbool
Default: False
current_urlstr | None
Default: None
promptstr | None
Default: None
targetstr | None
Default: None
triggerstr | None
Default: None
trigger_namestr | None
Default: None

from_headers

from_headers(headers)

Construct an HTMXRequest from case-insensitive HTTP request headers or raw wire tuples.

HTMXResponse

Bases: Struct

HTML fragment response with typed HX-* response headers.

Attributes:

Name Type Description
htmlstr
status_codeint
Default: 200
push_urlstr | bool | None
Default: None
replace_urlstr | bool | None
Default: None
reswapHxSwap | None
Default: None
retargetstr | None
Default: None
reselectstr | None
Default: None
redirectstr | None
Default: None
refreshbool
Default: False
triggerstr | dict[str, Any] | None
Default: None
trigger_after_settlestr | dict[str, Any] | None
Default: None
trigger_after_swapstr | dict[str, Any] | None
Default: None
extra_headersdict[str, str]

to_headers

to_headers()

Build the HTTP response header dictionary including HX-* directives.