dirac

Dirac v1.7.2 is out: https://github.com/binaryage/dirac/releases/tag/v1.7.2
qqq 2017-02-18T13:10:02.002264Z

@pepe: using tenzing, are you able to replicate the screen shot of: https://camo.githubusercontent.com/ebbe18501d26873485014d421285aa4de062a3f2/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f3535393034372f64697261632d6d61696e2d30312e706e67 ? In particular, for showing the three varaibles count/numbers/number inline in the source code, it shows numbers as (1 2 3) -- which is amazing, since it shows it as the CLJS form rather than the JS data structure I can't get this part to work in tenzing --- are you able to get this to work in tenzing ?

2017-02-18T13:25:15.002266Z

@qqq you have to properly install cljs-devtools into your project

2017-02-18T13:25:25.002267Z

dirac has custom formatters enabled by default

2017-02-18T13:25:41.002268Z

under normal stock chrome you would have to enable it in devtools preferences

qqq 2017-02-18T13:28:20.002271Z

@darwin: I have tried the following in both latest Chrome and Canary 1) I have enabled "custom formatters" under settings 2) the rest of the docs seems to be stuff configured inside of boot (which tenzing should already do)

qqq 2017-02-18T13:28:30.002272Z

@darwin: do you have these "custom formatters" working ?

2017-02-18T13:29:40.002273Z

I cannot really help you with boot/tenzing, but https://github.com/binaryage/cljs-devtools-sample has properly configured example project which should work for you

2017-02-18T13:30:34.002275Z

in your devtools console, when you visit your project page - you should see “Installing CLJS DevTools…" message

qqq 2017-02-18T13:30:51.002276Z

no, I don't see that msgs, I only see the installing Dirac msg

qqq 2017-02-18T13:31:07.002277Z

That project is lein and I use boot, but I'm so despearte I'm going to try it

2017-02-18T13:32:13.002278Z

what version of clojurescript do you use? maybe tenzing uses :preloads feature, which is pretty recent and silently “does not work” in older clojurescript versions

qqq 2017-02-18T13:32:44.002279Z

1.9.473

2017-02-18T13:33:02.002280Z

ok, that is good one, anyways, you can always manually call devtools/install!: https://github.com/binaryage/cljs-devtools/blob/master/docs/installation.md#install-it-manually

qqq 2017-02-18T13:33:19.002282Z

I thikn I'm going to do the following

qqq 2017-02-18T13:33:25.002283Z

(1) I'm going to clone taht repo and get it working

qqq 2017-02-18T13:33:32.002284Z

(2) onceI hae something working, I can start converting it to boot

qqq 2017-02-18T13:33:41.002285Z

until I have something working, I'm just stabbing in the dark

2017-02-18T13:35:06.002286Z

good luck

qqq 2017-02-18T13:38:28.002287Z

YAY

qqq 2017-02-18T13:38:30.002288Z

it works now 🙂

qqq 2017-02-18T13:54:18.002289Z

ha!

qqq 2017-02-18T13:54:22.002290Z

by some miracle, got it working in boot too

qqq 2017-02-18T13:54:29.002291Z

I have no idea how it works or why it works, but it works 🙂

richiardiandrea 2017-02-18T17:22:56.002292Z

@qqq for boot in general there is powerlaces/oot-cljs-devtools works out of the box (unless there is a new bug that it would be great to have reported). The lib provides two tasks. One is for Dirac standalone.

qqq 2017-02-18T20:04:36.002295Z

@richiardiandrea : no longer convinced there was actually a bug -- just I was doing alot of things wrong since this was first time getting dirac to actually work

richiardiandrea 2017-02-18T20:05:26.002296Z

Cool yes that is a setup hard to get right the first but fortunately Darwin has a lot of patience 😀

qqq 2017-02-18T23:09:14.002297Z

dirac repl is the most amazing thing ever

qqq 2017-02-18T23:09:16.002298Z

this is insane

qqq 2017-02-18T23:41:11.002299Z

@darwin: sure, moved

qqq 2017-02-18T23:41:25.002300Z

