This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-10
Channels
- # admin-announcements (2)
- # alda (16)
- # beginners (22)
- # boot (55)
- # cider (11)
- # cljs-dev (5)
- # cljsrn (7)
- # clojure (115)
- # clojure-art (1)
- # clojure-finland (3)
- # clojure-greece (18)
- # clojure-madison (2)
- # clojure-norway (2)
- # clojure-poland (50)
- # clojure-russia (122)
- # clojure-uk (9)
- # clojurescript (28)
- # core-async (7)
- # cursive (4)
- # data-science (4)
- # datomic (65)
- # devcards (3)
- # dirac (91)
- # editors (7)
- # emacs (9)
- # hoplon (1)
- # jobs (5)
- # jobs-discuss (10)
- # juxt (2)
- # keechma (7)
- # ldnclj (31)
- # leiningen (3)
- # off-topic (22)
- # om (129)
- # om-next (1)
- # onyx (6)
- # proton (15)
- # protorepl (2)
- # re-frame (49)
- # reagent (13)
- # remote-jobs (1)
- # ring-swagger (2)
- # yada (19)
@jaen: I’m just looking for a bit of example code that runs the agent integrated with something like boot-cljs-repl?
I have something like
(deftask dev-cljs-repl
"Run a restartable system in the Repl"
[]
(comp
(environ :env {:http-port "3300" :dev true})
(watch :verbose true)
(system :sys #'dev-system :auto true :files ["handler.clj"])
(reload :port 55554)
(cljs-repl :port 55555)
(cljs)
(speak)))
Dirac documentation suggests that you can’t use piggieback, as Dirac provides the same functionality.
boot-cljs-repl has
piggie-repl (partial repl :server true
:middleware ['cemerick.piggieback/wrap-cljs-repl])]
I guess I need something like boot-dirac-repl that does something similar, as I don’t see a way to override the middleware there.
I don’t mind trying to write such a thing, but I was hoping someone might have already done it.
your understanding is correct, you just need to replace piggieback with dirac middleware
Ok. I’ll try to spin out a boot-dirac-repl… or see if the boot people are ok with a PR adding dirac support. Thanks
So I don't really have anything more than:
(repl :server true
:middleware '[dirac.nrepl.middleware/dirac-repl]
:port 8230)
and
(defn start-dirac! []
(require 'dirac.agent)
(let [dirac-boot! (resolve 'dirac.agent/boot!)]
(dirac-boot!)))
in build boot.If I read the cljs-repl code, it appears it’s doing some slightly complex stuff with weasel… I’m not sure I understand the impact. Do you know if I’m losing functionality by using your incredibly simple version?
You loose some, you gain some. But dirac gives you equivalent functionality to boot-cljs-repl
.
And if you don't remove boot-cljs-repl
(both the task and related piggibeack/weasel/austin dependencies) you probably won't get dirac to work
Of course remember to have something equivalent to:
(defn install-devtools! []
(devtools/set-pref! :install-sanity-hints true)
(devtools/enable-feature! :dirac)
(devtools/install!))
called in your client app.I think you should be able to run them side-by-side if you make sure that ports don’t clash
I’m so psyched about this. Thanks for this work! This really does seem like the holy grail.
so you would connect via Cursive REPL and can let dirac “echo” commands you send into REPL from code editor
Really wish it were open source, would love to try to add boot support. I’ve spent 3 days playing with boot, and it’s so much simpler than the equivalent lein config.
@darwin: I couldn't get boot-cljs-repl
and dirac
working together in one project last I tried (quite recently) so not too sure it's possible.
Except debugging (and it's hard for me to live without debugging), but not sure what's at fault here exactly.
Yeah, it’s working for me too. I need to put a watch trigger in intellij that generates the project.clj when build.boot changes.
even project.clj support is not perfect for me, I use lein profiles heavily and clojure does not understand them
so maybe generating project.clj is a pretty flexible solution, because now I have to jump through hoops to satisfy both lein and Cursive
I tell you though, I’ve been building web ‘applications’ since the perl/cgi days, and between this and devcards, I’m finally starting to think it might actually be something fun.
@smw: in IntelliJ? You can put that in a task like so - https://gist.github.com/jaen/17d555c45f067f080091 - and then just do:
(build-utilities/update-dependencies)
(build-utilities/lein-generate)
in the build pipeline.At some point I would want to have everything run in a pod so I can' avoid even those dependency clashes
You don't set dependencies in build.boot
but in resources/dependencies.edn
and it Just Works™.
Yeah, I have it in my thesis repo, which is open — https://gitlab.com/jaen/thesis-code-new/blob/master/dev/build_utils.clj
Feel free to use it, it's nothing groundbreaking, just a bit more nicely wrapped snippet from boot wiki.
Though honestly I haven’t had much time to play with it, somehow I keep ending up on calls 😞