Fork me on GitHub
#cider
<
2017-09-06
>
ag01:09:24

has anyone succeeded running cljs repl while connected to a clojure.repl in Emacs?

(require 'cljs.repl)

(require 'cljs.repl.node)

(def repl-env (cljs.repl.node/repl-env))

(cljs.repl/repl repl-env)
This doesn't really work

ag01:09:20

it kinda works (I think), but not really once it's connected to cljs repl - it prompts for input in minibuffer, not in the cider-repl

dominicm06:09:32

@ag you need to use cemerick piggieback for integration with nrepl

ag18:09:43

@dominicm oh, yeah, I forgot about that. Now I need to find a way to wrap piggieback around cljs.repl/repl

tanzoniteblack19:09:17

if it helps you at all, I have a cljs project set up with the following in the project.clj:

:plugins [[lein-cljsbuild "1.1.4"]
          [lein-figwheel "0.5.8"]]
:profiles {:dev {:dependencies [[com.cemerick/piggieback "0.2.1"]
                                [figwheel-sidecar "0.5.8"]]}}
and then also a .dir-locals.el in the same directory with
((nil . ((cider-cljs-lein-repl . "(do (use 'figwheel-sidecar.repl-api) (start-figwheel!) (cljs-repl))"))))

tanzoniteblack19:09:09

you're not using cider, if I read this correctly? But what I'm calling with cider-cljs-lein-repl should be runnable from any clojure repl if the right libraries are loaded to start a cljs repl

tanzoniteblack19:09:25

(if this isn't actually useful, then just ignore me 🙂 )

ag19:09:53

@U236LQYB0 cljs.repl and figwheel repl aren't the same thing

tanzoniteblack19:09:50

yep, didn't read that close enough. so ignore me

ag19:09:21

okay, made it:

(require 'cljs.repl)
(require 'cljs.repl.node)
(require 'cemerick.piggieback)
(def repl-env (cljs.repl.node/repl-env))
(cemerick.piggieback/cljs-repl repl-env)

dominicm19:09:09

That looks how I'd expect. You're not using cljs.repl anymore, so that line can go.

fabrao19:09:43

Hello all, is there any way to dynamic load dependencies from cider repl?

dominicm20:09:59

@fabrao refactor.el provides this functionality

mike_ananev21:09:22

@fabrao If you use Spacemacs then C-c C-f a p - add project dependency and load it to current repl without restart (hotreload)

fabrao21:09:53

@mike1452 I tried the plugin alembic, I´m using pure Emacs

mike_ananev21:09:20

@fabrao alembic works too.

fabrao21:09:48

but do you think ur process is better?

fabrao21:09:39

@mike1452 Thanks, I´ll give a try

oskarkv21:09:53

My pretty-printing in the REPL has stopped working, it seems. cider-repl-use-pretty-printing is t and cider-pprint-fn is fipp but my REPL looks like this http://i.imgur.com/8ahdIZg.png Any ideas?