Repository navigation
Added
-
:self-host truecompiles the ClojureScript compiler into the build (cljf.selfhost, withcljs.core's macros compiled as ClojureScript).cljf.selfhost/eval-strcompiles and evaluates forms in the page, without the watcher's JVM, reading the build's analysis caches as forms need them; in a watched build,cljs_selfhost_evaldoes it from the console.#xliterals work too (cljf.jsx's macros, now.cljc, compiled as ClojureScript), and forms can require npm modules the page provides (cljf.selfhost/provide-module!). -
cljf.webmcp/register!registers the self-hosted compiler's tools (cljs_eval,cljs_doc,cljs_apropos,cljs_ns_info,cljs_macroexpand,cljs_namespaces) with WebMCP, for agents in the browser, and a page's own tools;cljf.selfhosthas the lookups (doc,apropos,ns-info,macroexpand-str,namespaces). -
The generated
:test-runner'srun-teststakes an optional function of thecljs.testblock it runs, letting runners add steps between tests. -
The Vite plugin's dev server pages show its status in their bottom left corner, like shadow-cljs' HUD: the modules a page is loading, a compile in progress, a hot reload's modules applied, and the dev server or its compiler gone.
hud: falseturns it off.
Fixed
cljf.esm.karma/startyields the event loop between tests once a second.cljs.testonly yields when an async test waits, so a long run of synchronous tests kept the browser from answering Karma's socket ping, and Karma dropped it (Disconnected reconnect failed before timeout ... (ping timeout)).- A page could load a second instance of namespaces it already ran, i.e. when a hot reloaded namespace gained a require, whose top level ran again without the first instance's values:
defmultis came back empty and record types were redefined until the page was reloaded. Vite gave the importers of a hot updated namespace the update's timestamp, which later imports of them used, though the page keeps running their instances. The Vite plugin now hot updates compiled namespaces in pages itself, stamping only the updated namespace. - The dependents the watch recompiled after a namespace's API changed often weren't hot reloaded: their output keeps its unchanged source's modification time, so Vite's file watcher didn't report the rewrite, and pages kept running code compiled against the old API (i.e. a direct call of an arity that no longer exists). The Vite plugin now hot updates the namespaces a compile wrote from its compiled event, together in one update. Those a compile wrote before failing (its error event reports them) are held back until a compile succeeds.
Full Changelog: v0.12.15...v0.12.16