component

donaldball 2016-10-10T16:34:16.000051Z

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

donaldball 2016-10-10T16:35:25.000052Z

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

donaldball 2016-10-10T16:35:57.000053Z

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

donaldball 2016-10-10T16:36:11.000054Z

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

seancorfield 2016-10-10T20:34:13.000055Z

@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).

2016-10-10T22:36:23.000056Z

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))

2016-10-10T22:36:55.000057Z

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