                       (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 load-all-js-files
  "Returns a chanel with one collection of loaded filenames on it."
  [files]
  (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}]
  (assoc file-msg :request-url
         (if url-rewriter
           (url-rewriter file)
           (resolve-url file-msg))))

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

  (go
    (before-jsload files)
    ;; evaluate the eval bodies first
    ;; for now this is only for updating dependencies
    ;; we are not handling removals
    ;; TODO handle removals
    (let [eval-bodies (filter #(:eval-body %) files)]
      (when (not-empty eval-bodies)
        (doseq [eval-body-file eval-bodies]
          (eval-body eval-body-file))
        (invalidate-dependency-cache!)))

    (let [filtered-files (filter #(and (:namespace %)
                                       (not (:eval-body %)))
                                 files)
          all-files  (expand-files-to-include-deps filtered-files)
          files'  (add-request-urls opts all-files)
          res'    (<! (load-all-js-files files'))
          res     (filter :loaded-file res')
          files-not-loaded  (filter #(not (:loaded-file %)) res')]
