                       (utils/log :error (str  "Figwheel: Error loading file " request-url))
                       (apply callback [file-msg]))))))
 
-(defn reload-file? [{:keys [request-url namespace dependency-file meta-data] :as file-msg}]
+(defn reload-file? [{:keys [request-url namespace meta-data] :as file-msg}]
+  (dev-assert (namespace-file-map? file-msg))
   (and 
-   (or dependency-file
-       (and meta-data (:figwheel-load meta-data))
+   (or (and meta-data (:figwheel-load meta-data))
        ;; IMPORTANT make sure this file is currently provided
        (contains? *loaded-libs* namespace)
        #_(.isProvided_ js/goog (name namespace)))


(defn reload-file [{:keys [request-url] :as file-msg} callback]
  (dev-assert (string? request-url)
              (map? file-msg)
              (not (nil? callback)))
  (utils/debug-prn (str "FigWheel: Attempting to load " request-url))
  (reload-file* request-url
                (fn [success?]

(defn load-all-js-files
  "Returns a chanel with one collection of loaded filenames on it."
  [files]
  (let [out (chan)]
    (go-loop [[f & fs] files]
      (if-not (nil? f)
        (do (put! out (<! (reload-js-file f)))
            (recur fs))
        (close! out)))
    (async/into [] out))
  ;; the following is a parallel load which is facter but non-deterministic
  #_(async/into [] (async/filter< identity (async/merge (mapv reload-js-file files)))))


(defn add-request-url [{:keys [url-rewriter] :as opts} {:keys [file] :as file-msg}]
  (let [resolved-path (resolve-url file-msg)]
    (assoc file-msg :request-url
           (if url-rewriter
             (url-rewriter resolved-path)
             resolved-path))))

(defn add-request-urls [opts files]
  (map (partial add-request-url opts) files))
