feat(web): native SPA helpers, memory store, and demo

Add bridge scope=memory, lib/browser store_set/spa_goto, web-spa-app
list/detail/edit client routes demo, and helper smoke.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-17 20:58:21 +08:00
1 parent 5cf84fe9b7
commit b710745e88
9 files changed
+373

No files matched your search

+44
View File
@@ -154,6 +154,50 @@ focus.
*> table.put in=None at="navigate" value=spec*
## store_set
+ `key`
+ `value`
+ `scope`="memory"
In-memory (or local/session) key write for SPA client state. Prefer `scope=memory` for tab-local app state.
`spec` =
| op | key | value | scope |
|----|-----|-------|-------|
| set | `key` | `value` | `scope` |
*> table.put in=None at="storage" value=spec*
## store_get
+ `key`
+ `then`
+ `scope`="memory"
Read a key then call `then` with `{ok, value, found, key, scope}`.
`spec` =
| op | key | then | scope |
|----|-----|------|-------|
| get | `key` | `then` | `scope` |
*> table.put in=None at="storage" value=spec*
## spa_goto
+ `url`
+ `replace`=False
SPA navigation: `history.pushState` / `replaceState` via bridge `navigate` effect.
`spec` =
| url | replace |
|-----|---------|
| `url` | `replace` |
*> table.put in=None at="navigate" value=spec*
## storage
+ `spec`