If you'd like to know the namespaces currently loaded by ClojureScript, it is easy to get some insight using a macro:
(defmacro loaded-namespaces []
`(remove nil? [~@(map (fn [ns] `(when (cljs.core/exists? ~ns) '~ns))
(sort (keys (:cljs.analyzer/namespaces @cljs.env/*compiler*))))]))
This command uses this gist to set up this macro along with a REPL:
clj -Srepro -Sdeps '{:deps {github-mfikes/gist-da9a7bde16a5087ca5c6ee2133e62be2 {:git/url "https://gist.github.com/mfikes/da9a7bde16a5087ca5c6ee2133e62be2" :sha "654749eab580390124eb12ca1d22796b37d5eff9"}}}' -m cljs.main -co @compile-opts.edn -r
Here is an example of using it:
cljs.user=> (loaded-namespaces)
(cljs.core cljs.repl cljs.spec.alpha cljs.spec.gen.alpha cljs.user clojure.browser.event clojure.browser.net clojure.browser.repl clojure.browser.repl.preload clojure.string clojure.walk)
This is the kind of dev-time macro you could refer using the new user.cljs
feature. For example: put the macro in a utils.core
Clojure file (in src/utils/core.clj
) and then in src/user.cljs
put:
(ns cljs.user
(:require-macros [utils.core :refer [loaded-namespaces]]))