I'm a bit annoyed by squint not taking :clj branches in .cljc files for macros currently, so I came up with this scheme:
(ns scratch
{:squint/compile-time true}) ;; <- mark this .cljc namespace as containing compile-time forms that should be only loaded at compile time
#?(:clj
^:squint/compile-time ;; <- even though this is in a `:clj` reader conditional, still load it and keep only the squint compile time form
(defmacro dude [] 3))
#?(:cljs
(js/console.log (dude)))
;;=>
console.log(3);
I'm porting babashka.cli to Node.js using squint so I can use this (and also in the clojure-test-suite)