dirac

Dirac v1.7.2 is out: https://github.com/binaryage/dirac/releases/tag/v1.7.2
jrheard 2016-09-14T23:20:33.000290Z

hi - i'm trying to set up dirac for my project, and am having a difficult time

jrheard 2016-09-14T23:20:38.000291Z

i'm using cursive and figwheel

2016-09-14T23:21:01.000292Z

go ahead...

jrheard 2016-09-14T23:21:09.000293Z

i followed the instructions in https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL to get figwheel+cursive to play together

jrheard 2016-09-14T23:21:13.000295Z

and that's been working fine

jrheard 2016-09-14T23:21:24.000296Z

but when i apply this diff to my project.clj: http://pastebin.com/NsF4RSR6

jrheard 2016-09-14T23:22:02.000298Z

i get this error message when trying to start my app via cursive: http://pastebin.com/2AbcdtDU

jrheard 2016-09-14T23:22:25.000300Z

"Could not locate org/httpkit/server__init.class or org/httpkit/server.clj on classpath., compiling:(figwheel_sidecar/components/figwheel_server.clj:1:1)" is probably the relevant bit

jrheard 2016-09-14T23:22:33.000301Z

but i'm kinda in over my head here

jrheard 2016-09-14T23:22:47.000302Z

am i doing something completely wrong?

2016-09-14T23:23:27.000303Z

"trying to start my app via cursive” and idea what exact lein command it is issuing?

jrheard 2016-09-14T23:23:28.000304Z

the rest of the project.clj is here, if that's helpful: https://github.com/jrheard/voke/blob/ai/project.clj

jrheard 2016-09-14T23:23:31.000306Z

good question, sec

jrheard 2016-09-14T23:24:08.000307Z

i'm not sure actually, will dig around a bit

2016-09-14T23:24:24.000308Z

this looks to me that some dependencies clashed, we could investigate it via lein deps :tree

2016-09-14T23:24:37.000309Z

but you would have to run it in the same context like cursive does

2016-09-14T23:24:47.000310Z

which may include some cursive stuff

jrheard 2016-09-14T23:25:08.000311Z

if i'm interpreting this right, i think cursive doesn't use leiningen here, and instead runs https://github.com/jrheard/voke/blob/ai/script/repl.clj directly

2016-09-14T23:25:09.000313Z

I’ve seen cursive “injecting” crazy stuff, to do REPL completions and similar

jrheard 2016-09-14T23:25:23.000314Z

i've got it set up to do that as per that figwheel wiki page i linked earlier

jrheard 2016-09-14T23:25:55.000315Z

gonna reread that error message...

2016-09-14T23:26:28.000316Z

next step would be to run the script from command-line without cursive and reproducing the same error

2016-09-14T23:26:34.000317Z

so we can rule cursive out

jrheard 2016-09-14T23:26:57.000318Z

good idea, will do

2016-09-14T23:27:10.000319Z

I’m not sure how that script gets classpath setup, is it something cursive figures out from project.clj on its own?

2016-09-14T23:27:33.000320Z

if cursive does some classpath magic, we won’t be able to reproduce it easily from command-line

jrheard 2016-09-14T23:28:20.000321Z

unclear - here's what the configuration UI for this looks like, again as per that wiki page: https://www.evernote.com/shard/s11/sh/c6f6f7bf-4b07-44fb-9751-231d3f8a7634/6edb409220d70bf2

jrheard 2016-09-14T23:28:44.000323Z

maybe i should be asking this in #cursive instead? unclear if this is dirac's fault or not

2016-09-14T23:28:59.000324Z

try to add to print current classpath in the script: https://github.com/binaryage/cljs-oops/blob/master/test/src/tools/oops/tools.clj#L14-L15

jrheard 2016-09-14T23:29:03.000326Z

nice, will do

2016-09-14T23:29:41.000327Z

I’m going to read the article

jrheard 2016-09-14T23:29:57.000328Z

thanks a ton!

jrheard 2016-09-14T23:31:00.000329Z

it prints out http://pastebin.com/hPPtcCKP

jrheard 2016-09-14T23:31:30.000331Z

adding a few more printlns to see what specific line's falling over

2016-09-14T23:31:58.000332Z

not seeing httpkit there

2016-09-14T23:32:11.000333Z

try to add it to your deps: http://www.http-kit.org/

👍 1
jrheard 2016-09-14T23:32:19.000335Z

looks like it's the first line, (use 'figwheel-sidecar.repl-api)

jrheard 2016-09-14T23:32:21.000336Z

cool, will do

2016-09-14T23:33:51.000339Z

