Skip to content

Commit dea866c

Browse files
authored
Refine shadow-cljs documentation (#3360)
1 parent c58eebe commit dea866c

File tree

6 files changed

+24
-15
lines changed

6 files changed

+24
-15
lines changed

doc/modules/ROOT/pages/basics/middleware_setup.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ run `cider-connect` or `cider-connect-cljs`.
8989
9090
:cider-cljs {:extra-deps {org.clojure/clojurescript {:mvn/version "1.10.339"}
9191
cider/cider-nrepl {:mvn/version "0.22.4"}
92-
cider/piggieback {:mvn/version "0.5.1"}}
92+
cider/piggieback {:mvn/version "0.5.3"}}
9393
:main-opts ["-m" "nrepl.cmdline" "--middleware"
9494
"[cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]}
9595
----

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ You'll also have to configure Piggieback manually if you're planning to use
2525
+
2626
[source,clojure]
2727
----
28-
[cider/piggieback "0.5.1"]
28+
[cider/piggieback "0.5.3"]
2929
----
3030
+
3131
. Add this to your dev `:repl-options` (not needed for `cider-jack-in-cljs`):
@@ -123,7 +123,7 @@ in the root of your Leiningen project definition.
123123
+
124124
[source,clojure]
125125
----
126-
[cider/piggieback "0.5.1"] ; not needed for cider-jack-in-cljs
126+
[cider/piggieback "0.5.3"] ; not needed for cider-jack-in-cljs
127127
[figwheel-sidecar "0.5.19"] ; use here whatever the current version of figwheel is
128128
----
129129
+

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Internally, it's powered by Weasel. Let's go over the steps required to use it.
6161
[adzerk/boot-cljs-repl "X.Y.Z" :scope "test"]
6262
[pandeiro/boot-http "X.Y.Z" :scope "test"]
6363
[weasel "0.7.1" :scope "test"]
64-
[cider/piggieback "0.5.1" :scope "test"] ; not needed for cider-jack-in-cljs
64+
[cider/piggieback "0.5.3" :scope "test"] ; not needed for cider-jack-in-cljs
6565
----
6666
+
6767
and this at the end of `build.boot`:

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ and how to setup the most popular ClojureScript REPLs.
1717
== nREPL and ClojureScript
1818

1919
nREPL doesn't natively support ClojureScript evaluation, that why an additional
20-
middleware is needed. CIDER relies on the popular Piggieback middleware for its
20+
middleware is needed. For most REPLs (with the notable exceptions of `shadow-cljs`, `nbb`), CIDER relies on the popular Piggieback middleware for its
2121
ClojureScript support.
2222

2323
Piggieback works in the following manner:
@@ -32,7 +32,9 @@ On the bright side - this also means that you can host side by side Clojure and
3232
REPLs in a single nREPL connection! This opens up all sorts of interesting possibilities
3333
that we'll discuss later on.
3434

35-
== Differences with the Standard ClojureScript REPL
35+
NOTE: `shadow-cljs`'s REPL is implemented in a very similar fashion, but its mechanism is provided by its own nREPL middleware - not Piggieback.
36+
37+
== Piggieback differences with the Standard ClojureScript REPL
3638

3739
While the Piggieback-powered ClojureScript REPLs behave more or less
3840
the same as the standard ClojureScript REPL, there are few subtle

doc/modules/ROOT/pages/cljs/shadow-cljs.adoc

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,26 @@ Alternatively you can start the server manually with something like:
5454

5555
[source,sh]
5656
----
57-
$ npx shadow-cljs server
57+
$ shadow-cljs watch app
5858
----
5959

6060
And connect to it with `cider-connect`.
6161

62+
...For that to work, `shadow-cljs.edn` contents like the following are assumed:
63+
64+
```clj
65+
:dependencies [[cider/cider-nrepl "0.31.0"] ;; mandatory (unless it's inherited from deps.edn or otherwise present in the classpath of shadow-cljs's JVM process)
66+
[refactor-nrepl/refactor-nrepl "3.6.0"]] ;; refactor-nrepl is optional
67+
68+
:nrepl {:middleware [cider.nrepl/cider-middleware ;; it's advisable to explicitly add this middleware. It's automatically added by shadow-cljs (if available in the classpath), unless `:nrepl {:cider false}`
69+
refactor-nrepl.middleware/wrap-refactor] ;; refactor-nrepl is optional
70+
:port 50655} ;; optional - if not specified, a random free port will be used
71+
```
72+
6273
NOTE: If https://docs.cider.mx/cider-nrepl/[cider-nrepl] isn't in your
63-
classpath you should make sure it's there. You can do this by adding
64-
it to `:dependencies` in the `shadow-cljs.edn` configuration file
65-
residing in the root of your project. Alternatively you can set
74+
classpath you should make sure it's there. You can do this by correctly filling
75+
the `shadow-cljs.edn` configuration file
76+
residing in the root of your project, as described above. Alternatively you can set
6677
`cider-repl-auto-detect-type` to `nil`, as the auto-detection of
6778
REPL types doesn't work without `cider-nrepl`.
6879

@@ -139,7 +150,3 @@ Here are a few useful sections from ``shadow-cljs``'s own documentation:
139150
* https://shadow-cljs.github.io/docs/UsersGuide.html#_installation[Installation]
140151
* https://shadow-cljs.github.io/docs/UsersGuide.html#nREPL[nREPL Setup]
141152
* https://shadow-cljs.github.io/docs/UsersGuide.html#cider[Integration with CIDER]
142-
143-
=== Tutorials
144-
145-
* https://cestlaz.github.io/post/using-emacs-63-clojurescript/[Using shadow-cljs with CIDER]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ project or `deps.edn`):
2525
[source,clojure]
2626
----
2727
;; use whatever are the most recent versions here
28-
[cider/piggieback "0.5.1"]
28+
[cider/piggieback "0.5.3"]
2929
[org.clojure/clojure "1.9.0"]
3030
----
3131

0 commit comments

Comments
 (0)