clojurescript 2026-07-31

AI created summary warning, with apologies in advance - but I think it’s just about useful enough to share. Here’s a cheatsheet for working with Tailwind V4, CLJS and CLJ, with some gotchas and patterns that have come from my own (pre-AI, so I can claim at least some human ingenuity..) setup. TW v4 is really a different monster to V3 - no JS config, no postcss plugins, just CSS as it should be. https://claude.ai/code/artifact/fe72dba1-653a-4e7d-b54e-a0529f5f15b4

👍 1

In CLJ this part is really off: "Variants and opacity in keyword position"

:a:b:c ;=> is fine
:a/b/c => throws "Invalid keyword: :a/b/c." So not silently failing
So it sounds like normal Hiccup / Clojure would work well with it and no major pitfalls? I think the challenge with "Computed class names" is also not something specific to Clojure

very true - that one flew under the radar facepalm thank you! that’s fixed up. It works perfectly with server side hiccup, monitoring the clj source folder - modulo the gotcha with complex keywords. I’d gently suggest just using :class "..." to sidestep all the little fumbles with the zencoding style shorthands, but up to the author of course. Autocomplete for tailwind classes is also very possible in IDEs, and leans on a convention of using string classes. I wrote a little about that a while ago - https://clojurians.slack.com/archives/C0744GXCJ/p1743277151228429 - I’d imagine you can get similar with emacs with a bit of fiddling.

I am trying to make a multimethod work that accepts varargs but ClojureScript with shadow-cljs 3.4.11 throws an exception if >20 arguments are apply’d in invocation:

(defmulti multi-f (fn [k & _] k))
(defmethod multi-f 0 [_ & args] args)

(apply multi-f (range 20)) ;; OK
(apply multi-f (range 21)) ;; Error: 20 is not ISeqable
(apply multi-f (range 22)) ;; Error: Invalid arity: 22
The issue does not occur in ClojureScript 1.12.145 without shadow. It has been fixed already in 2022 by David Nolen (https://github.com/clojure/clojurescript/commit/8b3ce24a6e7e1863802b09618985a0f3a604a0c9, in response to https://clojure.atlassian.net/browse/CLJS-3024). Although it still fails without apply (but passing >20 args explicitly is unlikely to ever happen, so I guess it’s fine). A quick search on this channel revealed that it is probably a known issue, but what I found has been some years ago, so I was wondering if there has been any new development or interest in fixing it?

Feels like that is more a #C6N245JGG issue? You could forward this message there and see what @thheller says when he's around (it's very late for him right now).

Yeah that makes sense, I forgot about the other channel. Just forwarded it.

sorry must have missed that change. should be fixed in 3.4.12

👀 1

Just tested it and the behaviour is now consistent with the latest ClojureScript, thanks for fixing!