dirac

Dirac v1.7.2 is out: https://github.com/binaryage/dirac/releases/tag/v1.7.2
2016-02-29T00:07:35.000151Z

ah, it works for dependencies in both, it's just my project's namespaces that I can't seem to require

2016-02-29T20:59:00.000152Z

@jbaiter: have you resolved that require problem? I believe this is nREPL thing, dirac just uses standard nREPL connection

2016-02-29T21:53:07.000153Z

nope, i haven't 😕

2016-02-29T21:53:50.000154Z

the standard figwheel cljs repl doesn't use nrepl, right?

2016-02-29T21:53:57.000155Z

not by default

2016-02-29T21:54:02.000156Z

you can enable it and try it there

2016-02-29T21:54:09.000157Z

add :nrepl-port 7777

2016-02-29T21:54:12.000158Z

that i will do, thank you!

2016-02-29T21:54:24.000159Z

and connect to it from Cursive or some other nREPL-enabled client

2016-02-29T21:54:46.000160Z

lein repl can also connect and act as nREPL client

2016-02-29T21:55:17.000161Z

see lein help repl

2016-02-29T21:55:42.000162Z

ah, i have that already enabled

2016-02-29T21:55:54.000164Z

but when I connect to the port I get a standard clojure/jvm repl

2016-02-29T21:56:31.000165Z

hmm, figwheel has some docs how to enter cljs repl via nREPL I think

2016-02-29T21:57:44.000168Z

