                              :client-js nil}))
 
 (def loaded-libs (atom #{}))
+(def preloaded-libs (atom #{}))
 
 (defn- connection
   "Promise to return a connection when one is available. If a

      (spit file (compile-client-js opts)))
    file))

(defn repl-env [& {:as opts}]
  (let [opts (merge {:port          9000
                     :optimizations :simple
                     :working-dir   ".repl"
                     :serve-static  true
                     :static-dir    ["." "out/"]}
                    opts)]
    (do (swap! server-state
               (fn [old] (assoc old :client-js
                               (future (create-client-js-file
                                        opts

(defmulti handle-post (fn [_ m] (:type m)))

(defmethod handle-post :ready [conn _]
  (do (reset! loaded-libs @preloaded-libs)
      (send ordering (fn [_] {:expecting nil :fns {}}))
      (send-for-eval conn
                     (cljsc/-compile
