Fork me on GitHub
#duct
<
2018-03-25
>
beta103621:03:24

is compojure needed when using module.ataraxy?

beta103621:03:50

the cascading router is still being loaded for some reason.

weavejester21:03:05

@beta1036 It shouldn’t be unless there’s a key in the configuration that references it.

weavejester21:03:27

By “loaded” you mean loading the namespace, or having it as a dependency?

beta103622:03:36

the cascading namespace is loaded and that fails, because I excluded compojure from the dependencies.

beta103622:03:10

i have :duct.module/ataraxy and :duct.module.web/api keys.

weavejester22:03:31

Does your prepped configuration have :duct.router/cascading?

beta103622:03:58

i get an exception while prepping.

beta103622:03:21

while prep is loading namespaces, to be more precise.

weavejester22:03:32

What’s the exception?

beta103622:03:54

CompilerException java.io.FileNotFoundException: Could not locate compojure/core__init.class or compojure/core.clj on classpath., compiling:(duct/router/cascading.clj:1:1)

weavejester22:03:09

What’s the stacktrace?

weavejester22:03:56

Try commenting out the line that excludes Compojure from the dependencies, and then prepping the configuration

beta103622:03:58

and the config is

{:duct.core/project-ns  demo
 :duct.core/environment :production

 :duct.module/logging {}
 :duct.server.http/aleph {}
 :duct.module.web/api {}

 :duct.module/ataraxy
 {[:get "/example" #{?q}] [:example ?q]}

 :demo.handler/example
 {}}

weavejester22:03:06

Also, what versions are you using?

beta103622:03:45

duct/core "0.6.2", duct/module.web "0.6.4", duct/module.ataraxy "0.2.0", duct/server.http.aleph "0.1.2"

beta103622:03:32

the rest are non-duct dependencies plus integrant/repl "0.2.0"

weavejester22:03:38

What does the configuration look like when you include Compojure in your deps and prep it?

weavejester22:03:30

It looks like the cascading router has been inserted into the configuration by something.

beta103622:03:21

isn't :duct.module.web/api doing that?

weavejester22:03:39

Maybe, though it’s not supposed to. It might be an issue with the ordering of modules. Try adding a blank :duct.router/ataraxy {} to your configuration and see if that helps.

beta103622:03:14

that solves the problem indeed.

beta103622:03:07

can one influence the order modules are applied?

weavejester22:03:39

Looks like an ordering issue. I believe I understand why the problem occurs. I’m refactoring how module dependencies work for the next version, so it shouldn’t be an issue for much longer.

beta103622:03:39

have documented your plan somewhere yet?

beta103622:03:07

or is it visible in github already?

weavejester22:03:56

It’s in duct/core, but I’m still experimenting with the behaviour. I don’t have a full write-up yet, but there are a few comments where I’ve written down ideas (https://github.com/duct-framework/core/issues/6#issuecomment-355597276)

weavejester22:03:45

The main changes are: Integrant gets refsets and prep-key Duct core gets #duct/include Modules and normal configuration keys are separated

beta103622:03:58

thank you for your help and the info

weavejester22:03:37

The new design has a number of advantages, and I have a full explanation/migration document planned. There will be a few breaking changes, but I’ll explain them in the migration guide.