Fork me on GitHub
#polylith
<
2021-03-01
>
Fredrik Andersson10:03:18

I am very interested in the polylith architecture for many reasons. However I'm going to start working on a frontend project with clojurescript and I am unsure how polylith should be applied to a reagent, re-frame or other sort of project

Fredrik Andersson10:03:16

It would also interesting to be able to share data definitions between frontend and backend using one or multiple components

šŸ‘ 3
Fredrik Andersson10:03:45

I'm fairly new to clojure so there is alot to digest and figure out

furkan3ayraktar11:03:40

At the moment, we havenā€™t done any efforts to support Polylith in frontend development. Joakim explained our reasoning in the first answer of the https://polylith.gitbook.io/polylith/conclusion/faq. However, we are open to hear more thoughts how/if we can/should add that support. When it comes to sharing data definitions via a component, it should still be possible to do that if you are thinking to keep your frontend project in the same repo as your backend project. You can then reference them from the frontend project. We are currently working on an update to introduce deps.edn files for each component and base (following Alex Millerā€™s comments in https://github.com/polyfy/polylith/issues/66). In that case, you may be able to refer to specific components via :local/root from outside of the polylith workspace. An important note here: I havenā€™t tried this approach myself and Iā€™m not an expert when it comes to frontend development in Clojure.

Fredrik Andersson11:03:12

the way I look at Polylith is that it should contain all domain specific code for a company so that it would be easy to reuse components when starting a new project

Fredrik Andersson11:03:45

also the strictness of components makes it easy to define tasks for developers to build a component

Fredrik Andersson11:03:43

so I would like to keep all code in the same repository with some convention saying whats frontend only or backend only

Fredrik Andersson11:03:11

but yeah, i realise that frontend is quite hard to do componentized since it's all context dependent

David Vujic11:03:37

I think it could be solved with some tweaks, maybe with different ā€œdevā€ namespaces? If you would like frontend and backend to share the same repo, I mean. The REPL would need to run in different contexts, right? Java and JavaScript as the runtimes. Shared code could be cljc files. Iā€™m only guessing here šŸ˜„

Fredrik Andersson12:03:18

the base would define what environment the components would run in

Fredrik Andersson12:03:09

the reason I ask is ofcourse that I don't really know> But I'm investigating the possibilities

šŸ‘ 3