This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-22
Channels
- # architecture (1)
- # aws (3)
- # beginners (78)
- # boot (33)
- # cider (49)
- # cljs-dev (3)
- # clojure (82)
- # clojure-berlin (2)
- # clojure-dusseldorf (14)
- # clojure-gamedev (75)
- # clojure-italy (15)
- # clojure-nl (2)
- # clojure-poland (9)
- # clojure-russia (1)
- # clojure-spec (11)
- # clojure-uk (91)
- # clojurescript (17)
- # core-async (2)
- # cursive (1)
- # data-science (3)
- # datascript (34)
- # datomic (13)
- # docs (2)
- # duct (32)
- # emacs (8)
- # fulcro (95)
- # instaparse (17)
- # jobs (2)
- # jobs-discuss (1)
- # jobs-rus (4)
- # leiningen (1)
- # luminus (1)
- # lumo (4)
- # mount (1)
- # nrepl (1)
- # off-topic (98)
- # onyx (13)
- # portkey (12)
- # re-frame (10)
- # reagent (11)
- # remote-jobs (4)
- # rum (3)
- # shadow-cljs (34)
- # specter (7)
- # sql (1)
- # tools-deps (8)
@weavejester I've followed your advice with slight modification. I created my own module as I need an access to the config (compile paths). Now how can I overwrite :duct.compiler/cljs in the development env?
@lambder I’m not sure I understand the question. You just check to see if :duct.core/environment
is :development
or :production
, and modify things accordingly. May I ask why you want to use lein figwheel
over Duct’s integrated Figwheel?
e.g. in development config I'd like to have :duct.compiler/cljs nil
to remove the generated config
Sure. Modules are designed to defer to the user’s configuration, and if you’re writing your own module you can set it after the cljs
module. Or just not include the cljs
module at all.
The modules are functions that are applied to the configuration after it is read.
They run after any :duct.core/include
s are added.
You can, just by running after them.
You can set a module’s dependencies, making it dependent on there being certain keys in the configuration.
So you can create a module that is dependent on the :duct.module/cljs
key already being available, for example.
In the next version of Duct the dependency resolution of modules is improved further, but I’m still working on that.
The next version of Duct should be out in a month or two, and uses Integrant’s refs and refsets as the dependency resolution mechanism, instead of a :req
key as it is currently.
Here’s some info on the current system: https://github.com/duct-framework/core#modules
May I also enquire why you’re using lein figwheel
over the inbuilt figwheel?
@weavejester I'm trying to do something quite similar, but I'm not sure I'm doing it right. I want my module to be run after duct.module/cljs has been run. I'm using :req #{duct.module/cljs}
in my init-key multi-method, but when my module function is run, I don't see any of duct.module/cljs keys in the config var. Right now I'm using a dirty hack to achieve what I need: I add a #ig/ref to :duct.module/cljs in my module config map, and then invoke the :duct/module/cljs function myself before running my module's code.
@iarenaza That might be a result of how the modules dependencies are currently worked out. The next version should have much better dependency resolution of modules.