(defn
reload-js-files
[{:keys [before-jsload on-jsload reload-dependents], :as opts}
{:keys [files figwheel-meta recompile-dependents], :as msg}]
(when-not
(empty? figwheel-meta)
(reset! figwheel-meta-pragmas figwheel-meta))
(go
(before-jsload files)
(before-jsload-custom-event files)
(let
[eval-bodies
(filter (fn* [p1__18490#] (:eval-body p1__18490#)) files)]
(when
(not-empty eval-bodies)
(doseq
[eval-body-file eval-bodies]
(eval-body eval-body-file opts))))
(reset! dependencies-loaded (list))
(let
[all-files
(filter
(fn*
[p1__18491#]
(and
(:namespace p1__18491#)
(not (:eval-body p1__18491#))
(not (figwheel-no-load? p1__18491#))))
files)
all-files
(concat all-files (get-figwheel-always))
all-files
(if
(or reload-dependents recompile-dependents)
(expand-files all-files)
(sort-files all-files))
res'
(<! (load-all-js-files all-files))
res
(filter :loaded-file res')
files-not-loaded
(filter (fn* [p1__18492#] (not (:loaded-file p1__18492#))) res')
dependencies-that-loaded
(filter :loaded-file @dependencies-loaded)]
(when
(not-empty dependencies-that-loaded)
(utils/log :debug "Figwheel: loaded these dependencies")
(utils/log
(pr-str
(map
(fn
[{:keys [request-url]}]
(string/replace request-url goog/basePath ""))
(reverse dependencies-that-loaded)))))
(when
(not-empty res)
(utils/log :debug "Figwheel: loaded these files")
(utils/log
(pr-str
(map
(fn
[{:keys [namespace file]}]
(if namespace (name->path (name namespace)) file))
res)))
(js/setTimeout
(fn* [] (do (on-jsload-custom-event res) (apply on-jsload [res])))
10))
(when
(not-empty files-not-loaded)
(utils/log :debug "Figwheel: NOT loading these files ")
(let
[{:keys [figwheel-no-load not-required]}
(group-by
(fn
[{:keys [namespace]}]
(let
[meta-data (get @figwheel-meta-pragmas (name namespace))]
(cond
(nil? meta-data)
:not-required
(meta-data :figwheel-no-load)
:figwheel-no-load
:else
:not-required)))
files-not-loaded)]
(when
(not-empty figwheel-no-load)
(utils/log
(str
"figwheel-no-load meta-data: "
(pr-str (map (comp name->path :namespace) figwheel-no-load)))))
(when
(not-empty not-required)
(utils/log
(str "not required: " (pr-str (map :file not-required))))))))))