Skip to content

Commit 352cc04

Browse files
committed
Extend a bit the figwheel documentation
1 parent 36a1c49 commit 352cc04

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

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

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@ strongly advised to use `figwheel-main`.
1010

1111
== Using Figwheel-main
1212

13+
The setup instructions that follow focus on the bare minimum you need to do
14+
to get Figwheel to work with CIDER. For more details you should check out
15+
Figwheel's https://figwheel.org/docs/installation.html[excellent documentation].
16+
1317
=== Leiningen Setup
1418

1519
NOTE: This part of the setup is only necessary if `cider-inject-dependencies-at-jack-in` has
16-
been changed from its default setting of `enabled`, as described more fully above.
20+
been changed from its default setting of `t` (enabled), as described earlier.
21+
You'll also have to configure Piggieback manually if you're planning to use
22+
`cider-connect-cljs`.
1723

1824
. Add this to your dev `:dependencies` (not needed for `cider-jack-in-cljs`):
1925
+
@@ -29,6 +35,26 @@ been changed from its default setting of `enabled`, as described more fully abov
2935
:nrepl-middleware [cider.piggieback/wrap-cljs-repl]
3036
----
3137

38+
Now it's time to add `figwheel-main` to your dependencies as well and you're good to go. Here's
39+
an example minimal `project.clj` (sans the optional Piggieback setup):
40+
41+
[source,clojure]
42+
----
43+
(defproject example-project "0.1.0-SNAPSHOT"
44+
:dependencies [[org.clojure/clojure "1.10.1"]]
45+
:profiles
46+
{:dev
47+
{:dependencies [[org.clojure/clojurescript "1.10.339"]
48+
[com.bhauman/figwheel-main "0.2.3"]]}})
49+
----
50+
51+
You can now verify that everything's properly setup by running:
52+
53+
$ lein run -m figwheel.main
54+
55+
A browser window should pop open and back in the terminal you should see a REPL
56+
with a `cljs.user=>` prompt waiting to evaluate ClojureScript code.
57+
3258
=== Clojure CLI Setup
3359

3460
. Ensure your `deps.edn` contains these dependencies available from an
@@ -39,7 +65,7 @@ deps.edn.
3965
+
4066
[source,clojure]
4167
----
42-
{ :aliases {:fig {:extra-deps
68+
{:aliases {:fig {:extra-deps
4369
{com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
4470
com.bhauman/figwheel-main {:mvn/version "0.2.3"}}}}}
4571
----
@@ -83,6 +109,8 @@ using the `cider-figwheel-main-default-options`.
83109
See https://github.com/bhauman/figwheel-main/blob/master/src/figwheel/main/api.clj[figwheel.main.api/start]
84110
for details.
85111

112+
TIP: Figwheel's own documentation has a nice https://figwheel.org/docs/emacs.html[section, dedicated to CIDER].
113+
86114
== Using legacy Figwheel (Leiningen-only)
87115

88116
WARNING: This has been deprecated in favour of using `figwheel-main`. Check out

0 commit comments

Comments
 (0)