A minimal CLJS project for demonstrating the protocol issues with CLJS r1978.
git clone https://github.com/magomimmo/minimal.git
lein compile
Compiling ClojureScript.
Compiling "dev-resources/public/js/whitespace.js" from ["src/cljs" "dev-resources/tools/repl"]...
Successfully compiled "dev-resources/public/js/whitespace.js" in 11.199011 seconds.
lein repl
Compiling ClojureScript.
nREPL server started on port 50868 on host 127.0.0.1
REPL-y 0.2.1
Clojure 1.5.1
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
user=> (require '[ring.server :as http])
nil
user=> (http/run)
2013-10-29 17:14:33.266:INFO:oejs.Server:jetty-7.6.8.v20121106
2013-10-29 17:14:33.296:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:3000
#<Server org.eclipse.jetty.server.Server@c8a3c71>
user=>
You now have two options to launch a browser connect REPL:
- using the traditional
lein trampoline cljsbuild repl-listen
- using the piggieback lib by Chas Emerick
Open a new terminal windows, cd
in the main project directory, and issue:
lein trampoline cljsbuild repl-listen
Running ClojureScript REPL, listening on port 9000.
"Type: " :cljs/quit " to quit"
WARNING: Symbol ICounted is not a protocol at line 14 /Users/mimmo/Developer/minimal/src/cljs/minimal.cljs
WARNING: Symbol cljs.core/IMeta is not a protocol at line 5 /Users/mimmo/Developer/minimal/src/cljs/minimal/testing.cljs
WARNING: Symbol cljs.core/IWithMeta is not a protocol at line 5 /Users/mimmo/Developer/minimal/src/cljs/minimal/testing.cljs
WARNING: Symbol cljs.core/IMeta is not a protocol at line 5 /Users/mimmo/Developer/minimal/src/cljs/minimal/testing.cljs
WARNING: Symbol cljs.core/IWithMeta is not a protocol at line 5 /Users/mimmo/Developer/minimal/src/cljs/minimal/testing.cljs
WARNING: Symbol ICounted is not a protocol at line 14 /Users/mimmo/Developer/minimal/src/cljs/minimal.cljs
ClojureScript:cljs.user>
If you use the Piggieback lib, you do not receive any warnings.
Evaluate the following expression from the the REPL where you ran the ring server:
user=> (browser-repl)
Type `:cljs/quit` to stop the ClojureScript REPL
nil
cljs.user=>
Visit the localhost:3000 url, wait a moment for the connection to be establish and start BREPLing.
Copyright (C) 2013 Giacomo (Mimmo) Cosenza aka Magomimmo
Distributed under the Eclipse Public License, the same as Clojure.