Fork me on GitHub
#integrant
<
2023-01-28
>
Chris Lester04:01:48

I've a newbie integrant.repl question .. do I need to duplicate all of the ig/init-key \ halt-key and spec logic over to the dev namespace for the repl workflow? I'm unsure how to make the various defmethods visible from another namespace (dev.clj). Mostly would like to just re-use it while I'm debugging .. for test, mock out some of them. Or do people add that in a (comment ...) in the prod code for that use case?

imre09:01:25

Not sure I read it right but it sounds like you want to require some of the defmethod-containing namespaces in your dev ns

imre09:01:36

You can do that ina comment block as well

Chris Lester23:01:05

Thanks Imre. I'd required the set of namespaces those are in before switching to the dev namespace and for some reason expected them to be piped into the new namespace with in-ns .. it didn't seem odd at the time lol (not much sleep yesterday). Moving the require to the dev namespace fixed the issue .. and yes, comments in the namespace where I have the init-key/halt-key,etc do work. I just wasn't sure if that was common practice vs sticking the debug restart code in the user or dev ns. I suppose it's no different than using that space for debugging/testing.

robertfw18:02:18

I think the only things you would want in your dev namespace is a bit of code to load your system with development configuration, and the rest of your work can be done in the namespaces the code lives in normally. If it'd be useful to look at an example, I've got some code that shows how to hook up integrant along with aero for both local development and production, https://github.com/usefulprojects-ca/usefulprojects.ca/