Fork me on GitHub
Oliver George00:08:35

Am I missing other approaches? Perhaps there's a way to detect if cljs-devtools is installed.


the hijack-console! also replaces the original console. there's probably a way to detect that the current console is a clojure fn or that the console function is different from the original


why do you want to detect if cljs-devtools is installed before printing?

Oliver George00:08:35

thanks @smith.adriane i'll give that a try

Oliver George00:08:01

@lilactown using js/console.log with regular clojure data types produces verbose/unreadable strings

Oliver George00:08:05

Today's job is a react native app. It's not always convenient to turn cljs-devtools on (e.g. two simulators) and it's helpful to look in the simulator logs sometimes (no cljs-devtool rendering).

Oliver George00:08:53

Generally it'd be nice to log in a way which is release friendly (e.g. the pr-str wrapper) but still have the option to drill into data when debugging.


Does anyone have experience with the cljs.analyzer and cljs.spec.alpha? I am trying to run codox on a shadow-cljs ClojureScript project, codox internally uses cljs.analyzer and my it is failing on statements whenever I use cljs.spec.alpha/assert saying it can't find:

Caused by: clojure.lang.ExceptionInfo: Unable to resolve var: *runtime-asserts* in this context at line 21 src/a.cljs {:file "src/a.cljs", :line 21, :column 3, :tag :cljs/analysis-error}


A more general question, what does everyone use to generate API documentation for their ClojureScript projects?


I ended up cheating and changed my cljs.spec.alpha/assert to cljs.spec.alpha/assert* even though it said not to use it.


I'm having a hard time defining a macro in ClojureScript. I'm following from theller, and I've got it working with trival macros like:

(defmacro defstory [title & story-vecs]


However, when I have an error in my defmacro, it seems like the macro compilation silently fails, and I'll get an undeclared var 'defstory' error.


I understand that macro compilation is happening in the JVM Clojure runtime. Do I need to look somewhere else for defmacro error messages?