         compile-state
         @compile-state-ref
 
+        things-already-loaded
+        (->> deps-to-load-with-macros
+             (filter #(set/superset? @loaded-ref (:provides %)))
+             (map :provides)
+             (reduce set/union))
+
         js-files-to-load
         (->> deps-to-load-with-macros
              (remove #(set/superset? @loaded-ref (:provides %)))

  (xhr/chan :GET path nil {:body-only true
                           :transform transit-read}))

(defn txt-load [path]
  (xhr/chan :GET path nil {:body-only true
                           :transform identity}))

(defonce empty-result-helper
  (doto (async/chan)
    (async/close!)))

;; names that where provided by the "app"
(defn set-loaded [namespaces]
  (let [loaded (into #{} (map symbol) namespaces)]
    (swap! loaded-ref set/union loaded)))

(defonce index-ref (atom nil))

