Fork me on GitHub
#dirac
<
2016-03-13
>
bpicolo21:03:54

Hi friends. How does one get dirac running with figwheel?

darwin21:03:27

Hi, dirac and figwheel are orthogonal, you can use them independently I believe

bpicolo21:03:59

Well, figwheel runs an nRepl

bpicolo21:03:14

Shouldn't I need dirac to target the same repl?

bpicolo21:03:20

Or something

bpicolo21:03:27

(Am clojure newbie)

darwin21:03:08

well this would be quite advanced setup, I think you can use figwheel independently as a starting point and then maybe try to integrate them both

darwin21:03:45

getting figwheel to start nREPL server is alone quite advanced adventure

bpicolo21:03:07

it seems to have options for it now

darwin21:03:09

but I would be curious if dirac could connect to nREPL server created by figwheel

bpicolo21:03:39

running two entirely different application instances to debug sounds dreadful

darwin21:03:36

maybe you can do what they propose, start nREPL server via lein repl and then start figwheel from within that nREPL server, and dirac too

darwin21:03:19

I’m not sure, its been a month or two I last saw those nREPL-piggieback-weasel-stuff and I don’t remember details

darwin21:03:33

it is really advanced stuff unfortunately

bpicolo21:03:37

is there a decent strategy to debug other than dirac?

bpicolo21:03:44

E.g. how can one just set breakpoints

darwin21:03:12

well, debugging clojurescript can be done in standard devtools using source maps

darwin21:03:38

dirac just gives you ability to eval clojurescript on paused breakpoint

bpicolo21:03:49

chrome isn't thrilled to to set breakpoints on clojure code

darwin21:03:54

that is something 99% cljs developers can live without

darwin21:03:05

I usually tend to do a lot of debug printing using cljs-devtools, and sometimes put (js-debugger) around, if I cannot set a breakpoint from UI

bpicolo21:03:20

maybe my only problem is that dirac.agent namespace is missing

bpicolo21:03:32

darwin: maybe cljs-devtools is what I'm missing moreso

bpicolo21:03:47

the readme is pretty empty

darwin21:03:02

btw. you can use cljs-devtools without dirac, that should be your first step if you are new to cljs dev

bpicolo21:03:21

where does (js-debugger) come from. is that built in?

darwin21:03:22

dirac is really for more advanced projects when you get familiar with tooling

bpicolo21:03:40

ehh, i mean I don't agree that having good debugging tools is limited to advanced projects : P

darwin21:03:48

(js-debugger) compiles to debugger; javascript statement, it is built-in cljs.core

darwin21:03:21

(js* “debugger;”) would emit the same code I believe

bpicolo21:03:23

well, at least I wont have to run a custom chrome to do that too : P

darwin21:03:04

not anymore, but we had to wait 6+ months for it to appear in stable chrome simple_smile

darwin21:03:22

my recommendation: start with cljs-devtools + figwheel, use figwheel’s standard REPL (it is not nREPL)

bpicolo21:03:59

how do I then deal with name mangling at break points

darwin21:03:03

later when you iron out your project needs, maybe stop using figwheel’s REPL, start own nREPL server, run figwheel from withing that nREPL server

darwin21:03:24

and maybe later, setup dirac agent to connect to that nREPL server

darwin21:03:31

ad name mangling, in dev mode (:optimizations :none) the names are not mangled

darwin21:03:45

just decorated slightly when javascript does not allow certain characters

bpicolo21:03:49

thought that was on by default

darwin21:03:16

neither cljs-devtools nor figwheel support advanced builds