dirac

Dirac v1.7.2 is out: https://github.com/binaryage/dirac/releases/tag/v1.7.2
fasiha 2016-09-18T00:51:23.000635Z

So I have cljs-devtools and Dirac set up and am enjoying REPLing in Dirac instead of Figwheel REPL. But how does one see Cljs code like in Nolen’s https://youtu.be/mty0RwkPmE8?t=24m39s ?

fasiha 2016-09-18T00:51:45.000636Z

In my Sources Dirac tab, I only see JS sources?

2016-09-18T01:16:17.000637Z

@fasiha can you confirm that it works in normal (internal) devtools?

fasiha 2016-09-18T01:24:35.000638Z

@darwin I've never seen cljs code in Chrome Devtools (even before I installed Dirac/cljs-devtools), is it just supposed to be there under Sources…? (I feel really silly, I'm sure it's something very stupid I'm doing)

fasiha 2016-09-18T01:25:22.000639Z

Figwheel puts compiled code in resources/public/js/compiled, and I have a Clojure webserver serving out resources/public as the web root, so all I see in Sources is compiled JS code

fasiha 2016-09-18T01:26:14.000640Z

Doh, actually, if I drill down under Sources, I see cljs files, e.g., out/cljs/core.cljs, and they're syntax-highlighted

fasiha 2016-09-18T01:26:49.000642Z

And I see my app’s cljs source code too 😄

richiardiandrea 2016-09-18T02:09:33.000644Z

A question for cljs-devtools...I see a different output between:

(.info js/console "Calling back!" {:data "a lot of data"}) ;; formatting here is done
and:
(set! cljs.core/*print-fn*
      (fn [& args]
        (apply (.-info js/console) args))) ;; no formatting
Shouldn't I see the same?

2016-09-18T11:07:11.000663Z

@richiardiandrea *print-fn* receives strings from cljs printing subsystem, not original objects. https://github.com/binaryage/cljs-devtools/issues/5#issuecomment-132212643, btw. you should use the enable-console-print! implementation, yours is not 100% correct, because you are calling js/console.info without passing js/console as “this” object

2016-09-18T14:43:09.000674Z

@richiardiandrea you'd address the this issue by doing: (apply (js/console.info.bind js/console) args) But, of course, the other issues raised by darwin would need to be addressed first, so this is really only background info.

richiardiandrea 2016-09-18T16:55:52.000683Z

@darwin ok, I copied it from the cljs source 😄 I am trying to improve the debug printing in replumb a bit and make it compatible with cljs-devtools, I will follow your and Mike's guidance and report back 😄

richiardiandrea 2016-09-18T17:34:56.000686Z

btw I had exactly the same implementation in core.cljs but I thought it was wrong and did not quite read through it...so I guess I will roll my own