dirac

Dirac v1.7.2 is out: https://github.com/binaryage/dirac/releases/tag/v1.7.2
superstructor 2016-05-06T00:02:42.000142Z

clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: No such var: string/index-of, compiling:(dirac/nrepl/sessions.clj:149:14)
I think this requires Clojure 1.8 ? Will upgrade now.

2016-05-06T00:09:42.000144Z

Ah okay. I guess I was confused by the terminology.

2016-05-06T00:09:50.000145Z

Sweet. I can connect to the repl via boot.

2016-05-06T00:12:17.000146Z

@superstructor: ah, didn’t know that index-of is 1.8+, it is definitely something which could be written a different way

2016-05-06T00:24:54.000147Z

Sweet. Looks like it’s all working fine. I can connect to the repl via boot repl and emacs. 😄

2016-05-06T00:25:44.000148Z

cool!

2016-05-06T00:26:48.000149Z

currently only two middleware commands are implemented on Dirac’s side “eval” and “load-file”, I’m not sure if IDEs use anything beyond that

2016-05-06T00:27:35.000150Z

if you ever see “Received unrecognized forwarded nREPL message”, I have to look into that scenario: https://github.com/binaryage/dirac/blob/master/src/implant/dirac/implant/intercom.cljs#L279

superstructor 2016-05-06T00:29:03.000152Z

Upgraded to Clojure 1.8 and Boot 2.5.5, put the following in my deps:

