Skip to content

Commit fe05ca4

Browse files
committed
Add CLJS support to Readme and Changelog
1 parent 8d79f8f commit fe05ca4

File tree

2 files changed

+33
-29
lines changed

2 files changed

+33
-29
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### New features
66

7+
* [#1195](https://github.com/clojure-emacs/cider/pull/1195): CIDER can [create cljs REPLs](https://github.com/clojure-emacs/cider#clojurescript-usage).
78
* [#1191](https://github.com/clojure-emacs/cider/pull/1191): New custom variables `cider-debug-print-level` and `cider-debug-print-length`.
89
* [#1188](https://github.com/clojure-emacs/cider/pull/1188): New debugging tool-bar.
910
* [#1187](https://github.com/clojure-emacs/cider/pull/1187): The list of keys displayed by the debugger can be configured with `cider-debug-prompt`.

README.md

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -717,45 +717,48 @@ section of your Leiningen project's configuration.
717717

718718
ClojureScript support relies on the
719719
[piggieback](https://github.com/cemerick/piggieback) nREPL middleware being
720-
present in your REPL session. Version 0.2.0 or higher is recommended, and the
721-
below examples assume this, but version 0.1.5 is currently also supported.
720+
present in your REPL session.
722721

723-
* Example usage of a non-browser connected Node.js REPL:
722+
1. Add the following dependencies to your `project.clj`
724723

725-
- At the Clojure REPL:
724+
```clojure
725+
[com.cemerick/piggieback "0.2.1"]
726+
[org.clojure/clojure "1.7.0"]
727+
```
726728

727-
```clojure
728-
(require '[cemerick.piggieback :as piggieback])
729-
(require '[cljs.repl.node :as node])
730-
(piggieback/cljs-repl (node/repl-env))
731-
```
729+
as well as the following option:
732730

733-
* Example usage of browser-connected Weasel REPL (requires
734-
e.g. `[weasel "0.6.0"]` in your project's `:dependencies`):
731+
```clojure
732+
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
733+
```
735734

736-
- At the Clojure REPL:
735+
2. Issue <kbd>M-x</kbd> `customize-variable` <kbd>RET</kbd> `cider-cljs-repl` if
736+
you'd like to change the REPL used (the default is `rhino`).
737737

738-
```clojure
739-
(require '[cemerick.piggieback :as piggieback])
740-
(require '[weasel.repl.websocket :as weasel])
741-
(piggieback/cljs-repl (weasel/repl-env :ip "127.0.0.1"
742-
:port 9001))
743-
```
738+
3. Open a file in your project and issue <kbd>M-x</kbd>
739+
`cider-jack-in-cljs`. This will start up the nREPL server, and then create
740+
two REPL buffers for you, one in Clojure and one in ClojureScript. All usual
741+
CIDER commands will be automatically directed to the appropriate REPL,
742+
depending on whether you're visiting a `clj` or a `cljs` file.
744743

745-
- and in your ClojureScript:
744+
#### Browser-connected ClojureScript REPL
746745

747-
```clojure
748-
(ns my.cljs.core
749-
(:require [weasel.repl :as repl]))
746+
Using Weasel, you can also have a browser-connected REPL.
750747

751-
(repl/connect "ws://localhost:9001")
752-
```
748+
1. Add `[weasel "0.6.0"]` to your project's `:dependencies`.
749+
750+
2. Issue <kbd>M-x</kbd> `customize-variable` <kbd>RET</kbd> `cider-cljs-repl`
751+
and choose the `Weasel` option.
752+
753+
3. Add this to your code:
754+
755+
```clojure
756+
(ns my.cljs.core
757+
(:require [weasel.repl :as repl]))
758+
(repl/connect "ws://localhost:9001")
759+
```
753760

754-
The [clojure-quick-repls](https://github.com/symfrog/clojure-quick-repls)
755-
library provides helper functions to automate REPL creation for both Clojure and
756-
Clojurescript, and will also automatically route requests to the correct REPL
757-
according to the file extension of the current buffer (note that CIDER does not
758-
provide the latter functionality out-of-the-box).
761+
4. Open a file in your project and issue `M-x cider-jack-in-cljs`.
759762

760763
Provided that a Piggieback-enabled ClojureScript environment is active in your
761764
REPL session, code loading and evaluation will work seamlessly regardless of the

0 commit comments

Comments
 (0)