[pandeiro/boot-cljs-repl "0.2.2-SNAPSHOT"] ;; latest release
Boot task providing a ClojureScript browser REPL via Weasel and Piggieback.
The current version of boot-cljs-repl
requires Boot to use Clojure 1.7.0. You
can control the version of Clojure used by boot as described here:
https://github.com/boot-clj/boot/wiki/Setting-Clojure-version
So if you use a boot.properties file it should look something like this:
BOOT_CLOJURE_VERSION=1.7.0
BOOT_VERSION=2.1.2
Add boot-cljs-repl
to your build.boot
dependencies and require
the
namespace:
(set-env! :dependencies '[[adzerk/boot-cljs-repl "X.Y.Z" :scope "test"]])
(require '[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]])
It's also a good idea to explicitly depend on the specific version of Clojure and ClojureScript needed for your application, such as in the following example:
(set-env!
:dependencies '[
[adzerk/boot-cljs "0.0-3308-0" :scope "test"]
[adzerk/boot-cljs-repl "0.1.10-SNAPSHOT" :scope "test"]
[adzerk/boot-reload "0.3.1" :scope "test"]
[pandeiro/boot-http "0.6.3-SNAPSHOT" :scope "test"]
[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "0.0-3308"]])
A typical boot.build
file for ClojureScript development:
(set-env!
:src-paths #{"src"}
:dependencies '[[adzerk/boot-cljs "0.0-X-Y" :scope "test"]
[adzerk/boot-cljs-repl "X.Y.Z" :scope "test"]
[org.clojure/clojure "X.Y.Z"]
[org.clojure/clojurescript "X.Y.Z"]])
(require
'[adzerk.boot-cljs :refer :all]
'[adzerk.boot-cljs-repl :refer :all])
You can see the task options available on the command line:
$ boot cljs-repl -h
or in the REPL:
boot.user=> (doc cljs-repl)
Start a build pipeline with file-watcher, ClojureScript REPL server, and compile ClojureScript with source maps, unified HTML loading, and no optimizations:
# note: cljs-repl task must precede cljs task
$ boot watch cljs-repl cljs -sO none
To start evaluating forms in the browser you must first connect to the running
Clojure nREPL server (started by the cljs-repl
task above) and create a new,
browser-connected CLJS REPL.
$ boot repl -c
boot.user=> (start-repl)
M-x cider-connect
boot.user=> (start-repl)
:Piggieback (adzerk.boot-cljs-repl/repl-env)
Copyright © 2014-15 Adzerk
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.