 (ns figwheel.client.file-reloading
   (:require
    [goog.Uri :as guri]
+   [goog.string]
    [goog.net.jsloader :as loader]
    [clojure.string :as string]
    [cljs.core.async :refer [put! chan <! map< close! timeout alts!] :as async])

(defn get-meta-data-for-ns [ns]
  (get ns-meta-data ns))

(defn js-reload [{:keys [request-url namespace dependency-file meta-data] :as msg} callback]
  (swap! ns-meta-data assoc namespace meta-data)
  (print (pr-str @ns-meta-data))
  (if (and
       (or dependency-file
           (and meta-data (:figwheel-load meta-data))

(defn truncate-url [url]
  (-> (first (string/split url #"\?")) 
      (string/replace-first (str (.-protocol js/location) "//") "")
      (string/replace-first ".*://" "")
      (string/replace-first #"^//" "")         
      (string/replace-first #"[^\/]*" "")))