(use 'figwheel-sidecar.repl-api) and `(start-figwheel!)

2016-02-29T21:57:49.000169Z

(use 'figwheel-sidecar.repl-api) and (start-figwheel!)

2016-02-29T21:58:13.000170Z

yup, that launches the regular figwheel repl that you get with lein figwheel, though

2016-02-29T21:58:27.000171Z

but maybe this is not what we want, we should try to start standard piggieback

2016-02-29T21:58:30.000172Z

right

2016-02-29T21:58:31.000173Z

i think for nrepl in clojurescript I need piggieback

2016-02-29T21:58:51.000174Z

but dirac uses a custom forked version, i think

2016-02-29T21:58:55.000175Z

ok, then follow piggieback + weasel docs

2016-02-29T21:59:00.000176Z

will do :simple_smile:

2016-02-29T21:59:25.000177Z

yes, dirac uses slightly modified piggieback, but features were added, not removed 😉

2016-02-29T21:59:44.000178Z

thanks for the work, btw, i *really* appreciate dirac and the custom formatters

2016-02-29T21:59:53.000179Z

thanks

2016-02-29T22:00:33.000180Z

the thing is I don’t fully understand this nREPL/piggieback stuff 😞

2016-02-29T22:01:12.000181Z

reading piggieback and clojurescript core REPL sources is hard for me

2016-02-29T22:10:22.000182Z

hehe, i'm with you

2016-02-29T22:11:00.000183Z

i find getting to grips with all of the tooling the hardest part about clojure/cljs

2016-02-29T22:12:24.000184Z

indeed, unfortunately I don’t see an easy way to fix this problem :simple_smile: too many moving parts and we are building on top of “foreign” platforms

2016-02-29T22:12:48.000185Z

whole lein/boot stuff has java legacy, and cljs stuff must respect underlying javascript ecosystem

2016-02-29T22:13:35.000186Z

it is nice when it works, but when something breaks in the platform below, it is too hard for most people to deal with it

2016-02-29T22:13:37.000187Z

precisely, leaky abstractions all over

2016-02-29T22:13:59.000189Z

same with error messages

2016-02-29T22:14:17.000190Z

it's really a testament to the language that i enjoy it as much as i do .)

2016-02-29T22:14:42.000191Z

well, some class of error messages is fixable (language-level errors/warnings)

2016-02-29T22:15:01.000192Z

some class of runtime errors from underlying platform is not fixable IMO

2016-02-29T22:15:20.000193Z

i think i'll leave that piggieback stuff be for tonight, ClassNotFoundException for piggieback, even though its in my classpath and in the dependencies

2016-02-29T22:16:05.000194Z

did you add it to :nrepl-middleware?

2016-02-29T22:17:02.000196Z

yep, tried it both in symbolic and string form, both times class not found

2016-02-29T22:17:14.000197Z

it's in :dependencies, too

2016-02-29T22:17:14.000198Z

hm, weird

2016-02-29T22:17:31.000199Z

do you use lein? what lein pprint says?

2016-02-29T22:18:10.000201Z

pprint is not a task 😅

2016-02-29T22:18:28.000202Z

ah, add lein-pprint plugin

2016-02-29T22:18:54.000203Z

I have it in ~/.lein/profiles.clj

2016-02-29T22:19:17.000204Z

we want to see lein with-profile project/dev pprint :dependencies

2016-02-29T22:20:19.000205Z

wonder why you are adding [org.clojure/clojurescript "1.7.228”] into :plugins, that cannot work

2016-02-29T22:21:18.000206Z

tbh, most of the stuff in there is from the luminus template

2016-02-29T22:21:58.000207Z

piggieback is in there, when i run the command

2016-02-29T22:23:45.000208Z

so that ClassNotFoundException is raised from some init code? what if you try to require it directly from repl

2016-02-29T22:24:21.000209Z

I think (require ‘cemerick.piggieback)

2016-02-29T22:25:45.000210Z

hah, that works

2016-02-29T22:26:30.000211Z

so it is on class path, some code somewhere is trying to require something and raises ClassNotFoundException, can you investigate what code is responsible for it?

2016-02-29T22:27:35.000212Z

i think it's the anonymous function bound to start-repl

2016-02-29T22:27:44.000213Z

when i add the require to the init code it works

2016-02-29T22:28:28.000214Z

comment out that whole :init stuff in :repl-options

2016-02-29T22:28:33.000215Z

i copy-pastaed the code from the sample repository

2016-02-29T22:28:33.000216Z

and do it by hand

2016-02-29T22:29:02.000217Z

when your repl starts, boot your cljs.repl one command a time

2016-02-29T22:30:10.000218Z

(require 'cemerick.piggieback) (require 'weasel.repl.websocket) (cemerick.piggieback/cljs-repl (weasel.repl.websocket/repl-env :ip "0.0.0.0" :port 9001))

2016-02-29T22:30:15.000219Z

line-by-line

2016-02-29T22:30:20.000220Z

we will see where is the problem

2016-02-29T22:32:05.000223Z

IllegalStateException Can't change/establish root binding of: *cljs-repl-env*

2016-02-29T22:32:23.000224Z

3rd line?

2016-02-29T22:32:29.000225Z

yep, on the third line

2016-02-29T22:32:42.000226Z

wait a sec, I have figwheel running in the baackground, maybe that has something to do with it

2016-02-29T22:33:15.000227Z

mh, nope

2016-02-29T22:33:51.000228Z

wait I’ve seen this error before

2016-02-29T22:34:00.000229Z

I cannot recall when and where 😉

2016-02-29T22:34:21.000230Z

ah, it was clojure version

2016-02-29T22:34:27.000231Z

let’s see

2016-02-29T22:35:09.000232Z

that lein pprint command, what clojure version it displayed?

2016-02-29T22:35:34.000233Z

1.8.0

2016-02-29T22:35:35.000234Z

I see that you have 1.8.0, but it could be overriden by something else I guess

2016-02-29T22:35:36.000235Z

ok

2016-02-29T22:35:40.000236Z

that’s right

2016-02-29T22:35:50.000237Z

i found some issues on github, but those refer to piggieback 0.1

2016-02-29T22:36:22.000238Z

hah

2016-02-29T22:36:43.000239Z

ah, no

2016-02-29T22:36:59.000240Z

i thought i had an indentation error and :repl-options ended up inside of :cljjsbuild

2016-02-29T22:37:07.000241Z

but that was not the case

2016-02-29T22:37:09.000242Z

try to add [org.clojure/tools.nrepl "0.2.12”] into deps

2016-02-29T22:37:23.000243Z

ah, you have it there

2016-02-29T22:38:54.000244Z

try to comment out :main from the project.clj, line #44

2016-02-29T22:39:22.000245Z

nope

2016-02-29T22:39:46.000246Z

i'm afraid i have to call it a day now 😕

2016-02-29T22:40:15.000247Z

thanks for the help!

2016-02-29T22:40:26.000248Z

ok, good night

2016-02-29T22:40:48.000249Z

maybe a set of fresh eyes tomorrow morning will bring the solution .)

2016-02-29T22:40:49.000250Z

I think you will have to start commenting out pieces of that project.clj, it is pretty complex

2016-02-29T22:41:00.000251Z

yeah, that is an excellent idea

2016-02-29T22:41:08.000252Z

or maybe write a minimal one from scratch, just for repl

2016-02-29T22:41:20.000253Z

gn

2016-02-29T22:41:29.000254Z

you too!

2016-02-29T22:41:32.000255Z

and let us know how it went :simple_smile:

2016-02-29T22:41:38.000256Z

will do!