Using Other ClojureScript REPLs
While these days most people are using
CIDER supports other ClojureScript REPLs as well.
This section of the user manual is dedicated to them.
ClojureScript’s Node.js REPL is really simple to setup, as it doesn’t require you to fiddle with your project’s dependencies. All you need to do is:
Open some file in your project.
nodeoption when prompted about the ClojureScript REPL type you want to use.
Using Weasel, you can have a browser-connected REPL.
[weasel "0.7.1"]to your project’s
cider-jack-in-cljsRET and choose the
Weaseloption when prompted about the ClojureScript REPL type you want to use.
Add this to your ClojureScript code:
(ns my.cljs.core (:require [weasel.repl :as repl])) (repl/connect "ws://localhost:9001")
Once connected you can start evaluating code in the REPL and you’ll see the results in your browser.
cljs.user> (js/alert "Hello world!")
Provided that a Piggieback-enabled ClojureScript environment is active in your
REPL session, code loading and evaluation will work seamlessly regardless of the
presence of the
cider-nrepl middleware. If the middleware is present then most
other features of CIDER will also be enabled (including code completion,
documentation lookup, the namespace browser, and macroexpansion).
|For more information on Weasel you should consult its documentation.|
boot-cljs is another browser-connected ClojureScript REPL, that’s targeting the Boot build tool.
Internally, it’s powered by Weasel. Let’s go over the steps required to use it.
Add this to your dependencies in
[adzerk/boot-cljs "X.Y.Z" :scope "test"] [adzerk/boot-cljs-repl "X.Y.Z" :scope "test"] [pandeiro/boot-http "X.Y.Z" :scope "test"] [weasel "0.7.1" :scope "test"] [cider/piggieback "0.5.1" :scope "test"] ; not needed for cider-jack-in-cljs
and this at the end of
(require '[adzerk.boot-cljs :refer [cljs]] '[adzerk.boot-cljs-repl :refer [cljs-repl]] '[pandeiro.boot-http :refer [serve]]) (deftask dev  (comp (serve) (watch) (cljs-repl) ; order is important!! (cljs)))
Open a file in your project and type M-x
Connect to the running server with your browser. The address is printed on the terminal, but it’s probably
For more information visit boot-cljs-repl.