Skip to content

Commit b32a3fd

Browse files
committed
Extend the "Other ClojureScript REPLs" part of the documentation
1 parent adc4400 commit b32a3fd

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

doc/modules/ROOT/pages/cljs/other_repls.adoc

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,24 @@ While these days most people are using `figwheel` and `shadow-cljs`,
55
CIDER supports other ClojureScript REPLs as well.
66
This section of the user manual is dedicated to them.
77

8-
== Browser-Connected ClojureScript REPL
8+
== Node.js REPL
99

10-
Using Weasel, you can also have a browser-connected REPL.
10+
IMPORTANT: Make sure `node.js` is installed and that the `node` binary
11+
is on Emacs's `exec-path`.
1112

12-
. Add `[weasel "0.7.0"]` to your project's `:dependencies`.
13+
ClojureScript's Node.js REPL is really simple to setup, as it doesn't
14+
require you to fiddle with your project's dependencies. All you need to do is:
15+
16+
. Open some file in your project.
17+
. Type kbd:[M-x] `cider-jack-in-cljs` kbd:[RET].
18+
. Choose the `node` option when prompted about the ClojureScript REPL type you want
19+
to use.
20+
21+
== Weasel
22+
23+
Using https://github.com/nrepl/weasel[Weasel], you can have a browser-connected REPL.
24+
25+
. Add `[weasel "0.7.1"]` to your project's `:dependencies`.
1326
. Type kbd:[M-x] `cider-jack-in-cljs` kbd:[RET] and choose
1427
the `Weasel` option when prompted about the ClojureScript REPL type you want
1528
to use.
@@ -22,15 +35,23 @@ to use.
2235
(repl/connect "ws://localhost:9001")
2336
----
2437
+
25-
. Open a file in your project and type kbd:[M-x] `cider-jack-in-cljs`.
38+
. Once connected you can start evaluating code in the REPL and you'll see the results in your
39+
browser.
40+
+
41+
cljs.user> (js/alert "Hello world!")
2642

2743
Provided that a Piggieback-enabled ClojureScript environment is active in your
2844
REPL session, code loading and evaluation will work seamlessly regardless of the
2945
presence of the `cider-nrepl` middleware. If the middleware is present then most
3046
other features of CIDER will also be enabled (including code completion,
3147
documentation lookup, the namespace browser, and macroexpansion).
3248

33-
== Browser-Connected ClojureScript REPL in Boot Projects
49+
TIP: For more information on Weasel you should consult its https://github.com/nrepl/weasel/blob/master/README.md[documentation].
50+
51+
== Boot ClojureScript REPL
52+
53+
`boot-cljs` is another browser-connected ClojureScript REPL, that's targeting the Boot build tool.
54+
Internally, it's powered by Weasel. Let's go over the steps required to use it.
3455

3556
. Add this to your dependencies in `build.boot`:
3657
+
@@ -39,7 +60,7 @@ documentation lookup, the namespace browser, and macroexpansion).
3960
[adzerk/boot-cljs "X.Y.Z" :scope "test"]
4061
[adzerk/boot-cljs-repl "X.Y.Z" :scope "test"]
4162
[pandeiro/boot-http "X.Y.Z" :scope "test"]
42-
[weasel "0.7.0" :scope "test"]
63+
[weasel "0.7.1" :scope "test"]
4364
[cider/piggieback "0.4.2" :scope "test"] ; not needed for cider-jack-in-cljs
4465
----
4566
+

0 commit comments

Comments
 (0)