A sample project for using cljs with node with a repl. Clone it and mess around with it.
Open a terminal and run lein cljsbuild auto
or lein cljsbuild once
node cljs_node_lighttable.js
And you should see Hello world!
in the console
With the last update of cljs-noderepl the repl works with nrepl, but it doesn't work connecting with lighttable (Add connection -> Clojure (external nrepl)).
Follow the instructions in the cljs-noderepl repo
$ lein trampoline noderepl
or
rlwrap -r -m -q '\"' -b "(){}[],^%3@\";:'" lein trampoline noderepl
cljs-node-lighttable $ lein repl
To get a node repl over nrepl do:
cljs-node-lighttable $ lein repl
nREPL server started on port 60691 on host 127.0.0.1
REPL-y 0.3.0
Clojure 1.5.1
user=> (require '[cljs.repl.node :as node])
nil
user=> (node/run-node-nrepl)
Type `:cljs/quit` to stop the ClojureScript REPL
nil
cljs.user=> (.log js/console "Hi from cljs")
Hi from cljs
nil
cljs.user=>
Install vim-fireplace
Then start the repl and require the node repl:
cljs-node-lighttable $ lein repl
nREPL server started on port 60691 on host 127.0.0.1
REPL-y 0.3.0
Clojure 1.5.1
user=> (require '[cljs.repl.node :as node])
nil
Then open vim in the clojurescript project, and do:
:Piggieback (cljs.repl.node/repl-env)
It will take a bit to connect, when vim is responsive again go
over some of the examples in core.cljs
and eval the expr using cpp