Here are the initial problems I wanted to address with this thing:
(set! js/document.body.innerHTML "hey")without taking the repl input/interface along with it.
Solving those problems required addressing a bunch of secondary ones as well.
:optimizations :advanced), the sandbox (
:optimizations :simple), and 'repl-libs' (
:optimizations :none), which is a dummy build (i don't use its output file) to generate source files for the sandbox to pull in. The sandbox and client can technically refer to values across their windows but it is unnatural and buggy. Letting two running applications reach into each other like that is weird, so they just serialize/deserialize messages to/from each other via the postMessage API.
Here's my diagram of swirl's implementation of Differential Sync.
Here's my running public instance, but really its designed to be run/deployed privately by you (largely because I don't want to implement an identity/authorization system or pay for actual servers right now).
If you're going to use this for an interview, definitely run your own server and make sure you're familiar with this thing's faults and quirks.
Click this button:
For manual deployment:
heroku createin the project root
git push heroku master
java $JVM_OPTS -cp target/swirl.jar clojure.main -m swirl.app.server
lein with-profile -dev cljsbuild once repl-libs sandbox client
lein cljsbuild once repl-libs
rlwrap lein figwheel sandbox client
Starts on port specified by PORT environment variable, or 5000 by default.