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.Ah okay. I guess I was confused by the terminology.
Sweet. I can connect to the repl via boot.
@superstructor: ah, didn’t know that index-of is 1.8+, it is definitely something which could be written a different way
Sweet. Looks like it’s all working fine. I can connect to the repl via boot repl
and emacs. 😄
cool!
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
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
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 ?Yeah I’m seeing that quite a bit.
@superstructor: Once you connect to the repl @port 8230.
Enter the command (dirac! :join)
@superstructor: you have to switch to Dirac REPL prompt by PageUp or PageDown in JS console
Oh that.
That’s something I’m going to add to the documentation.
this should be documented better, it is now just mentioned once in dirac-sample walkthrough
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@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
If you cannot connect to that then there is something going on.
$ 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|<http://localhost:4242/>|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] }”]
looks like thats good. thanks. so Cursive refuses to connect for some reason.
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
Hmm. I’m not aware that there is a required argument like that for Boot projects.
maybe we could read root folder name
@darwin I was just thinking that.
I think that would be a great option.
you can also call (dirac.runtime/set-pref! :runtime-tag “something”)
prior calling (dirac.runtime/install!)
it is not important, just nice-to-have for cases when you have multiple dirac REPL sessions and you want to distinguish between them
I think I can add that to the boot plugin eventually.
I need to start adding options anyway.
I would like to see some independent solution in dirac.runtime.prefs
itself
not everyone will go through your plugin I guess
I understand.
The root folder name seems to be a sane fallback for non lein.
I think so, alse we could try to read :project key from boot task properties
task-options!
Well task options is for a boot task.
Which I introduce as an argument.
set-env!
could be something to look into.
Well in this case get-env
I’m actually still a newbie to Clojureland so.
have to go, will leave it to you or some boot-enthusiasts :simple_smile:
I’m just thinking out loud and probably incorrectly. Heads up. 😛
I’ll mess around. The set-pref
is something I can mess with.
Thanks!
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
The left is the boot task.
@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.
Which is running under watching.
aha, ok
But yeah as long as the REPL in Chrome is open.
We can connect/disconnect via a nREPL client.
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
so that dev task does a lot
Added some issues on Github including the unidentified
name.