dirac

Dirac v1.7.2 is out: https://github.com/binaryage/dirac/releases/tag/v1.7.2
p-himik 2018-03-16T04:35:24.000156Z

I'm trying to use shadow-cljs, so now my :init in :repl-options looks like:

(do
  (set! *print-length* 50)
  (require 'shadow.cljs.devtools.server)
  (shadow.cljs.devtools.server/start!)
  (require 'shadow.cljs.devtools.api)
  (shadow.cljs.devtools.api/watch :main)
  (require 'dirac.agent)
  (dirac.agent/boot! {:skip-paranoid-middleware-setup-check true}))
It appears to be working, however I keep getting this error on each connection:
clojure.lang.ExceptionInfo: Assert failed: (symbol? module) in file <repl://dirac-repl/dirac/83f52caf-1/init.cljs> {:tag :cljs/analysis-error}
    at clojure.core$ex_info.invokeStatic(core.clj:4739)
	at clojure.core$ex_info.invoke(core.clj:4739)
	at cljs.analyzer$error.invokeStatic(analyzer.cljc:697)
	at cljs.analyzer$error.invoke(analyzer.cljc:693)
	at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3619)
	at cljs.analyzer$analyze.invoke(analyzer.cljc:3605)
	at dirac.nrepl.eval$evaluate_form.invokeStatic(eval.clj:169)
	at dirac.nrepl.eval$evaluate_form.invoke(eval.clj:160)
	at dirac.nrepl.eval$repl_eval_BANG_.invokeStatic(eval.clj:189)
	at dirac.nrepl.eval$repl_eval_BANG_.invoke(eval.clj:183)
	at clojure.lang.AFn.applyToHelper(AFn.java:195)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.core$apply.invokeStatic(core.clj:663)
	at clojure.core$partial$fn__5567.doInvoke(core.clj:2635)
	at clojure.lang.RestFn.invoke(RestFn.java:457)
	at cljs.repl$repl_STAR_$read_eval_print__6473.invoke(repl.cljc:950)
	at cljs.repl$repl_STAR_$fn__6479$fn__6488.invoke(repl.cljc:994)
	at cljs.repl$repl_STAR_$fn__6479.invoke(repl.cljc:993)
	at cljs.compiler$with_core_cljs.invokeStatic(compiler.cljc:1285)
	at cljs.compiler$with_core_cljs.invoke(compiler.cljc:1274)
	at cljs.repl$repl_STAR_.invokeStatic(repl.cljc:953)
	at cljs.repl$repl_STAR_.invoke(repl.cljc:832)
	at dirac.nrepl.eval$eval_in_cljs_repl_BANG_$start_repl_fn__19596.invoke(eval.clj:245)
	at dirac.nrepl.driver$wrap_with_driver.invokeStatic(driver.clj:142)
	at dirac.nrepl.driver$wrap_with_driver.invoke(driver.clj:126)
	at dirac.nrepl.eval$eval_in_cljs_repl_BANG_.invokeStatic(eval.clj:249)
	at dirac.nrepl.eval$eval_in_cljs_repl_BANG_.doInvoke(eval.clj:212)
	at clojure.lang.RestFn.invoke(RestFn.java:594)
	at dirac.nrepl.utils$start_new_cljs_compiler_repl_environment_BANG_.invokeStatic(utils.clj:67)
Apparently, it doesn't want to execute something like (ns cljs.user (:require [cljs.repl])) for some reason. Also, after each entered statement in the Dirac console, the CLJS version is printed out: ClojureScript 1.10.145

1
p-himik 2018-03-16T04:38:04.000013Z

Just running (require '[cljs.repl]) leads to the same error. But running (require '[cljs.core]) is just fine.

p-himik 2018-03-16T04:42:18.000053Z

Hmm, yeah. Removing all shadow-cljs lines from :init and :nrepl-middleware solves the issue. I keep getting the CLJS version after each statement, so it must be something unrelated.

2018-03-16T08:39:02.000327Z

@p-himik hi, Dirac doesn’t 100% work with 1.10.145, that cljs version thing is definitely fixed in clojurescript master

2018-03-16T08:40:32.000439Z

last time I checked master clojurescript with Dirac, there were still some issues, but I didn’t take time to really look into them

2018-03-16T08:41:11.000412Z

I’m afraid you are trying to do too many things at once, either try to integrate with shadow-cljs or try to run against 1.10.x, but not both at once

p-himik 2018-03-16T08:44:31.000054Z

@darwin I did try to run without shadow-cljs - it works fine.

2018-03-16T08:47:57.000224Z

I looked at the issue you posted in #shadow-cljs, you cannot easily integrate shadow-cljs REPL and dirac REPL

2018-03-16T08:48:03.000207Z

they must run separately

2018-03-16T08:48:49.000084Z

in the about-repl docs you can find a section about integrating figwheel repl and dirac, you’ll see how complex that is

2018-03-16T08:49:08.000424Z

something similar would have to be done for shadow-cljs REPL tooling I guess