                  (recur))))
     (fn [msg-hist] (put! ch msg-hist) msg-hist)))
 
+(defn eval-javascript [message]
+  (let [code (:code message)]
+    {:figwheel-event "callback"
+     :callback-name (:callback-name message) 
+     :content (try
+                {:status :success, :value (str (js* "eval(~{code})"))}
+                (catch js/Error e
+                  {:status :exception
+                   :value (pr-str e)
+                   :stacktrace (if (.hasOwnProperty e "stack")
+                                 (.-stack e)
+                                 "No stacktrace available.")})
+                (catch :default e
+                  {:status :exception
+                   :value (pr-str e)
+                   :stacktrace "No stacktrace available."}))}))
+
+
+(defn repl-plugin [opts]
+  (fn [msg-hist']
+    (let [msg-hist (focus-msgs #{:repl-eval} msg-hist')
+          msg (first msg-hist)]
+      (when (= :repl-eval (:msg-name msg))
+        (let [res (eval-javascript msg)]
+          (socket/send! res))))))
+
 (defn css-reloader-plugin [opts]
   (fn [[{:keys [msg-name] :as msg} & _]]
     (when (= msg-name :css-files-changed)

(defn css-loaded-state? [msg-names]
  (= :css-files-changed (first msg-names)))

;; 
(defn file-reloader-plugin [opts]
  (let [ch (chan)]
    (go-loop []

  (.warn js/console "Figwheel: Compile Warning -" message)
  w)

(defn default-before-load [files]
  (.debug js/console "Figwheel: notified of file changes")
  files)
