Fork me on GitHub
#conjure
<
2020-11-24
>
ambrosebs04:11:52

first day using Conjure on the job. it's awesome

🚀 15
walterl16:11:06

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?

walterl16:11:33

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.

Olical16:11:25

Hmm I'm pretty sure you need to use the nREPL shadow starts?

walterl16:11:15

Oh, OK. So do I need to :ConjureConnect to shadow's nREPL port?

Olical16:11:21

As described in here (although you've maybe already seen it?) https://github.com/Olical/conjure/wiki/Quick-start:-ClojureScript-(shadow-cljs)

Olical16:11:39

Yep, I don't think you can use a regular lein nREPL with shadow as a dependency.

Olical16:11:48

Although shadow-cljs may have docs on doing it this way.

Olical16:11:00

Shadow select assumes you're connected to shadow-cljs' nREPL server.

walterl16:11:28

Ah, OK. I think I misunderstood how it works (I'm not well versed in *-cljs)

Olical16:11:18

If you start shadow-cljs and shutdown your lein server Conjure should automatically connect using the shadow-cljs portfile too.

walterl17:11:31

Is the idea that I connect to shadow-cljs's nREPL and a Leiningen nREPL concurrently?

walterl17:11:32

Will Conjure then switch between them based on the filename of the buffer I'm in?

Olical17:11:56

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

Olical17:11:25

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.

Olical17:11:16

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...

walterl17:11:17

All good! I'm still just trying to figure out how the pieces should fit together 🙂