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 |
|---|---|---|
enabled | bool | Default: False |
root_template | str | Default: 'index.html' |
version | str | None | Default: None |
ssr | SSRConfig | None | Default: None |
shared_data | dict[str, Any] | |
static_props | dict[str, Any] | |
manifest_path | str | Default: 'dist/.vite/manifest.json' |
asset_manifest | AssetManifest | None | Default: None |
entry | str | Default: 'index.html' |
asset_url | str | Default: '/static/' |
early_hints | bool | Default: True |
csp_nonce_header | str | Default: 'X-CSP-Nonce' |
ssr_enabled | bool | Return True when SSR configuration is present. |
InertiaResponse
¶
Bases: Struct
Value returned by an Inertia page handler.
Attributes:
| Name | Type | Description |
|---|---|---|
component | str | |
props | dict[str, Any] | |
encrypt_history | bool | Default: False |
clear_history | bool | 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 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 |
|---|---|---|
resolver | Callable[[], Any] | |
group | str | Default: 'default' |
once | bool | Default: False |
expires_in | int | None | Default: None |
MergeProp
¶
Bases: Struct
A prop whose value is merged during partial reloads.
Attributes:
| Name | Type | Description |
|---|---|---|
resolver | Callable[[], Any] | |
prepend | bool | Default: False |
DeepMergeProp
¶
Bases: Struct
A prop whose value is deep-merged during partial reloads.
Attributes:
| Name | Type | Description |
|---|---|---|
resolver | Callable[[], Any] |
OnceProp
¶
Bases: Struct
A prop resolved only once; subsequent requests skip it if cached.
Attributes:
| Name | Type | Description |
|---|---|---|
resolver | Callable[[], Any] | |
expires_in | int | None | Default: None |
ScrollProp
¶
Bases: Struct
A prop carrying infinite-scroll pagination metadata.
Attributes:
| Name | Type | Description |
|---|---|---|
resolver | Callable[[], Any] | |
page_name | str | Default: 'page' |
current_page | int | Default: 1 |
next_page | int | None | Default: None |
previous_page | int | None | Default: None |
OptionalProp
¶
Bases: Struct
A prop resolved only during partial reloads that explicitly request it.
Attributes:
| Name | Type | Description |
|---|---|---|
resolver | Callable[[], Any] |
QuickJS Server-Side Rendering¶
SSRConfig
¶
Bases: Struct
Configuration for SSR execution backends and static site prerendering.
Attributes:
| Name | Type | Description |
|---|---|---|
mode | Literal['native', 'sidecar'] | Default: 'native' |
entry | str | Default: '' |
bundle_path | str | None | Default: None |
sidecar_url | str | Default: 'http://127.0.0.1:13714/render' |
sidecar_port | int | Default: 13714 |
pool_size | int | Default: 4 |
timeout_ms | int | Default: 1000 |
timeout | float | Default: 2.0 |
prerender_routes | tuple[str, ...] | Default: () |
fallback_to_csr | bool | Default: True |
SSRResult
¶
Bases: Struct
Result of an SSR render operation.
Attributes:
| Name | Type | Description |
|---|---|---|
html | str | Default: '' |
head | list[str] | |
body | str | Default: '' |
status | int | Default: 200 |
fallback_csr | bool | 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).
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_htmx | bool | Default: False |
is_boosted | bool | Default: False |
is_history_restore_request | bool | Default: False |
current_url | str | None | Default: None |
prompt | str | None | Default: None |
target | str | None | Default: None |
trigger | str | None | Default: None |
trigger_name | str | None | Default: None |
from_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 |
|---|---|---|
html | str | |
status_code | int | Default: 200 |
push_url | str | bool | None | Default: None |
replace_url | str | bool | None | Default: None |
reswap | HxSwap | None | Default: None |
retarget | str | None | Default: None |
reselect | str | None | Default: None |
redirect | str | None | Default: None |
refresh | bool | Default: False |
trigger | str | dict[str, Any] | None | Default: None |
trigger_after_settle | str | dict[str, Any] | None | Default: None |
trigger_after_swap | str | dict[str, Any] | None | Default: None |
extra_headers | dict[str, str] |