Fork me on GitHub
#dirac
<
2018-05-04
>
Casey18:05:12

@darwin Is there a way to connect dirac to a node inspector web socket directly? I have a url that looks like this 127.0.0.1:7777/inspect/8380ad1ea17af8b

Casey18:05:42

i plopped that in the options url field.. but its not opening. Hm, wonder how i can get chrome extension error logs

Casey18:05:52

oh interesting.. the docs have a screenshot of the options UI and it has more options than mine does..

Casey18:05:25

Looks like its clipped? I can't resize or scroll in that dialog

darwin19:05:29

@ramblurr it is definitely clipped, btw. you’ve probably missed this document: https://github.com/binaryage/dirac/blob/master/docs/node.md

darwin19:05:04

not sure if it is still relevant, but at one point it worked with node (I don’t develop with node, so I didn’t test it recently)

Casey19:05:44

Thanks, yea, those node docs are where I found out about the "missing" (clipped) options. I just needed to pass extra url params.

Casey19:05:09

inspecting the extension options ui reveals a overflow: hidden class on the body that hides the scroll bar

Casey19:05:41

Those node docs don't mention anything about the Dirac Agent... is it not needed for node inspecting?

darwin19:05:33

it is needed as well as nREPL server

darwin19:05:17

it should be the same as with classic web dev

Casey19:05:09

awesome, used the sample "repl" profile and it works great

Casey19:05:18

confirmed it still works with node 🙂

Casey19:05:23

hm, so what's going on with the repl instance exactly? that's a full clojure jvm repl right?

darwin19:05:31

that clipped preferences window problem is probably related to size of your chrome window

Casey19:05:51

so when i type (+ 1 1) into the dirac repl in devtools .. is it being executed in jvm or in my cljs node context?

darwin19:05:04

I think those css styles come from chrome

darwin19:05:44

in your node, jvm just runs clojurescript which compiles cljs -> js, which is then executed

Casey19:05:20

cool, that makes sense

darwin19:05:47

try something like (js/console.log (js/process.platform))

darwin19:05:15

or process.release

Casey19:05:03

@darwin using the node demo project, i can't seem to get the source maps to work properly

Casey19:05:18

the http server serving the source maps is working (e.g., http://localhost:9988/.compiled/dirac_sample/demo.js.map)

Casey19:05:37

and chrome pops up a notification bar that says "Source maps detected"

Casey19:05:44

but I don't see the clojure code.. just the js

darwin20:05:08

I’m sorry I cannot assist with this right now, the problem could be very subtle

darwin20:05:48

it worked for me a year ago, but things could break or your setup has some issue

Casey20:05:53

no worries, thanks for the help and effort thus far

darwin20:05:21

it was meant to give people an easy workaround for node+dirac+devtools source map issues

darwin20:05:59

you might ask @richiardiandrea if he remembers the details, see his comment

richiardiandrea20:05:33

oh man, that was long ago, don't really remember the details...

Casey20:05:56

hm yea, the local webserver serving source maps is the workaround for that right?

Casey20:05:28

Ah that patch is also for inlined source maps, that would be handy

richiardiandrea20:05:03

yeah the inline side of source maps in cljs is only for self-host at the moment, there is no way to read them in iirc

Casey20:05:24

still though, i wonder why the source mapping url workaround isn't working in this case.

Casey20:05:21

ooh, using vanilla chrome devtools, the .cljs source is visible

Casey21:05:19

@richiardiandrea do you have any plans to re-submit that patch?

richiardiandrea21:05:28

I think it should be rebased, but core team did not seem to keen at the time

richiardiandrea21:05:45

maybe darwin can actually push that again

Casey21:05:43

from reading the node.js ticket on source maps, it seems the "right way" is via source map inlining

darwin21:05:59

it was a hairy code I completely lost context, that is why I’m not going to look at it again, I don’t really need it myself

Casey21:05:02

because there is some specific wonkiness with absolute urls

darwin21:05:06

feel free to jump on it 🙂

darwin21:05:33

it probably needs a simple rebase, but understanding and testing it is the difficult part

Casey21:05:53

maybe i can give it a go, haven't setup a cljs dev environment before

darwin21:05:05

you might try to rebase it and test it with custom cljs compiler build on your machine

darwin21:05:11

it will likely work