feat(runtime): add portable runtime support

req: push/009 req: push/010 req: push/011
This commit is contained in:
tmk241
2026-08-17 07:59:04 +02:00
parent e4bd6db13a
commit 353174604e
19 changed files with 1018 additions and 347 deletions
+24
View File
@@ -0,0 +1,24 @@
# hemx on Cloudflare Durable Objects
This proof keeps the hemx authoring and wire model intact while Cloudflare owns room placement, persistence, and hibernating WebSockets:
```text
room.heml -> hemx-build generated resources -> Rust RoomState
-> generated counter partial -> canonical EffectBatch bytes
-> Durable Object hibernating sockets -> hemx browser runtime
```
The Durable Object stores only the counter. It never stores HTML, DOM patches, or `EffectBatch` values as domain truth.
## Local commands
```sh
cargo test -p hemx-cloudflare-do-example
cargo check --target wasm32-unknown-unknown -p hemx-cloudflare-do-example
cd examples/cloudflare_do
npx wrangler dev
```
Open the printed local URL in two tabs. Incrementing in either tab should update both without reload. Stop and restart `wrangler dev`; the room counter should remain.
A hosted deployment requires an authorized Cloudflare account. Production auth, CSRF, tenancy, jurisdiction, reconnect replay, and deployment policy are deliberately outside this proof.