duct

walterl 2020-06-13T01:34:53.121700Z

In my main config I have a :my.email/client key, which is #ig/refed by a number of other components. What's the Right Way to replace that component in my dev profile with :my.email/dev-client, so that all refs are updated automatically (so that I don't have to hunt down each reference to my.email/client and override it)?

walterl 2020-06-13T01:37:06.123Z

Even better is if it can prevent the :my.email/client key from ever being initialized, since its config is validated in ig/pre-init-spec

walterl 2020-06-13T01:45:46.128300Z

I've thought about these options: * Determining which component (real or dev client) to init in ig/init-key :my.email/client, based on config. This is quick and easy, but mixes test- and prod code, which is less nice. * Using :my.email/real-client and :my.email/dev-client keys which both derive from :my.email/client, with :my.email/real-client configured in the base profile, and :my.email/dev-client in the dev profile. However, if I do this I'll still have to dissoc :my.email/real-client from the config before initializing the system, otherwise I'll have both defined, and :my.email/real-client is still initialized.

walterl 2020-06-13T01:47:54.129400Z

I've also tried just overriding :my.email/client in my dev profile, but then it seems like all the #ig/refs to it from other components are broken

kwrooijen 2020-06-13T11:49:36.130100Z

Overriding it in dev.edn profile should work. Is :my.email/client a base profile key, or a module key?

walterl 2020-06-16T18:31:19.134Z

Thanks for your response 👍. I'll try and repro in a test project and post here.

walterl 2020-06-18T02:15:34.147300Z

I figured out a way to do it: by introducing an intermediate component :my.email/client, which is referenced by other components, and returns the component it is configured with. In the base profile it is configured with my.email/real-client, and in dev profile with my.email/dev-client.

walterl 2020-06-18T02:15:47.147500Z

This gist has more details: https://gist.github.com/walterl/70607e342ea8bf6cd3f0b5b4c97379c8

walterl 2020-06-18T02:16:39.147700Z

Is there maybe another/better way to achieve the same result?