it should have been picked by https://github.com/jrheard/voke/blob/ai/project.clj#L11

2016-09-14T23:34:11.000341Z

I’m Java noob, not sure how maven works

jrheard 2016-09-14T23:34:47.000342Z

i'm also a java noob 😄

jrheard 2016-09-14T23:34:49.000343Z

adding http-kit to my deps seems to have solved the problem!

jrheard 2016-09-14T23:34:59.000344Z

i'll poke around and try to understand why that's necessary

jrheard 2016-09-14T23:35:14.000345Z

i think there's a chance my machine's in a bad state, dropbox got mad a few days ago and modified / rolled back a bunch of my files

jrheard 2016-09-14T23:35:24.000346Z

i'll nuke this dir from orbit and try messing with a clean checkout

jrheard 2016-09-14T23:35:30.000347Z

thanks for your help! looking forward to using your tool! 😄

2016-09-14T23:35:57.000348Z

maybe now we should ask question why you need this setup in the first place, if you wan to work with dirac under cursive, you should follow: https://github.com/binaryage/dirac/blob/master/docs/integration.md

jrheard 2016-09-14T23:36:13.000350Z

nice, hadn't seen this

2016-09-14T23:36:46.000351Z

I use figwheel only for hot-reloading, and I leave REPL functionality to Dirac

jrheard 2016-09-14T23:37:11.000352Z

yeah, that's what i want as well - do i not need the stuff from that figwheel wiki page any more?

2016-09-14T23:37:29.000353Z

I believe no

jrheard 2016-09-14T23:37:33.000354Z

nice

jrheard 2016-09-14T23:37:56.000355Z

at what point does figwheel's auto-reloading get set up, then? my mental model around all of these tools is extremely hazy

2016-09-14T23:38:14.000356Z

I know, it is complex and in flux

jrheard 2016-09-14T23:38:17.000357Z

😄

2016-09-14T23:38:50.000358Z

hot-reloading is basic feature (I don’t know if it can be disabled)

jrheard 2016-09-14T23:39:10.000359Z

cool, i'll poke around and see what works / see if i can figure out how all this fits together

2016-09-14T23:39:24.000360Z

all the REPL stuff is just extra stuff, which can be disabled, you did that by :repl false

jrheard 2016-09-14T23:39:29.000361Z

excellent

jrheard 2016-09-14T23:39:39.000362Z

that integration.md looks very useful, and i'm not seeing a giant stacktrace any more, so i'm happy 😄

jrheard 2016-09-14T23:39:47.000363Z

thanks again!

2016-09-14T23:39:53.000364Z

np, good luck

2016-09-14T23:39:58.000365Z

but first follow: https://github.com/binaryage/dirac/blob/master/docs/installation.md

jrheard 2016-09-14T23:40:12.000367Z

yup, was working through that when i ran into this stack trace

2016-09-14T23:40:13.000368Z

you have to get nREPL + Dirac Agent running

2016-09-14T23:40:24.000369Z

then you can try to connect Cursive to the same nREPL server

2016-09-14T23:40:37.000370Z

and then "join Dirac session” in the browser

2016-09-14T23:40:56.000371Z

this all has nothing to do with figwheel

jrheard 2016-09-14T23:41:06.000372Z

gotcha - so i'll start by just using lein repl from the command-line, and will deal with cursive integration once i'm done with installation.md

2016-09-14T23:41:09.000373Z

it is orthogonal (assuming figwheels REPL/nREPL is disabled)

jrheard 2016-09-14T23:41:12.000374Z

nice

2016-09-14T23:41:22.000375Z

correct

👍 1
2016-09-14T23:42:00.000376Z

that :repl-options config applies to your nREPL server launched by lein repl

2016-09-14T23:42:38.000377Z

not sure if cursive can see it and make sense of it, I don’t think so, you just configure cursive’s nREPL client via UI dialog

jrheard 2016-09-14T23:42:47.000378Z

gotcha

jrheard 2016-09-14T23:59:13.000379Z

ok, so i've followed the instructions in installation.md, and lein repl gives encouraging-looking output (connected to nrepl server, agent is accepting connections) - but when i load up my app via chrome canary and click on the dirac button, i see:

jrheard 2016-09-14T23:59:15.000380Z

Dirac requires runtime support from your app. Please install Dirac Runtime into your app and enable the :repl feature. ReferenceError: dirac is not defined at <anonymous>:1:1

jrheard 2016-09-14T23:59:27.000381Z

my project.clj looks like this - have i done something wrong? https://github.com/jrheard/voke/blob/ai/project.clj#L36