Fork me on GitHub
Chris K01:09:32

I'm trying to use compojure, and clojurescript for building websites (also planning to use hiccup), but I don't know how I can use them alltogether. I know that for hiccup, I can do (include-js "file") stuff, but not sure how it will work out for clojurescript. Anyone know any good resources for linking these softwares? thanks


hi, working on a nodejs cljs project, that uses npm serialport. If I build this as a standalone .js with shadow-cljs, then the serial port reacts to incoming data as expected. In the repl, however, I can see data come in (via some led's) but I never get notifications of this. I'm guessing it's some odd event-loop stuff, but this is above my node pay grade. Is there something that can be done in code run in the repl to let this stuff flow?


@hoppy are you expecting log entries in the repl? I remember shadow-cljs had some trouble showing nodejs logs in the repl a while ago


@alpox, guess I was expecting to see a println inside an '.on("data"')' Hadn't considered that that might not actually work - hmm


@alpox - you nailed it. the code is running, just not printing (in this particular case). atoms are my friend - Thank you!


Anyone know how to do this: document.getElementById("main-div").clientWidth in cljs?

Duck Nebuchadnezzar14:09:06

(.-clientWidth (.getElementById js/document "main-div"))
should do the trick


alternatively, (.. js/document (getElementById "app") -clientWidth)

👍 9

My preference:

(-> js/document (.getElem..) (.-clientWidth))


Just got back to this. Thanks!


It's better to just answer your own question than to remove it some time after you posted it. :)