Fork me on GitHub
#cider
<
2018-09-20
>
dominicm12:09:16

I've found a lovely bug in cider-nrepl. The way that tools.nrepl compatibility interacts with lazily loaded middleware means that sometimes cider can use cider/nrepl for one namespace, and org.clojure/tools.nrepl for another. @bozhidar A) why does the implementation look for tools.nrepl first? B) Why use find-ns and not try-require?

dominicm12:09:37

fwiw, this means that for me, cider-refresh is completely unusable unless I do a careful dance first to make sure cider loads carefully.

dominicm14:09:12

Oh, I see. I've been assuming nobody else writes commit messages. I looked now.

dominicm14:09:38

So the trick here is that under boot/lein, we're running inside an existing tools.nrepl, and we need to detect that. But inside clj cider/nrepl is used via cider.main, meaning that tools.nrepl is not the context in which we're running. However, figwheel is trying to load tools.nrepl, and fails if it cannot.

dominicm15:09:13

Building figwheel sidecar from master works, so I guess figwheel sidecar isn't updated to support cider/nrepl. @bhauman any problem with a new snapshot from master?

bhauman15:09:51

@dominicm yeah I can update the snapshot

bhauman15:09:09

and a release is probably overdue

dominicm15:09:46

That would be wonderful, thank you.

dominicm15:09:38

There's perhaps a more underlying issue here, but excluding a tools.nrepl dependency from figwheel sidecar does the job for me. Edge is the delicate balance of Clojure anyway.

bhauman15:09:14

@dominicm have you looked at figwheel-main adoption yet?

bhauman15:09:29

or is that too much to chew on right now?

dominicm15:09:29

@bhauman it's on my todo list. We're reworking our build tool significantly, but we are also just kicking off a new client project.

bhauman15:09:55

@dominicm 0.5.17-SNAPSHOT deployed

dominicm15:09:17

I need to look at the API for figwheel main too. I might have some feedback from that really, so sooner is probably better with me doing that. But time is short.

dominicm15:09:28

@bhauman thank you ๐Ÿ™‚

jrychter17:09:35

@sb yes, I do this regularly. I start my app externally via lein repl, then connect to it twice. In one of the REPLs I start the ClojureScript REPL. It takes some effort, but works, and is a big improvement on many years of ClojureScript REPLs which I was never able to get to work ๐Ÿ™‚

sb17:09:53

Thanks! I got a great tip from โ€˜roosta, cider-jack-in clj&cljs (in the emacs) and that is working now fine.

sb17:09:17

Start both environment.

jrychter17:09:05

I wonder โ€” am I the only one using aggressive-indent? It causes unbearable slowdowns and sometimes weird behavior (such as emacs waiting for me to press a key until proceeding). I managed to profile one possible cause, reported and I think fixed in clojure-mode, but I'm still seeing this. Perhaps because there was no recent release of clojure-mode?