Fork me on GitHub
#dirac
<
2016-02-29
>
jbaiter00:02:35

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

darwin20:02:00

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

jbaiter21:02:07

nope, i haven't šŸ˜•

jbaiter21:02:50

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

darwin21:02:57

not by default

darwin21:02:02

you can enable it and try it there

darwin21:02:09

add :nrepl-port 7777

jbaiter21:02:12

that i will do, thank you!

darwin21:02:24

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

darwin21:02:46

lein repl can also connect and act as nREPL client

darwin21:02:17

see lein help repl

jbaiter21:02:42

ah, i have that already enabled

jbaiter21:02:54

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

darwin21:02:31

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

darwin21:02:44

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

darwin21:02:49

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

jbaiter21:02:13

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

darwin21:02:27

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

jbaiter21:02:31

i think for nrepl in clojurescript I need piggieback

jbaiter21:02:51

but dirac uses a custom forked version, i think

darwin21:02:55

ok, then follow piggieback + weasel docs

darwin21:02:25

yes, dirac uses slightly modified piggieback, but features were added, not removed šŸ˜‰

jbaiter21:02:44

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

darwin22:02:33

the thing is I donā€™t fully understand this nREPL/piggieback stuff šŸ˜ž

darwin22:02:12

reading piggieback and clojurescript core REPL sources is hard for me

jbaiter22:02:22

hehe, i'm with you

jbaiter22:02:00

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

darwin22:02:24

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

darwin22:02:48

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

darwin22:02:35

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

jbaiter22:02:37

precisely, leaky abstractions all over

jbaiter22:02:59

same with error messages

jbaiter22:02:17

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

darwin22:02:42

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

darwin22:02:01

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

jbaiter22:02:20

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

darwin22:02:05

did you add it to :nrepl-middleware?

jbaiter22:02:02

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

jbaiter22:02:14

it's in :dependencies, too

darwin22:02:31

do you use lein? what lein pprint says?

jbaiter22:02:10

pprint is not a task šŸ˜…

darwin22:02:28

ah, add lein-pprint plugin

darwin22:02:54

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

darwin22:02:17

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

darwin22:02:19

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

jbaiter22:02:18

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

jbaiter22:02:58

piggieback is in there, when i run the command

darwin22:02:45

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

darwin22:02:21

I think (require ā€˜cemerick.piggieback)

jbaiter22:02:45

hah, that works

darwin22:02:30

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?

jbaiter22:02:35

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

jbaiter22:02:44

when i add the require to the init code it works

darwin22:02:28

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

jbaiter22:02:33

i copy-pastaed the code from the sample repository

darwin22:02:33

and do it by hand

darwin22:02:02

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

darwin22:02:10

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

darwin22:02:15

line-by-line

darwin22:02:20

we will see where is the problem

jbaiter22:02:05

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

jbaiter22:02:29

yep, on the third line

jbaiter22:02:42

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

darwin22:02:51

wait Iā€™ve seen this error before

darwin22:02:00

I cannot recall when and where šŸ˜‰

darwin22:02:21

ah, it was clojure version

darwin22:02:27

letā€™s see

darwin22:02:09

that lein pprint command, what clojure version it displayed?

darwin22:02:35

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

darwin22:02:40

thatā€™s right

jbaiter22:02:50

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

jbaiter22:02:59

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

jbaiter22:02:07

but that was not the case

darwin22:02:09

try to add [org.clojure/tools.nrepl "0.2.12ā€] into deps

darwin22:02:23

ah, you have it there

darwin22:02:54

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

jbaiter22:02:46

i'm afraid i have to call it a day now šŸ˜•

jbaiter22:02:15

thanks for the help!

darwin22:02:26

ok, good night

jbaiter22:02:48

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

darwin22:02:49

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

jbaiter22:02:00

yeah, that is an excellent idea

darwin22:02:08

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

darwin22:02:32

and let us know how it went simple_smile