Documentation
¶
Overview ¶
Package htmxinterop is the compiled source for docs/guide/htmx-interop.md.
It shows the two places HTMX may live on a page that also has live regions, and the handler that serves an HTMX swap. Neither path touches the live session: an hx-get is an ordinary GET to an ordinary http.Handler.
templ: version: v0.3.1020
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Notes = []string{"disk replaced", "certificate renewed"}
Notes is the application data the HTMX island fetches.
Functions ¶
func ControlsRegion ¶
ControlsRegion is a live region that hosts an HTMX-owned island.
The rule is innermost-declaration-wins. The <section> is a live region, so morph owns it. live.Preserve marks the <div> and its whole subtree as not the server's, and morph leaves it alone — so HTMX's swap into it survives every patch, and the hx-* element HTMX processed at page load is never replaced by markup HTMX has not seen.
An hx-* element inside a live region WITHOUT live.Preserve is server-owned: morph will overwrite it, and any swap into it will be reverted by the next patch. The library does not detect that; it is a documented precedence rule, not a server-side scan of rendered HTML.
func DeploysRegion ¶
DeploysRegion is plain HTMX OUTSIDE every declared live region.
It is not a fragment, it is not in Config.Fragments, and no patch can name it, so morph never reaches it and live.Preserve is not needed. This is the cheaper of the two arrangements and the one to prefer when the markup does not have to sit inside a live region.
func NotesHandler ¶
NotesHandler serves the fragment the island swaps in.
gotth-live neither intercepts nor rewrites this request. It is a plain handler returning HTML over HTTP, which is what "plain HTMX" means, and it is registered on the application's own router beside the live handler.
Types ¶
This section is empty.