djhworld / testproject

Source for "Getting started with ClojureScript and Noir #1"
http://djhworld.github.com/2012/02/12/getting-started-with-clojurescript-and-noir.html
5 stars 1 forks source link

Inclusion of browser-connected repl for ClojureScript. #2

Open timclemons opened 12 years ago

timclemons commented 12 years ago

Feature request: thanks for the blog entry describing how you went about this and providing this repo. Would it be possible for you to also demo a means of automatically launching a browser and connecting it to a ClojureScript repl? It's one of the killer features of ClojureScript One that I'd love to have available with noir.

I'll see if I can find the time to implement this myself and provide a pull request.

djhworld commented 12 years ago

Hey, thanks for reading the blog.

I haven't got a demo at hand, but the developers of lein cljsbuild have recently provided an update to the library + documentation on getting a REPL going - I was playing with this the other day and it's relatively easy in comparison to the instructions in the ClojureScript wiki!

https://github.com/emezeske/lein-cljsbuild/blob/0.1.2/doc/REPL.md

You basically just add

   (:require [clojure.browser.repl :as repl]))
; Use of "localhost" will only work for local development.
; Change the port to match the :repl-listen-port.
(repl/connect "http://localhost:9000/repl")

To your Clojurescript code and then run lein trampoline cljsbuild repl-listen