Fork me on GitHub
#polylith
<
2023-08-17
>
Jussi20:08:09

Hello 👋 I have inherited Polylith based Clojure project. It's a REST API using Ring. It has API project that points to API base. Inside this base it makes use of a component. Now, I am trying to find out how to make a dev version of the API which makes use of a different component. My first idea upon reading Polylith docs was to make a new project that uses this different component in its deps.edn instead of the old component in existing API project.. But it was at this point I got stumped. API base uses :require to load the component and then uses it on Clojure code level. I don't think Polylith can change those import paths, so this API base still uses old component despite what the Polylith project using it says. API base has code that I'd like to reuse. It's only a question of how to make this happen whilst keeping to Polylith style (which I'm just started to learn). Any advice would be greatly appreciated.

seancorfield20:08:38

Sounds like you want profiles and "swappable implementations" https://polylith.gitbook.io/poly/workflow/profile

Jussi20:08:43

Thank you! I'll read up on that and get back to it here. Is there actual apps or working examples? This seems like it could be one: https://github.com/polyfy/polylith/tree/master/examples/profiles

seancorfield20:08:43

I've blogged about swappable components and profiles as part of monorepo series mostly covering Polylith but also some tools.build and tools.deps stuff at https://corfield.org

Jussi20:08:05

Great, I'll see about those as well. Thanks again 🙇