Fork me on GitHub
#vim
<
2019-01-09
>
briemens21:01:37

Does anyone know how to connect vim-fireplace to a shadow-cljs repl? I created a shadow-cljs.edn file with the following config, first without dependencies and added them without any success:

{:source-paths ["src"]
 :dependencies [[cider/cider-nrepl "0.18.0"]
                [figwheel "0.5.15"]
                [com.cemerick/piggieback "0.2.2"]
                [org.clojure/tools.nrepl "0.2.13"]]
 :nrepl        {:port 3333}
 :builds {:app {:target :browser
                :output-dir "public/js"
                :modules {:main {:entries [hello-shadow-cljs.core]}}}}}
Then I run shadow-cljs watch app with the following output:
shadow-cljs - config: ~/hello-shadow-cljs/shadow-cljs.edn  cli version: 2.7.13  node: v8.10.0
shadow-cljs - starting ...
Jan 09, 2019 10:18:47 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.8.Final
Jan 09, 2019 10:18:47 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.8.Final
[2019-01-09 22:18:50.370 - INFO] Using tools.nrepl 0.2.* server!
shadow-cljs - server version: 2.7.13
shadow-cljs - server running at 
shadow-cljs - socket REPL running on port 52619
shadow-cljs - nREPL server started on port 3333
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (134 files, 1 compiled, 0 warnings, 2.02s)
When I fire a fireplace command I get the following error:
Error detected while processing function <SNR>166_printop[1]..<SNR>166_opfunc[35]..fireplace#client:
line   10:
E605: Exception not caught: Fireplace: class java.lang.AssertionError
Press ENTER or type command to continue
With leiningen everything works fine

dominicm21:01:12

You need to use Piggieback I think

briemens22:01:42

I got it working with the following configuration in shadow-cljs.edn:

{:source-paths ["src"]
 :dependencies [[cider/cider-nrepl "0.16.0-SNAPSHOT"]]
 :nrepl        {:port 3333}
 :builds {:app {:target :browser
                :output-dir "public/js"
                :assets "/assets"
                :modules {:main {:entries [hello.core]}}
                :devtools {:http-root "public"
                           :http-port 8080}}}}
The next step is to create an index.html file that loads the compiled main.js file under public/js/main.js Once main,js is loaded in a browser you can connect with piggieback using the following vim command:
:Piggieback :app
So what I was missing was that the cljs repl was not started yet, for this main.js had to be loaded which activates the repl.