 ;; config :reload-clj-files false
 ;; :reload-clj-files {:clj true :cljc false}
 
+;; simple protection against printing the compiler env
+(defrecord WatchInfo [id paths options compiler-env reload-config])
+(defmethod print-method WatchInfo [wi ^java.io.Writer writer]
+  (.write writer (pr-str
+                  (cond-> (merge {} wi)
+                    (:compiler-env wi) (assoc :compiler-env 'compiler-env...)))))
+
 (defn watch-build [id inputs opts cenv & [reload-config]]
   (when-let [inputs (if (coll? inputs) inputs [inputs])]
-    (fww/add-watch! id
-                {:paths inputs
-                 :filter (fww/suffix-filter (into #{"cljs" "js"}
-                                              (cond
-                                                (coll? (:reload-clj-files reload-config))
-                                                (mapv name (:reload-clj-files reload-config))
-                                                (false? (:reload-clj-files reload-config)) []
-                                                :else ["clj" "cljc"])))
-                 :handler (fww/throttle
-                           50
-                           (fn [evts]
-                             (binding [cljs.env/*compiler* cenv]
-                               (let [files (mapv (comp #(.getCanonicalPath %) :file) evts)
-                                     inputs (if (coll? inputs) (apply bapi/inputs inputs) inputs)]
-                                 (try
-                                   (when-let [clj-files
-                                              (not-empty
-                                               (filter
-                                                #(or (.endsWith % ".clj")
-                                                     (.endsWith % ".cljc"))
-                                                files))]
-                                     (figwheel.core/reload-clj-files clj-files))
-                                   (figwheel.core/build inputs opts cenv files)
-                                   (catch Throwable t
-                                     #_(clojure.pprint/pprint
-                                        (Throwable->map t))
-                                     (figwheel.core/notify-on-exception cenv t {})
-                                     false))))))})))
+    (fww/add-watch!
+     id
+     (merge
+      {::watch-info (merge
+                     (:extra-info reload-config)
+                     {:id id
+                      :paths inputs
+                      :options opts
+                      :compiler-env cenv
+                      :reload-config reload-config})}
+      {:paths inputs
+       :filter (fww/suffix-filter (into #{"cljs" "js"}
+                                        (cond
+                                          (coll? (:reload-clj-files reload-config))
+                                          (mapv name (:reload-clj-files reload-config))
+                                          (false? (:reload-clj-files reload-config)) []
+                                          :else ["clj" "cljc"])))
+       :handler (fww/throttle
+                 50
+                 (fn [evts]
+                   (binding [cljs.env/*compiler* cenv]
+                     (let [files (mapv (comp #(.getCanonicalPath %) :file) evts)
+                           inputs (if (coll? inputs) (apply bapi/inputs inputs) inputs)]
+                       (try
+                         (when-let [clj-files
+                                    (not-empty
+                                     (filter
+                                      #(or (.endsWith % ".clj")
+                                           (.endsWith % ".cljc"))
+                                      files))]
+                           (figwheel.core/reload-clj-files clj-files))
+                         (figwheel.core/build inputs opts cenv files)
+                         (catch Throwable t
+                           #_(clojure.pprint/pprint
+                              (Throwable->map t))
+                           (figwheel.core/notify-on-exception cenv t {})
+                           false))))))}))))
 
 (def validate-config!
   (if (try

    (let [config-edn (process-figwheel-main-edn
                      (fetch-figwheel-main-edn cfg))]
      (-> cfg
          (update :repl-env-options
                  merge (select-keys config-edn
                                     [:ring-server
                                      :ring-server-options
                                      :ring-stack
                                      :ring-stack-options
                                      :ring-handler]))
          (update ::config merge config-edn)))))

(defn- config-merge-current-build-conf [{:keys [::extra-config ::build] :as cfg}]

;; takes the correct config
;; and make an adapter function that produces the correct args for this fn
(defn default-compile [repl-env-fn cfg]
  (let [{:keys [options repl-options repl-env-options ::config] :as b-cfg} (update-config cfg)
        {:keys [mode pprint-config]} config
        repl-env (apply repl-env-fn (mapcat identity repl-env-options))
        cenv (cljs.env/default-compiler-env)]
    (cljs.env/with-compiler-env cenv
      (if pprint-config
        (do (clojure.pprint/pprint b-cfg) b-cfg)
        (binding [cljs.repl/*repl-env* repl-env]
          (let [fw-mode? (figwheel-mode? b-cfg)]
            (build config options cenv)
            (when-not (= mode :build-once)
              (start-background-builds cfg)
              (doseq [init-fn (::initializers b-cfg)] (init-fn))
              (cond
                (= mode :repl)
                ;; this forwards command line args
                (repl repl-env repl-options)
                (or (= mode :serve) fw-mode?)
                ;; we need to get the server host:port args
                (serve {:repl-env repl-env
                        :repl-options repl-options
                        ;; TODO need to iterate through the inits
                        :eval-str (when fw-mode? (start-figwheel-code config))
                        :join? (get b-cfg ::join-server? true)})))))))))

(defn start [{:keys [figwheel-options build join-server?]}]
  (let [[build-id build-options] (if (map? build)
