Created
August 27, 2014 03:33
-
-
Save alvinfrancis/3014bfcf53378450d8c0 to your computer and use it in GitHub Desktop.
Clojurescript dev profile for browser-repl with Austin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:shared {:clean-targets ["out" :target-path]} | |
:dev [:shared | |
{:resources-paths ["dev-resources"] | |
:source-paths ["dev-resources/tools/repl"] | |
:plugins [[com.cemerick/austin "0.1.4"]] | |
:injections [(require 'cemerick.austin.repls) | |
(defn browser-repl-env [] | |
(reset! cemerick.austin.repls/browser-repl-env | |
(cemerick.austin/repl-env))) | |
(defn browser-repl [] | |
(cemerick.austin.repls/cljs-repl (browser-repl-env)) | |
(println (cemerick.austin.repls/browser-connected-repl-js)))]}]} |
NOTE (to self): Use Weasel instead of austin. This profile is deprecated.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use with Emacs Cider:
cider-jack-in
on an open Clojurescript file. Run(browser-repl)
in the open cider repl. The printed value must be run in a target HTML document (e.g. add<script>
tags to the end of the document containing the value.(browser-repl)
will leave the repl in a Clojurescript repl attached to any open browser that has run the prior generated value.This is a bare minimum necessary to easily take advantage of Austin's browser repl. Ideally, however, it's better to serve the documents using Clojure (Ring, Compojure), to easily allow generating the value of (cemerick.austin.repls/browser-connected-repl-js) as part of a served HTML file by using templating libraries (Enlive, Hickory).