feat(wasm): execute client handlers without requests

req: client_local/001\nreq: client_local/004\nreq: client_local/005\nreq: client_local/009\nreq: client_local/010\nreq: client_local/014\nreq: v1_release/001
This commit is contained in:
slhx agent
2026-07-13 12:33:54 +02:00
parent 0d49007c61
commit 40643e360d
16 changed files with 515 additions and 25 deletions
+17
View File
@@ -0,0 +1,17 @@
[package]
name = "hemx-client-local-example"
version.workspace = true
edition.workspace = true
publish = false
[lib]
crate-type = ["cdylib", "rlib"]
[dependencies]
hemx = { path = "../../hemx", features = ["client"] }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
hemplate = { path = "../../../hemplate/hemplate" }
[build-dependencies]
hemx-build = { path = "../../hemx-build" }
+5
View File
@@ -0,0 +1,5 @@
fn main() {
hemx_build::app()
.run()
.expect("compile client-local template");
}
+7
View File
@@ -0,0 +1,7 @@
#[hemx::surface]
pub mod ui {}
#[hemx::handler(client)]
pub fn increment() -> impl hemx::IntoEffect {
ui::client_local::counter_panel.text("updated by Rust/WASM")
}
@@ -0,0 +1,4 @@
<main data-hemx-root="client_local">
<section data-hemx-slot="counter_panel">idle</section>
<button type="button" data-hemx-handle="increment" data-hemx-client="increment">Increment locally</button>
</main>