   ([request-url] (reload-file* request-url identity)))
 
 (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?]

(defonce ns-meta-data (atom {}))

;; this assumes no query string on url
(defn add-cache-buster [url] (.makeUnique (guri/parse url)))

(defn ns-to-js-file [ns] (str (string/replace ns "." "/") ".js"))

(defn resolve-ns [ns]
  (str (string/replace (.-basePath js/goog) #"(.*)goog/" #(str %2))
       (ns-to-js-file ns)))


  (set! (.-provide js/goog) (.-exportPath_ js/goog))
  (set! (.-CLOSURE_IMPORT_SCRIPT (.-global js/goog)) reload-file*))

(defmulti resolve-url :type)

(defmethod resolve-url :default [{:keys [file]}] file)

(defmethod resolve-url :namespace [{:keys [namespace]}]
  (dev-assert (string? namespace))
  (resolve-ns namespace))

(defmulti reload-base utils/host-env?)

(defmethod reload-base :node [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 "/" request-url)]
    (aset (.-cache js/require) path nil)
