Fork me on GitHub
#dirac
<
2016-05-06
>
superstructor00:05:42

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.

jupl00:05:42

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

jupl00:05:50

Sweet. I can connect to the repl via boot.

darwin00:05:17

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

jupl00:05:54

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

darwin00:05:48

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

darwin00:05:35

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

superstructor00:05:03

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 - 
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 .
Tunnel is accepting connections at .
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 ?

jupl00:05:09

Yeah I’m seeing that quite a bit.

jupl00:05:49

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

jupl00:05:59

Enter the command (dirac! :join)

darwin00:05:11

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

jupl00:05:36

Oh that.

jupl00:05:48

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

darwin00:05:50

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

superstructor00:05:31

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

jupl00:05:24

@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

jupl00:05:43

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

superstructor00:05:40

$ 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
<help cut>
boot.user=> (dirac! :version)
Dirac nREPL middleware v0.3.0.

boot.user=> (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||Chrome/52.0.2725.0|Mac/10.11.4 [17434885-6abf-4120-9e68-8e61ffa523c3]
To quit, type: :cljs/quit

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

superstructor00:05:59

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

superstructor00:05:41

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

darwin00:05:58

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

jupl00:05:17

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

darwin00:05:35

maybe we could read root folder name

jupl00:05:00

@darwin I was just thinking that.

jupl00:05:36

I think that would be a great option.

darwin00:05:17

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

darwin00:05:04

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

jupl00:05:28

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

jupl00:05:41

I need to start adding options anyway.

darwin00:05:37

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

darwin00:05:46

not everyone will go through your plugin I guess

jupl00:05:17

I understand.

jupl00:05:29

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

darwin00:05:01

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

darwin00:05:38

task-options!

jupl00:05:56

Well task options is for a boot task.

jupl00:05:05

Which I introduce as an argument.

jupl00:05:17

set-env! could be something to look into.

jupl00:05:58

Well in this case get-env

jupl00:05:33

I’m actually still a newbie to Clojureland so.

darwin00:05:46

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

jupl00:05:48

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

jupl00:05:16

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

darwin00:05:58

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

jupl00:05:50

The left is the boot task.

superstructor00:05:53

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

jupl00:05:04

Which is running under watching.

jupl00:05:21

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

jupl00:05:31

We can connect/disconnect via a nREPL client.

superstructor01:05:21

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

superstructor01:05:31

so that dev task does a lot

jupl01:05:03

Added some issues on Github including the unidentified name.