polylith

https://polylith.gitbook.io/ and https://github.com/polyfy/polylith
Fredrik Andersson 2021-03-01T10:54:18.002800Z

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 Andersson 2021-03-01T10:55:16.003900Z

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

šŸ‘ 1
Fredrik Andersson 2021-03-01T10:55:45.004500Z

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

furkan3ayraktar 2021-03-01T11:03:40.010900Z

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 Andersson 2021-03-01T11:04:42.011900Z

allright, thanks

Fredrik Andersson 2021-03-01T11:06:12.013400Z

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 Andersson 2021-03-01T11:06:45.014100Z

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

Fredrik Andersson 2021-03-01T11:07:43.015Z

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

Fredrik Andersson 2021-03-01T11:09:11.015700Z

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

2021-03-01T11:36:37.021300Z

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 Andersson 2021-03-01T12:41:18.022200Z

the base would define what environment the components would run in

Fredrik Andersson 2021-03-01T12:43:09.022800Z

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

šŸ‘ 1