dirac 2017-02-18

@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 ?

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

dirac has custom formatters enabled by default

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

@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)

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

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

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

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

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

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

I thikn I'm going to do the following

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

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

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

it works now 🙂

by some miracle, got it working in boot too

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

@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.

@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

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

dirac repl is the most amazing thing ever

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

it's an amazing piece of software

thanks, I’m glad you like it

what ide/editor do you use for cljs dev ?

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

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

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

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

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

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

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

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

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

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

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 ?

and also maybe implement fuzzy mapping of urls to filesystem paths

actually, all the code is written

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" ?

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

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?

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

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

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

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

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

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