A browser app
No working mode yet: this page will run over peering later. It ran against the JVM HTTP service, which the HTTP removal (slice 2) deleted, and is kept as a placeholder. The library reader (
/app/library/) runs over peering; see examples/web/README.md.
The Values / Store split still holds in the tab. Domain code is
dacite.value. The store is HTTP plus a write-back cache. The UI is DOM
(todo) or a typed tree (explorer). Neither app dumps the root to JSON.
Run
cd impl/clojure
clojure -M:cljs-web # todo bundle (first time / after cljs)
clojure -M:cljs-explorer # explorer bundle
The bundles then needed the HTTP service at these URLs:
| URL | App |
|---|---|
| http://127.0.0.1:8080/app/ | Todo — add / toggle / remove; CAS the root |
| http://127.0.0.1:8080/app/explorer/ | Value explorer — walk the same root as typed values |
Use a trailing slash. Hard-refresh after rebuilding JS (main.js?v=…
cache-busts when we bump it).
What the browser is doing
GET /root— current hash, or none.- Domain ops (
add-todo, expand a node) run on Dacite values in memory. GET /node/{hex}— one pack-filled chunk (literals under the hash, ~1k soft budget). The client applies the chunk, then reads the value. A tree click is not a GET if that neighborhood is already local.- Commit: write-back flush
POST /nodes(same Layer 1 literals as GET), thenPOST /root/cas.
Todo CLI uses v/root on a file store. The browser todo still
coordinates hashes at the CAS layer in places — a library hole, not a
reason to invent a JS model. Explorer is read-only on whatever root the
service already has (todo, notes, the type gallery).
fetch reads response.body as bytes arrive. IStore stays synchronous:
a miss suspends, and dacite.store.browser/drive reruns the value op once
that body is cached. The tab is not blocked on the request.
Next
- Browse without dumping — paging and pack GET.
- Anatomy of a Dacite app — the same recipe as the CLI.
- The Dacite way