Skip to content

Releases

0.12.16

Choose a tag to compare

@k7d k7d released this 24 Nov 08:40

Added

  • :self-host true compiles the ClojureScript compiler into the build (cljf.selfhost, with cljs.core's macros compiled as ClojureScript). cljf.selfhost/eval-str compiles 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_eval does it from the console. #x literals 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.selfhost has the lookups (doc, apropos, ns-info, macroexpand-str, namespaces).

  • The generated :test-runner's run-tests takes an optional function of the cljs.test block 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: false turns it off.

Fixed

  • cljf.esm.karma/start yields the event loop between tests once a second. cljs.test only 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

Choose a tag to compare

@k7d k7d released this 04 Nov 15:39

Added

  • The REPL's MCP server for coding agents: with :repl {:mcp-port 0} the watcher serves MCP on 127.0.0.1 (port in .cljf/mcp-port), and cljf mcp connects 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.json and an AGENTS.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-clojurific lists the Vanilla template last and adds uni.style to the React, Reagent and UIx templates unless declined.

Fixed

  • :closure-defines didn't set goog-define vars in ES module output: they kept their default, as the compiler looked for a @define jsdoc the macro doesn't attach to the var.

Full Changelog: v0.12.14...v0.12.15

0.12.14

Choose a tag to compare

@k7d k7d released this 04 Nov 09:46

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

Choose a tag to compare

@k7d k7d released this 30 Oct 14:40

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

Choose a tag to compare

@k7d k7d released this 28 Oct 08:22

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

  • @viesti made their first contribution in #6

Full Changelog: v0.12.11...v0.12.12

0.12.11

Choose a tag to compare

@k7d k7d released this 27 Oct 10:16

Added

  • The Vite plugin has TypeScript types (clojurific/vite's index.d.ts): a vite.config.ts type checks the plugin's options and the common compiler options of compilerOptions (camelCase), and editors complete them in JavaScript configs too. create-clojurific's templates have a vite.config.ts.

0.12.10

Choose a tag to compare

@k7d k7d released this 26 Oct 14:06

Changed

  • :release builds (the :release profile, cljf.esm build without a profile, and the Vite plugin's vite build) define goog.DEBUG false unless :closure-defines sets it, like shadow-cljs' release mode: code under goog.DEBUG is left out of production bundles without configuration. Set :closure-defines {goog.DEBUG true} to keep it.

0.12.9

Choose a tag to compare

@k7d k7d released this 26 Oct 13:11
  • The Vite plugin's compilerOptions object accepts camelCase keys, written as kebab-case keywords ({ repl: { nreplPort: 0 } } is {:repl {:nrepl-port 0}}). The names under closureDefines and jsEntries (defines, entries and their exports) are kept as they are. create-clojurific's templates and the docs use camelCase keys.

0.12.8

Choose a tag to compare

@k7d k7d released this 26 Oct 07:10

Changed

  • The Vite plugin is named cljf instead of cljs: its log lines start with [cljf], and create-clojurific's projects and the docs import it as cljf (import cljf from 'clojurific/vite').

Fixed

  • :parallel-build compile 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 a Stream closed trace each nor keep the JVM from exiting.

0.12.7

Choose a tag to compare

@k7d k7d released this 11 Oct 11:26

Added

  • npm create clojurific@latest scaffolds a Hono backend (--template hono): its app is a :js-entries export the dev server runs and hot reloads with @hono/vite-dev-server, npm run build bundles it into a Node.js server, npm run repl evaluates 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-entries modules import the REPL runtime first, which connects through the module runner's hot channel. The plugin's ssrEntries option 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.