aldebaran-datastar
Datastar's wire, once. Every property that serves a Datastar page built the
same three things by hand: the text of a patch event, the reading of a
request's signals, and a copy of datastar.js. This crate is those.
| Item | What it is |
|---|---|
PatchElements | Markup to put into the page: new, remove, selector, mode, sse(). |
PatchSignals | Signals to merge: of(&value), only_if_missing, sse(). |
signals::<T>(json) | A request's signals, from the datastar query parameter (GET) or the body. |
SCRIPT | datastar.js, version 1.0.4, the one copy. |
QUERY_PARAMETER, REQUEST_HEADER, EVENT_STREAM | The names on the wire. |
No I/O and no runtime: the adapters (aldebaran-worker, aldebaran-axum,
to come) put the text on a response.
let body = PatchElements::new(html).sse() + &PatchSignals::of(&json!({ "busy": false }))?.sse();