Repository navigation
Releases
0.12.16
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
0.12.15
Added
- The REPL's MCP server for coding agents: with
:repl {:mcp-port 0}the watcher serves MCP on127.0.0.1(port in.cljf/mcp-port), andcljf mcpconnects agents to it over stdio. Its tools evaluate in a runtime given by id or tag, wait for edits to be compiled and hot reloaded, report the build's status, read a runtime's console log and the dev server's own errors, and look up namespaces and vars and expand macros. Browser tabs keep their runtime id when reloaded.create-clojurific's projects start it, with.mcp.jsonand anAGENTS.md.cljf mcp --dir <dir>connects an agent started in another directory, i.e. a monorepo's root. Its clients authenticate with a token of the server's run, in the owner-only port file.
Changed
create-clojurificlists the Vanilla template last and adds uni.style to the React, Reagent and UIx templates unless declined.
Fixed
:closure-definesdidn't setgoog-definevars in ES module output: they kept their default, as the compiler looked for a@definejsdoc the macro doesn't attach to the var.
Full Changelog: v0.12.14...v0.12.15
0.12.14
What's Changed
- Builds read cljs.core's analysis cache for the copy they compile: restored output keeps its Closure Library modules by @maxweber in #22
New Contributors
Full Changelog: v0.12.13...v0.12.14
0.12.13
What's Changed
- #x (#jsx) literals: hiccup compiled to react/jsx-runtime calls by @k7d in #13
- Locals munged to the same JavaScript name (a-b, a_b) shadow each other instead of overwriting (#18) by @k7d in #21
- ES module output: const and let instead of var in functions by @k7d in #14
- ES module output: destructure #js [] arrays by index by @k7d in #16
Full Changelog: v0.12.12...v0.12.13
0.12.12
What's Changed
- Faster builds: parallel compiling, per-user class caches, faster Vite bundling by @k7d in #9
- Vite plugin: the ssrEntries run despite compiler warnings, and an ignoreWarnings option by @k7d in #10
- nil closure-defines don't set goog.DEBUG; :test-runner validated by @k7d in #11
- nREPL middleware, and cider-nrepl's ClojureScript completion by @viesti in #6
- cljf repl completes on Tab; create-clojurific's projects have cider-nrepl by @k7d in #12
New Contributors
Full Changelog: v0.12.11...v0.12.12
0.12.11
Added
- The Vite plugin has TypeScript types (
clojurific/vite'sindex.d.ts): avite.config.tstype checks the plugin's options and the common compiler options ofcompilerOptions(camelCase), and editors complete them in JavaScript configs too.create-clojurific's templates have avite.config.ts.
0.12.10
Changed
:releasebuilds (the:releaseprofile,cljf.esm buildwithout a profile, and the Vite plugin'svite build) definegoog.DEBUGfalse unless:closure-definessets it, like shadow-cljs' release mode: code undergoog.DEBUGis left out of production bundles without configuration. Set:closure-defines {goog.DEBUG true}to keep it.
0.12.9
- The Vite plugin's
compilerOptionsobject accepts camelCase keys, written as kebab-case keywords ({ repl: { nreplPort: 0 } }is{:repl {:nrepl-port 0}}). The names underclosureDefinesandjsEntries(defines, entries and their exports) are kept as they are.create-clojurific's templates and the docs use camelCase keys.
0.12.8
Changed
- The Vite plugin is named
cljfinstead ofcljs: its log lines start with[cljf], andcreate-clojurific's projects and the docs import it ascljf(import cljf from 'clojurific/vite').
Fixed
:parallel-buildcompile errors name their file, line, column and the macro whose expansion failed instead of only the innermost message, the watcher no longer stops (and stops recompiling) when an error's data can't be written as JSON, and a failed namespace's queued emits no longer print aStream closedtrace each nor keep the JVM from exiting.
0.12.7
Added
npm create clojurific@latestscaffolds a Hono backend (--template hono): its app is a:js-entriesexport the dev server runs and hot reloads with@hono/vite-dev-server,npm run buildbundles it into a Node.js server,npm run replevaluates in it. The framework prompt links to each framework's site.- The REPL evaluates in servers the Vite dev server's ssr environment runs: under
:esm-repl,:js-entriesmodules import the REPL runtime first, which connects through the module runner's hot channel. The plugin'sssrEntriesoption runs entries in the ssr environment once compiled, so the REPL has a runtime before the server's first request.
Fixed
- The REPL stopped answering a runtime whose REPL runtime module was hot reloaded (i.e. by a late file event of the dev server's first compile): Vite drops the listeners of the module's previous instance, the new instance now connects again.