[binaryage/devtools "0.6.1" :scope "test"]
                  [binaryage/dirac "0.3.0" :scope "test"]
                  [jupl/boot-cljs-devtools "0.1.0" :scope "test”]
I see that everything gets started in the output of my task; e.g.
nREPL server started on port 8230 on host 127.0.0.1 - <nrepl://127.0.0.1:8230>
Adding :require [devtools.core dirac.runtime] and :init-fns [devtools.core/install! dirac.runtime/install!] to test.cljs.edn...
Adding :require [devtools.core dirac.runtime] and :init-fns [devtools.core/install! dirac.runtime/install!] to main.cljs.edn…
Dirac Agent v0.3.0
Connected to nREPL server at <nrepl://localhost:8230>.
Tunnel is accepting connections at <ws://localhost:8231>.
Then I load the browser page and get in the Dirac v0.3.0 extension:
Installing Dirac Runtime v0.3.0 and enabling features :repl
core.cljs:49 Installing CLJS DevTools v0.6.1 and enabling features :custom-formatters :sanity-hints
client.cljs:49 Reload websocket connected.
But then if I type any ClojureScript the syntax is not recognised, its attempting to parse it as JavaScript. Any idea what is missing ?

2016-05-06T00:29:09.000153Z

Yeah I’m seeing that quite a bit.

2016-05-06T00:29:49.000154Z

@superstructor: Once you connect to the repl @port 8230.

2016-05-06T00:29:59.000155Z

Enter the command (dirac! :join)

2016-05-06T00:30:11.000156Z

@superstructor: you have to switch to Dirac REPL prompt by PageUp or PageDown in JS console

2016-05-06T00:30:36.000157Z

Oh that.

2016-05-06T00:30:48.000158Z

That’s something I’m going to add to the documentation.

2016-05-06T00:30:50.000159Z

this should be documented better, it is now just mentioned once in dirac-sample walkthrough

superstructor 2016-05-06T00:31:31.000160Z

ah nice! sorry didn’t know that. So Chrome REPL is working now. Cursive won’t connect yet, hangs after

Connecting to remote nREPL server...
Clojure 1.8.0
checking to see if I missed anything

2016-05-06T00:32:24.000161Z

@superstructor: If you want to test if you can connect to the nREPL, you can run this command in the command line: boot repl -c -p 8230

2016-05-06T00:32:43.000162Z

If you cannot connect to that then there is something going on.

superstructor 2016-05-06T00:34:40.000163Z

$ boot repl -c -p 8230                                            
Implicit target dir is deprecated, please use the target task instead.
Set BOOT_EMIT_TARGET=no to disable implicit target dir.
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_51-b16
&lt;help cut&gt;
boot.user=&gt; (dirac! :version)
Dirac nREPL middleware v0.3.0.

boot.user=&gt; (dirac! :join)
Your session joined Dirac (ClojureScript). The specific target Dirac session will be determined dynamically according to current matching strategy.
Listing Dirac sessions which are "most recent Dirac session":
  * unidentified|<http://localhost:4242/>|Chrome/52.0.2725.0|Mac/10.11.4 [17434885-6abf-4120-9e68-8e61ffa523c3]
To quit, type: :cljs/quit

boot.user=&gt; (type js/window)
#object[Window "function Window() { [native code] }”]

superstructor 2016-05-06T00:34:59.000164Z

looks like thats good. thanks. so Cursive refuses to connect for some reason.

superstructor 2016-05-06T00:39:41.000166Z

hooray got it working! thanks @darwin @jupl, not sure why it wasn’t connecting initially.

👏 2
2016-05-06T00:41:58.000167Z

btw. that “unindetified” tag is because I wrote support for detecting project names only for leiningen projects if there is some way how to read boot project name, patches welcome: https://github.com/binaryage/dirac/blob/master/src/runtime/dirac/runtime/prefs.clj#L4

2016-05-06T00:45:17.000170Z

Hmm. I’m not aware that there is a required argument like that for Boot projects.

2016-05-06T00:45:35.000171Z

maybe we could read root folder name

2016-05-06T00:46:00.000173Z

@darwin I was just thinking that.

2016-05-06T00:46:36.000174Z

I think that would be a great option.

2016-05-06T00:48:17.000175Z

you can also call (dirac.runtime/set-pref! :runtime-tag “something”) prior calling (dirac.runtime/install!)

2016-05-06T00:49:04.000176Z

it is not important, just nice-to-have for cases when you have multiple dirac REPL sessions and you want to distinguish between them

2016-05-06T00:49:28.000177Z

I think I can add that to the boot plugin eventually.

2016-05-06T00:49:41.000178Z

I need to start adding options anyway.

2016-05-06T00:50:37.000179Z

I would like to see some independent solution in dirac.runtime.prefs itself

2016-05-06T00:50:46.000180Z

not everyone will go through your plugin I guess

2016-05-06T00:51:17.000181Z

I understand.

2016-05-06T00:51:29.000182Z

The root folder name seems to be a sane fallback for non lein.

2016-05-06T00:52:01.000183Z

I think so, alse we could try to read :project key from boot task properties

2016-05-06T00:52:38.000184Z

task-options!

2016-05-06T00:52:56.000185Z

Well task options is for a boot task.

2016-05-06T00:53:05.000186Z

Which I introduce as an argument.

2016-05-06T00:53:17.000187Z

set-env! could be something to look into.

2016-05-06T00:53:58.000188Z

Well in this case get-env

2016-05-06T00:54:33.000189Z

I’m actually still a newbie to Clojureland so.

2016-05-06T00:54:46.000190Z

have to go, will leave it to you or some boot-enthusiasts :simple_smile:

2016-05-06T00:54:48.000191Z

I’m just thinking out loud and probably incorrectly. Heads up. 😛

2016-05-06T00:55:16.000192Z

I’ll mess around. The set-pref is something I can mess with.

2016-05-06T00:55:18.000193Z

Thanks!

2016-05-06T00:56:58.000194Z

ah. and @superstructor you don’t need two terminals in the bottom-left area, the left-most one still works as REPL, the prompt is just hidden, I think

2016-05-06T00:57:50.000196Z

The left is the boot task.

superstructor 2016-05-06T00:57:53.000197Z

@darwin: oh I run a bunch of other stuff in that boot task, e.g. cljs.test execution, which may or may not be a good thing.

2016-05-06T00:58:04.000198Z

Which is running under watching.

2016-05-06T00:58:05.000199Z

aha, ok

2016-05-06T00:58:21.000200Z

But yeah as long as the REPL in Chrome is open.

2016-05-06T00:58:31.000201Z

We can connect/disconnect via a nREPL client.

superstructor 2016-05-06T01:00:21.000202Z

on our UI projects (this specific one is not) there is - cljs incremental compilation and reagent being reloaded on the page on change - nrepl (Dirac now) - garden being compiled to css and injected into the page on change - cljs.test execution etc

superstructor 2016-05-06T01:00:31.000203Z

so that dev task does a lot

2016-05-06T01:07:03.000204Z

Added some issues on Github including the unidentified name.