Fork me on GitHub
#polylith
<
2023-10-05
>
growthesque10:10:59

Hey guys, new to clojure and polylith I saw the polylith architecture and got interested in Clojure. Curious if Polylith pairs well with any of the Clojure web frameworks like Kit for example or if one needs to refactor a lot of Kit to make it Polylith-like? I am a solo developer building MVPs and looking into Polylith and frameworks to make my life easier, so curious what you think. Thanks.

tengstrand03:10:12

Hi @U05V9JANJQK! Currently, the poly tool only supports backend code, but it's on our list to also support ClojureScript together with https://github.com/thheller/shadow-cljs (which will also support cljs for the backend). You can read more about it https://github.com/polyfy/polylith/discussions/301 and follow or participate in the discussion.

❤️ 1
growthesque10:10:21

Ah, that's good news. Still I am curious if it's a good idea to pair a web framework/template with Poly in principle or if Poly works best when rolling your own stack so as not to conflict with some opinions that a framework might have?

Patrix03:10:56

I've refactored a kit app to use polylith. It essentially boiled down to starting a polylith app from scratch and adding the libraries that Kit uses to the mix and re-creating some of the Kit boilerplate (esp. around the repl-driven development). Note: I wasn't using "kit modules" but directly using the libraries that Kit depends on, like ring or next.jdbc or migratus, etc) Bonus: I have a lot more knowledge now of how Kit works and how to build a a web app from components and libraries, not so dependent on Kit anymore. And I've swapped out ring/etc with Pedestal.

Patrix03:10:26

My frontend uses htmx so I haven't had to deal with cljs

growthesque10:10:40

Would you be interested in open sourcing your Kit/Polylith edition?

Patrix04:10:18

@U05V9JANJQK - I cannot publicly release the source of this particular project, however I have a (personal) project that I was considering releasing at some point. It might need a bit of cleanup first but uses a similar architecture (though an earlier iteration) - polylith + pedestal + next.jdbc + htmx I just realized that I rewrote the whole thing in Common Lisp, so that's not the personal project where I used poly+pedestal+htmx... Anyway if I find/do something that can be open sourced I definitely will!