taia.ds was extracted from an application where the same code lived under ds.*,
state-machines.*, logging.* and extensions.*. Polylith needs a top namespace, so everything
moved under taia.ds.*.
| Before | After |
|---|---|
ds.interface | taia.ds.datastar.interface |
ds.adapters.handlers.context/ctx->data-signals | taia.ds.datastar.interface/ctx->data-signals |
ds.adapters.handlers.response/->html | taia.ds.datastar.interface/html-response |
ds.adapters.*, ds.domain.* (internal) | taia.ds.datastar.adapters.*, taia.ds.datastar.domain.* |
state-machines.interface | taia.ds.state-machines.interface |
state-machines.test-helpers | taia.ds.state-machines.test-helpers |
logging.interface | taia.ds.logging.interface |
extensions.interface | taia.ds.extensions.interface |
search path "ds.adapters.components" | gone: the library has no components of its own, so the default is [] and the application lists only its own prefixes |
vendored /js/datastar.js, /js/sse-reconnect.js | classpath datastar/js/…, served via wrap-resource "datastar" |
Behaviour is unchanged. Two additions: ctx->data-signals and html-response are on the
interface, so component code no longer needs the adapters.handlers.* namespaces.
Mechanical rewrite:
perl -pi -e 's/(?<![\w.\-])ds\.(interface|adapters|domain)\b/taia.ds.datastar.$1/g;
s/(?<![\w.\-])state-machines\.(interface|test-helpers)\b/taia.ds.state-machines.$1/g;
s/(?<![\w.\-])logging\.interface\b/taia.ds.logging.interface/g;
s/(?<![\w.\-])extensions\.interface\b/taia.ds.extensions.interface/g' $(git ls-files '*.clj' '*.cljc')
Then update the search-path configuration and remove the vendored JS files.
taia.ds 0.5.0 ships Datastar 1.0.5 and the Clojure SDK 1.0.0-RC13. If your application still runs its own copy of these namespaces on RC8, check these after the rename above:
datastar.js and sse-reconnect.js. If the app still serves its vendored
copies, whichever wrap-resource runs first wins. The page can then keep running RC8 and the old
watchdog, which loops when a live stream is re-opened, with nothing to tell you./ds/nds-connect/…. Since 0.4.0, every request there opens a connection
and replaces the page's one. A SEND_MESSAGE POSTed there resets the connection instead of
sending a message. Post it to /ds/nds/….INIT?session-id='+sid, ?since=) need nothing: the server
closes the stream a new connection replaces (datastar-nds-superseded). A hand-rolled
AbortController passed as requestCancellation keeps working too.retryMaxWaitMs is now retryMaxWait. retryMaxCount: n now allows n
retries (RC8 gave up at the n-th failure), and neither the count nor the backoff resets after a
successful reconnect. A {retryMaxCount: 2} meant to fail fast waits one more backoff now: use 1
for RC8's timing.data-bind. An unseeded select now yields a string, not a number. Checkboxes and radios
sync on input. A morph that changes a bound input's value updates its signal
(Gotchas).datastar query parameter, like GET: no body, no
Content-Type. Large signal stores can hit the server's request-line limit; use filterSignals.FetchFailed. It surfaces as an unhandled rejection
(pageerror in Playwright), not as a console.error.Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |