I'm trying to start a ClojureScript REPL in a browser. Ideally I'd like not to use Austin yet: I first want to get the simplest REPL possible working.
I tried following various tutorials and so far I didn't manage to make it work. Basically I don't understand what people mean when they say: "Start the ClojureScript browser REPL".
So far I did:
lein new mies hellow
And:
lein cljsbuild auto hellow
And here's my core.js file:
(ns hellow.core
(:require [clojure.browser.repl :as repl]))
(enable-console-print!)
(println "Hello world!")
(. js/console (log "Hello again"))
(repl/connect "http://localhost:9000/repl")
(. js/console (log "Ah, this prints too"))
When I open my index.html (which calls core.js), I can see in Chrome's developer tools's JavaScript console that everything is correctly logged.
However the (repl/connect ...) obviously fails. Here's what Chrome's developer tools shows;
Failed to load resource http://localhost:9000/repl?xpc=%7B%22cn%22%...
In nearly every forum post / blog entry / tutorial about ClojureScript I read about that subject, I stumble upon a line saying: "Start the browser REPL" or something similar.
How do I start the browser REPL? Is this something that must be done before loading index.html from the browser?
Can I start this browser REPL from Emacs?
How can I test that the browser REPL is working without loading index.html / core.js?
How can I then verify, after index.html / core.js is loaded in the browser, that the (repl/connect ...) inside core.js did work and is actually connected to the REPL?