@@ -5,11 +5,24 @@ While these days most people are using `figwheel` and `shadow-cljs`,
5
5
CIDER supports other ClojureScript REPLs as well.
6
6
This section of the user manual is dedicated to them.
7
7
8
- == Browser-Connected ClojureScript REPL
8
+ == Node.js REPL
9
9
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`.
11
12
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`.
13
26
. Type kbd:[M-x] `cider-jack-in-cljs` kbd:[RET] and choose
14
27
the `Weasel` option when prompted about the ClojureScript REPL type you want
15
28
to use.
@@ -22,15 +35,23 @@ to use.
22
35
(repl/connect "ws://localhost:9001")
23
36
----
24
37
+
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!")
26
42
27
43
Provided that a Piggieback-enabled ClojureScript environment is active in your
28
44
REPL session, code loading and evaluation will work seamlessly regardless of the
29
45
presence of the `cider-nrepl` middleware. If the middleware is present then most
30
46
other features of CIDER will also be enabled (including code completion,
31
47
documentation lookup, the namespace browser, and macroexpansion).
32
48
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.
34
55
35
56
. Add this to your dependencies in `build.boot`:
36
57
+
@@ -39,7 +60,7 @@ documentation lookup, the namespace browser, and macroexpansion).
39
60
[adzerk/boot-cljs "X.Y.Z" :scope "test"]
40
61
[adzerk/boot-cljs-repl "X.Y.Z" :scope "test"]
41
62
[pandeiro/boot-http "X.Y.Z" :scope "test"]
42
- [weasel "0.7.0 " :scope "test"]
63
+ [weasel "0.7.1 " :scope "test"]
43
64
[cider/piggieback "0.4.2" :scope "test"] ; not needed for cider-jack-in-cljs
44
65
----
45
66
+
0 commit comments