Module

live_blocks

Live-block declarations for hybrid static/dynamic freeze output.

A live block is a named template block on a frozen page that is swapped out at freeze time for an htmx placeholder. At request time the placeholder hits the block-fetch dispatcher (/_frag{path}?_b={block}) and the declared handler renders the block dynamically.

Declarations are registered vialive_block() and stored in MutableAppState.live_blocks keyed by (route, block). The freeze pipeline consults this map during post-processing; the dispatcher uses the same map to resolve which handler to invoke (falling back to the route's native handler when the live-block handler is the same as the route's).

Classes

LiveBlockSpec 7
Declaration of one live block on one route.

Declaration of one live block on one route.

Attributes

Name Type Description
route str
block str
handler Callable[..., Awaitable[Any] | Any]
trigger str
swap str
skeleton str | None
cache_seconds int | None