first day using Conjure on the job. it's awesome
When doing :ConjureShadowSelect dev
I get this:
; shadow-cljs (select): dev
; (err) Execution error (ClassNotFoundException) at java.net.URLClassLoader/findClass (URLClassLoader.java:471).
; (err) shadow.cljs.devtools.api
I read that as indicating that I'm missing shadow-cljs dependency somewhere, but I've got it in my deps.edn
(`thheller/shadow-cljs {:mvn/version "2.8.60"}`), and can (require '[shadow.cljs.devtools.api :as api])
it successfully.
shadow-cljs is running in a Docker container, if that's relevant.
Any idea why I can't connect to shadow-cljs's REPL with Conjure?Or maybe I'm doing something wrong. I'm doing this after I've connected to an nREPL, started with vim-jack-in's :Lein
.
Hmm I'm pretty sure you need to use the nREPL shadow starts?
Oh, OK. So do I need to :ConjureConnect
to shadow's nREPL port?
As described in here (although you've maybe already seen it?) https://github.com/Olical/conjure/wiki/Quick-start:-ClojureScript-(shadow-cljs)
Yep, I don't think you can use a regular lein nREPL with shadow as a dependency.
Although shadow-cljs may have docs on doing it this way.
Shadow select assumes you're connected to shadow-cljs' nREPL server.
If you start shadow-cljs and shutdown your lein server Conjure should automatically connect using the shadow-cljs portfile too.
Ah, OK. I think I misunderstood how it works (I'm not well versed in *-cljs)
Is the idea that I connect to shadow-cljs's nREPL and a Leiningen nREPL concurrently?
Will Conjure then switch between them based on the filename of the buffer I'm in?
Nope, you can only connect to one at a time at the moment unless you set up some autocmds to fire when you enter you clj / cljs directories to swap Conjure states as described here to some extent: https://github.com/Olical/conjure/blob/bcdaf3761b762dafb4314389d84294232dd61ed6/doc/conjure.txt#L69-L78
This issue may also be relevant https://github.com/Olical/conjure/issues/135
ConjureClientState
will allow you to create two parallel "states", one connected to a CLJS env and another connected to CLJ. It's up to you how you swap between them. I use autocmds that set the state to my cwd on dir change. That means I can :cd ...
into things and get a different connection per dir.
I'm sorry I don't have a smooth experience for working with two REPLs at the same time right now, the tools are there for it, but you have to roll your own experience a little since everyone has different expectations and requirements around this area. AFAIK there's no one size fits all solution, so I try to provide the building blocks anyone will need to suite their needs. I hope...
All good! I'm still just trying to figure out how the pieces should fit together 🙂