One central reducer driving both server-side rendering and WebAssembly island morphing
rust
velvet_html::closed_act! {
pubenum HomeAct {
Ping => "saas_showcase_ping" {
islands = &["count"],
form = NoteForm
},
}
}
// In the application reducer:match HomeAct::dispatch(act)? {
HomeAct::Ping => {
let form = NoteForm::from_payload(&payload)?;
state.count = state.count.saturating_add(1);
}
}
Acts guarantee thread safety and wire safety across native, web, and MCP agent calls.
ISLAND MORPHING
Surgical DOM Patching without Virtual DOM
Tagged islands update with sub-microsecond latency without traversing a secondary tree
WASM Island Contract
island("id", view)
When state mutates, the motor computes diffs only on dirty tagged islands, applying direct textContent, classList, and value updates in browser DOM.rust