Classpath auto-discovery of vis extension manifests.
ONE resource per jar: META-INF/vis-extension/vis.edn. Each file
is an EDN map keyed by extension id symbol:
{git {:nses [com.acme.ext.git.core com.acme.channel.web.bot ...]}}
scan-extensions! is the primitive: it walks every URL, parses
each map, requires every namespace listed under :nses exactly
once across all URLs (so registrar side effects in those namespaces
fire), and returns the merged manifest map {<id> {:nses [...]}}.
Idempotent and memoized.
rediscover! is a test/REPL helper that drops the cache and
re-scans.
Classpath auto-discovery of vis extension manifests.
ONE resource per jar: `META-INF/vis-extension/vis.edn`. Each file
is an EDN map keyed by extension id symbol:
{git
{:nses [com.acme.ext.git.core
com.acme.channel.web.bot
...]}}
`scan-extensions!` is the primitive: it walks every URL, parses
each map, `require`s every namespace listed under `:nses` exactly
once across all URLs (so registrar side effects in those namespaces
fire), and returns the merged manifest map `{<id> {:nses [...]}}`.
Idempotent and memoized.
`rediscover!` is a test/REPL helper that drops the cache and
re-scans.Classpath path of the per-jar discovery manifest. Resource name is preserved across the SDK rename for on-disk back-compat with already-shipped extension jars.
Classpath path of the per-jar discovery manifest. Resource name is preserved across the SDK rename for on-disk back-compat with already-shipped extension jars.
(load-failures)Vec of {:source :extension-load :extension-id :extension-ns :path :class :reason} maps for every extension namespace whose
(require ns) threw during the most recent classpath scan, plus
any vis.edn that failed to parse. Empty vec when every namespace
loaded cleanly.
The shape of each entry matches (:project ctx) :warnings so
callers can splice it straight into environment context.
Vec of `{:source :extension-load :extension-id :extension-ns :path
:class :reason}` maps for every extension namespace whose
`(require ns)` threw during the most recent classpath scan, plus
any vis.edn that failed to parse. Empty vec when every namespace
loaded cleanly.
The shape of each entry matches `(:project ctx) :warnings` so
callers can splice it straight into environment context.(rediscover!)Force a fresh classpath scan, discarding the cached manifests.
Test/REPL utility - production code should use the idempotent
scan-extensions! instead.
Force a fresh classpath scan, discarding the cached manifests. Test/REPL utility - production code should use the idempotent `scan-extensions!` instead.
(scan-extensions!)Idempotent classpath scan + namespace requires. Returns the merged
parsed manifests as {<id-sym> {:nses [...]}}. Memoized on first
success; subsequent calls return the cache.
Callers that just need the require side effect to drive their own registrar (e.g. the persistence facade lazy-discovering backends on first connect) can call this directly.
Idempotent classpath scan + namespace requires. Returns the merged
parsed manifests as `{<id-sym> {:nses [...]}}`. Memoized on first
success; subsequent calls return the cache.
Callers that just need the require side effect to drive their own
registrar (e.g. the persistence facade lazy-discovering backends
on first connect) can call this directly.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |