dirac

Dirac v1.7.2 is out: https://github.com/binaryage/dirac/releases/tag/v1.7.2
qqq 2017-03-04T23:07:33.003018Z

Is there version number inflation going on here? I'm still on 1.1.6 and this is 1.2.0 ๐Ÿ™‚

qqq 2017-03-04T23:07:57.003019Z

so in short: use

:external-config {:dirac.runtime/config {:nrepl-config {:reveal-url-script-path "scripts/reveal.sh" }}}
provide a reveal.sh shell script

2017-03-04T23:07:58.003020Z

this is a new feature ๐Ÿ™‚

qqq 2017-03-04T23:08:42.003021Z

alright, let me figure out how to test this out, as reveal.sh is running on REMOTE machine, and i need to force it back to LOCAL-MBP

2017-03-04T23:09:53.003022Z

you could use curl to do a HTTP post request and run with https://github.com/szarsti/chrome-emacsclient

qqq 2017-03-04T23:10:51.003024Z

well first things first, while you're here, I should get it so that reaveal.sh echoes the path

qqq 2017-03-04T23:10:54.003025Z

I can figure out emacs config later

2017-03-04T23:11:33.003026Z

non-zero exit status will be reported as a failure, output printed to stderr will appear in devtools console

2017-03-04T23:11:50.003027Z

you can use it for testing / debug printing

qqq 2017-03-04T23:16:13.003030Z

updated to 1.2.0;need to update build.boot can you briefly explain how https://github.com/binaryage/dirac-sample/blob/master/project.clj#L62 works ? the part that confuses me -- is how is it that "the script you should run on nrepl msg" a COMPILER option? it seems like something the dirac agetnt would control or something, yet it's emitted during COMPILE TIME? (weird since the compiler runs once, then it exists until next compile)

2017-03-04T23:18:00.003031Z

how do you think it should work better?

qqq 2017-03-04T23:19:32.003032Z

I don't know. The part that intuitively seems weird is (1) cljs compiler runs (2) cljs compiler exits (3) when this nrepl msg arrives, cljs compiler is most likely not running (4) yet, somehow this script was being called I guess if this was being controlled by figwhell or boot-repl, I'd be less surprised; but this is just my incorrect intuition.

2017-03-04T23:20:48.003033Z

I think we have some deep misunderstanding here

2017-03-04T23:20:53.003034Z

why should be cljs compiler running?

2017-03-04T23:21:16.003035Z

the scriptโ€™s responsibility is to open a file given an url, line and column as parameters

2017-03-04T23:21:30.003036Z

script location is compile-time configuration

2017-03-04T23:21:40.003037Z

because it does not change at runtime (dynamically)

2017-03-04T23:21:51.003038Z

it is project-specific

2017-03-04T23:22:28.003039Z

more specifically it is cljs-build-specific configuration

qqq 2017-03-04T23:22:40.003040Z

ah, I get it now

qqq 2017-03-04T23:22:42.003041Z

thanks ๐Ÿ™‚

2017-03-04T23:23:14.003042Z

that is why it is baked into runtime config, which configures nrepl-middleware for given REPL session

2017-03-04T23:23:41.003043Z

in theory you could change it even dynamically, but after each change you have to open a new REPL session

qqq 2017-03-04T23:23:57.003044Z

yeah, the nrepl is Handling it, not the compiler; the only reason it's in the compiler-options part is that

qqq 2017-03-04T23:24:04.003045Z

the COMPILER ias PASSING it to nrepl

qqq 2017-03-04T23:24:10.003046Z

my confusion was idiotic

2017-03-04T23:24:12.003047Z

or you can have have single project, but multiple cljs-builds and each using a diffent reveal script

2017-03-04T23:25:28.003048Z

cljs compiler bakes that :reveal-url-script-path into dirac.runtime.config, and dirac.runtime.config uses :nrepl-config to configure nREPL session on open

2017-03-04T23:26:42.003049Z

so you can have following situation nREPL server has a single nREPL dirac middleware, but multiple nREPL sessions to Dirac DevTools each configured with a different :reveal-url-script-path

2017-03-04T23:27:10.003050Z

I know this is complicated, but I cannot really make this simpler Iโ€™m afraid

2017-03-04T23:27:22.003051Z

this is how nREPL stuff works, it is very flexible, but also very confusing

qqq 2017-03-04T23:59:46.003053Z

I'll post a minimal build.boot once I get mine working