Fork me on GitHub
#component
<
2016-10-10
>
donaldball16:10:16

I have a variation on rick’s question, in fact

donaldball16:10:25

My foo.system ns tends to have a ton of requires since it orchestrates all the other components. no big deal generally, but now I have a project where I want to build separate client and server artifacts, and only include in the uberjars the necessary dependencies

donaldball16:10:57

The one foo.system ns inhibits that. How bad an idea is it to inline the requires when building a component? E.g.

donaldball16:10:11

(defn build-console
  []
  (require 'bleach.system.console)
  (bleach.system.console/system-console))

seancorfield20:10:13

@donaldball I do that for test systems — each component has a test-system function that can be used by unit/integration tests to build a testable system and I do the require at runtime there so only the test tasks (in build.boot need to bring in the actual dependencies).

noisesmith22:10:23

donaldball the problem with that is that build-console won't compile as written. But using resolve fixes that replace the call with ((resolve 'bleach.system.console/system-console))

noisesmith22:10:55

inner parens find the var, outer invoke it, and vars call their function value when invoked