This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-18
Channels
- # bangalore-clj (1)
- # beginners (36)
- # boot (119)
- # braid-chat (16)
- # cider (14)
- # cljs-dev (34)
- # cljsrn (7)
- # clojars (9)
- # clojure (91)
- # clojure-austin (1)
- # clojure-bangladesh (1)
- # clojure-dusseldorf (5)
- # clojure-israel (1)
- # clojure-russia (3)
- # clojure-spec (6)
- # clojure-uk (7)
- # clojurescript (11)
- # community-development (1)
- # core-async (5)
- # cursive (6)
- # datomic (11)
- # dirac (12)
- # funcool (24)
- # leiningen (5)
- # luminus (5)
- # off-topic (2)
- # om (69)
- # om-next (16)
- # overtone (4)
- # perun (19)
- # re-frame (23)
- # reagent (38)
- # specter (7)
- # uncomplicate (9)
- # yada (4)
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 ?
@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)
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
Doh, actually, if I drill down under Sources, I see cljs files, e.g., out/cljs/core.cljs, and they're syntax-highlighted
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?@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
@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.
@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 😄
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