Repository navigation
v0.4.0
Views can declare what their Render read, topics form a tree by their : segments, and the hub numbers its commits, for caches of derived values. A read can skip the statement caches, and a stream the hub stops keeps its clean end over HTTP/2. No API was removed. What to check in an app:
-
Topics with
:now count for the levels above them: a commit toboard:42touchesboardtoo, so a view on a bare kind such asboardrenders at everyboard:<id>commit. -
Per-tab, session and presence state belongs under a root of its own (
tab:…,sid:…,here:…), not under a root that shared views listen to. lith's site moved its demos' state out from under each demo's slug; the template needs no change. -
sse: a write under way when the hub stops its stream gets up to 250 ms to finish, like the end frame, where it had a deadline of now. Over HTTP/2 that deadline reset the stream withINTERNAL_ERROR, and the page lost its clean end and itsReconnectevent on a deploy. -
live:Depends(ctx, topics...)declares, in a Render, topics the view read. They mark it dirty likeTopicsand replace those of the Render before, so a view keyed by the tab follows the tab's route withoutUnwatchandWatch. -
live:Hub.Seqnumbers the commits,Hub.Version(topics...)is the last commit to touch one of them, andSeq(ctx)is, in a Render, the last commit its snapshot is sure to hold. A cached count stays valid while its topics' version is not above the number it was computed at. The hub keeps the versions of theOptions.Versionstopics changed last (32,768 by default, 4.3 MiB at most); a topic pushed out reads as changed then. -
live: topics form a tree by their:segments. A commit tosrc:A:7marks the views ofsrc:Aandsrctoo and moves their versions; one tosrc:A:*marks every view at or belowsrc:A, and*alone isMarkAll.Topic(parts...)builds one from outside ids such asurn:uuid:…, escaping:,*and%;Below(topic)adds the:*. The levels above keep their versions in a store of their own,Options.PrefixVersions(32,768 by default), so a sync of more items thanOptions.Versionsno longer pushes out the version of a space. A topic with an empty segment or a*panics inServe,WatchandDepends. A commit of two topics at depth 2 costs about 60 ns more (BenchmarkChanged). -
sqlite:Uncached(ctx)runs a query without the statement caches, on the read pool, in a Render and in a command. SQL built at runtime, such as an IN list sized to the results, no longer pushes the statements that repeat out of a connection's cache. -
Docs and skill: recipes for a topic hierarchy, a per-tab view that navigates with
Depends, and an aggregate cached against a version; views in a shared database, keyed by the person and the route; large updates and deletes, by rowid range or inExclusive;livewithout lith's writer, for an app whose own store callsHub.Changedafter each commit; and pinningReaders,CacheKiBand the hub'sWorkersin a desktop app, since they grow with GOMAXPROCS. New benchmarks measure large writes and the hub (BenchmarkLargeWrite,BenchmarkChanged,BenchmarkTick), andbench/RESULTS.mdcompares the board with v0.3.1.