Homoiconic HTML virtual-DOM differ, keyed patch ops, Server-Sent Events (SSE) morphing frames, and typed HTMX request/response helpers.
Server-driven LiveView virtual DOM tree differ, minimal DOM patch morpher, SSE patch streamer, < 2 KB browser runtime, and HTMX hypermedia helpers built over lib/html and lib/web.
veko pkg add web_live@1.0.0Import in any Veko module:
use [live = web_live]lib/html Hiccup blocks ([.div { id = 'app' } [ [.h1 {} ['Hello']] ]]) with zero intermediate JSX compilation step.live/diff-trees walks old_tree and new_tree in lockstep, emitting .replace, .set_text, .set_attr, .del_attr, .insert_child, and back-to-front .remove_child operations addressed by integer childNodes paths (such as [0 2 1]).live/apply-patches applies patch sequences in pure Veko so (live/apply-patches old_tree patches) == new_tree holds deterministically in unit tests without launching a browser.< 2 KB Client Morph Runtime: live/client-runtime-js embeds an EventSource listener (veko-patch) and [vk-click] event delegation script in under 1.2 KB of vanilla JavaScript.HX-Request, HX-Boosted, HX-Target, HX-Trigger, HX-Redirect, HX-Reswap, HX-Retarget, hx-swap-oob, and automatic full-page vs fragment rendering (live/render-page-or-partial).PatchOp — { op enum, path block, key str, val any, index i64 }LiveSession — { id str, state any, tree any, version i64, reducer any, view any }LiveStep — { version i64, patches block[PatchOp], sse str, tree any }live/hiccup-el? node -> boollive/diff-trees old_tree new_tree -> block[PatchOp]live/apply-patches tree patches -> anylive/encode-sse-patch patches [/id event_id] [/event ev_name] -> strlive/client-runtime-js endpoint_prefix -> strlive/new-session id initial_state reducer_fn view_fn -> LiveSessionlive/dispatch-event mut sess event_name payload -> LiveSteplive/htmx-request? req -> boollive/htmx-boosted? req -> boollive/htmx-target req -> strlive/htmx-trigger-name req -> strlive/hx-trigger resp event_spec -> web/Responselive/hx-redirect location -> web/Responselive/hx-reswap resp strategy -> web/Responselive/hx-retarget resp selector -> web/Responselive/hx-swap-oob node swap_spec -> blocklive/render-page-or-partial req title head_extra fragment_node -> web/Responseuse [live = web_live, html]
view = fn [count i64] block [
[.div { id = 'counter' } [
[.span { class = 'val' } [`Count: {mold count}`]]
[.button { 'vk-click' = 'inc' } ['+1']]
]]
]
t0 = view 0
t1 = view 1
patches = live/diff-trees t0 t1
sse = live/encode-sse-patch/id patches '1'
println ssehttps://veko-lang.org/pkg/web_live/1.0.0.vkp7ad1171a6b34c0b9b590a45d741493b935c16895fab1accecf60834b477e03611f741377f906b99e899dbc773a83ce167f935bd5660ba9ef25de75bf50bfba72ed25519:27406074d8681da1d4e6420f5d887cac15c313334c249ac047ba9d4e2df72b70{"name":"web_live","version":"1.0.0","tier":6.0,"tier_label":"Tier 6: Local-First, IoT, Web & Media","category":"Server-Driven Live Views","description":"Homoiconic HTML virtual-DOM differ, keyed patch ops, Server-Sent Events (SSE) morphing frames, and typed HTMX request/response helpers.","modules":["web_live"],"homepage":"https://veko-lang.org/packages/web_live"}| Bundle Entry Path | Size | Leaf SHA-256 Digest |
|---|---|---|
| README.md | 2 KB | b68ce983daa2ea8078abd80c23ffd9a277d385f972bb3a25a9878695a60935a5 |
| examples/demo.vk | 6 KB | 0be74478e2fa353426c24a1de13e17b8e065b05a3a69dcc182cd143f580ca4c6 |
| mod.vk | 13 KB | ded590176a99d084e651b52db69264d3b7c2db69a1dfc1a741027c5073456425 |