 
 (defonce on-load-callbacks (atom {}))
 
+(defonce dependencies-loaded (atom []))
+
 (defn blocking-load [url]
   (let [out (chan)]
     (reload-file

      ;; might want to use .-visited here
      (goog/isProvided__ (name namespace))))))

(def js-reload*
  (if (= :node (utils/host-env?))
    reload-file
    require-with-callback))

(defn js-reload [{:keys [request-url namespace] :as file-msg} callback]
  (dev-assert (namespace-file-map? file-msg))
  (if (reload-file? file-msg)
    (js-reload* file-msg callback)
    (do
      (utils/debug-prn (str "Figwheel: Not trying to load file " request-url))
      (apply callback [file-msg]))))

(defn reload-js-file [file-msg]
  (let [out (chan)]
    (js/setTimeout #(js-reload file-msg (fn [url]
                                          (patch-goog-base)
                                          (put! out url)
                                          (close! out))) 0)
    out))

(defn load-all-js-files

(defn patch-goog-base []
  (defonce bootstrapped-cljs (do (bootstrap-goog-base) true)))

(def reload-file*
  (condp = (utils/host-env?)
    :node
    (fn [request-url callback]
      (dev-assert (string? request-url) (not (nil? callback)))
      (let [root (string/join "/" (reverse (drop 2 (reverse (string/split js/__dirname "/")))))
            path (str root "/" (fix-node-request-url request-url))]
        (aset (.-cache js/require) path nil)
        (callback (try
                    (js/require path)
