   ;; this is the new way where if additional changes are needed they
   ;; are made explicitely
   ([state old-mtimes new-mtimes additional-ns]
-   (binding [*transitive-dep-cache* (atom {})]
+   (binding [*transitive-dep-fn* (create-ns-dependents-fn)]
      (notify-cljs-ns-changes state
        (set (concat additional-ns
                     (keep get-ns-from-source-file-path

        :eval-body (slurp %)})
   (dependency-files st)))

(def ^:dynamic *transitive-dep-cache* false)

(defn transitive-dependents [nm]
  (let [cached (get-in @*transitive-dep-cache* (name nm))]
    (if (not (nil? cached))
      cached
      (let [res (set (ana/ns-dependents nm))]
        (swap! *transitive-dep-cache* assoc (name nm) res)
        res))))

(defn topo-compare [nm nm2]
  (cond
    (= nm nm2) 0
    (get (transitive-dependents nm) nm2) -1
    :else 1))

(defn mark-changed-ns [state ns-syms]
  (mapv (fn [nm]

                     (if (target-file-changed? state nm) true false)))
        ns-syms))

(defn find-figwheel-always []
  (set (filter (fn [n] (-> n meta :figwheel-always)) (ana-api/all-ns))))