1) thanks for your time for discussion and 2) thanks for writing dirac

qqq 2017-02-18T23:41:28.002301Z

it's an amazing piece of software

2017-02-18T23:41:53.002302Z

thanks, I’m glad you like it

qqq 2017-02-18T23:41:54.002303Z

what ide/editor do you use for cljs dev ?

2017-02-18T23:41:58.002304Z

cursive

qqq 2017-02-18T23:42:54.002305Z

I guess what I really want isn't even an dirac issue.

qqq 2017-02-18T23:43:02.002306Z

It's more a "get chrome to use emacs when opening *.cljs files" issue

qqq 2017-02-18T23:43:54.002307Z

yeah, https://github.com/szarsti/chrome-emacsclient would agree that it's a issue seprate from dirac

2017-02-18T23:45:42.002310Z

interesting

qqq 2017-02-18T23:47:32.002311Z

if I were greedy, the optimal work flow would be: 1) write code in emacs 2) on save, boot recompiles + reloads 3) we hit some (assert false) in the browser 4) dirac/cljs dev tools already know fname / line number ===== 5) this gets passed back to emacs, which jumps me to file / line #google-cloud 6) I continue being able to explore stack farmes / local variables in the dirac dev tools and basically all that's missing is step 5

2017-02-18T23:48:40.002312Z

yes, I see your point. I used to have something like this working back in old times when working on windows with firebug 🙂

2017-02-18T23:49:13.002313Z

figwheel supports something like this as well (clicking file links in their HUD display)

qqq 2017-02-18T23:49:42.002314Z

the really insane solution (which is far fare removed from dirac) would be to hack devtools / emacs so that emacas renders INSIDE devtools 🙂

qqq 2017-02-18T23:50:05.002315Z

so whatever devtools uses to show source files would be repalced with an emacsclient embedded

2017-02-18T23:50:05.002316Z

I can definitely add some resource handlers into dirac, it looks simple: https://github.com/szarsti/chrome-emacsclient/blob/master/devtools.js

2017-02-18T23:50:39.002318Z

but the problem is that I’m not going to maintain/support emacs side of the functionality

qqq 2017-02-18T23:52:51.002319Z

kind of hard if you're using cursive if I were to write the emacs side, what would I have to do? I would have to (1) get elisp to run a http server with a REST end point, then (2) when the user clicks, dirac sends me a REST request, which (3) I then parse and load the right file / line in emacs ?

2017-02-18T23:54:45.002320Z

I think you would have to do this: https://github.com/szarsti/chrome-emacsclient/blob/master/chromeserv.el

2017-02-18T23:55:05.002322Z

and also maybe implement fuzzy mapping of urls to filesystem paths

qqq 2017-02-18T23:55:48.002323Z

actually, all the code is written

qqq 2017-02-18T23:56:07.002324Z

I just have to fork that project, then hack on the part which is "diff between how (1) that project tells emacs to open files and (2) how dirac tells emacs to open files" ?

2017-02-18T23:56:59.002325Z

dirac can easily do this, as I wrote above: https://github.com/szarsti/chrome-emacsclient/blob/master/devtools.js

qqq 2017-02-18T23:57:39.002326Z

okay, let me look at this some more and get back to you; I think I'm wasting your time as I'm missing some fundamentals

qqq 2017-02-18T23:58:00.002327Z

but in short, if I can get the emacs side working, it's like 5-min job for you to setup the dirac side right?

2017-02-18T23:58:20.002328Z

just be aware that you will get resource urls + line numbers, you have to somehow map them back to filesystem

2017-02-18T23:58:41.002329Z

in complex scenario this could require some kind of user-definned mapping, to resolve correctly

qqq 2017-02-18T23:58:57.002330Z

oh this is fine, the user is required to specify "active project"

qqq 2017-02-18T23:59:09.002331Z

no fuzzy matching required, user is required to specify the location of /src

qqq 2017-02-18T23:59:20.002332Z

then I just map module name of foo.bar.dog to src/foo/bar/dog.cljs

2017-02-18T23:59:50.002333Z

ok, but you assume something about user’s project structure