This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-21
Channels
- # admin-announcements (1)
- # announcements (6)
- # babashka (8)
- # beginners (134)
- # calva (18)
- # chlorine-clover (1)
- # cider (6)
- # circleci (6)
- # clj-commons (111)
- # cljsrn (13)
- # clojure (95)
- # clojure-australia (2)
- # clojure-europe (15)
- # clojure-nl (1)
- # clojure-spec (52)
- # clojure-uk (17)
- # clojurescript (4)
- # datavis (9)
- # datomic (8)
- # docker (2)
- # emacs (15)
- # events (7)
- # fulcro (6)
- # graphql (1)
- # gratitude (1)
- # introduce-yourself (2)
- # kaocha (8)
- # meander (87)
- # minecraft (2)
- # music (2)
- # off-topic (20)
- # portal (119)
- # releases (1)
- # reveal (55)
- # shadow-cljs (34)
- # sql (36)
- # tools-deps (9)
- # vim (8)
- # xtdb (39)
yeah this is the kind of thing where the whole plugin architecture hits its own limits. The config
hook runs after plugins are loaded, because plugins are needed to run the hook. There is actually a mechanism for this, a plugin is really just an implementation of a plugin/-register
multimethod, which is passed the current plugin chain, and returns an updated plugin chain. Typically it just adds itself, but you can add as many plugins as you want there.
(defmethod plugin/-register ::my-plugin [_ plugins]
(->> plugins
(plugins/-register :kaocha.plugins/notifier)
(plugins/-register :kaocha.plugins/version-filter)))
This seems to work, with one difference: I ended up having to call plugins/register
without the hyphen so namespaces get loaded etc
defplugin
is really just syntactic sugar, in the end a plugin is just a map with an id and hook functions, which gets added to this list of plugins, which is then bound to plugin/*current-chain*
Thank you both! I think the register thing is going to be the solution in my case. I had been thinking about sharing a base config file but since they need to be included by path, that's a bit tricky using git deps (which is how my lib is distributed). The reader literal approach looks very neat and I might come back to it if the register one doesn't work out.