Fork me on GitHub
#cljsrn
<
2022-03-21
>
Jonovono13:03:44

I am wondering what 'file structure' architecture people follow for cljsrn projects In typescript before, for example, I for the most part followed the ducks pattern. I'm hearing Polylith is popular in the Clojure community but not sure if people are following that with cljs/frontend apps Mostly curious rn, as I have more important things to worry about, such as learning clojure

mruzekw15:03:42

Polylith looks like it could be applied on the frontend if you're deploying to multiple targets, say mobile and web from the same codebase. Though it probably has more utility when deploying backend services with shared code. Assuming you go this direction, Fulcro has some nice documentation for splitting based on target. Basically abstracting functionality into an interface and initializing the appropriate implementation for the target. https://book.fulcrologic.com/#_working_around_inclusions Otherwise, I would just organize the frontend app in layers just like a backend system. If you were building a React/Redux like system, you would have a layer for state management fns and a layer for components. Then you bring those two together in another layer along with a global atom to store the state. It'd be worth checking out re-frame and fulcro, especially if you're already familiar with Redux (re-frame) or Relay (fulcro). Their documentation is hefty, but if you're already familiar with those architectural concepts they should be easy to grok.

Jonovono17:03:51

thanks @U1RCQD0UE. I'm very intrigued by reframe (having done sagas and redux, it sounds like a improved version of that) And exactly, thats why I was intrigued with Polylith. I have ios, android, web, desktop, etc all sharing things. The way Polylith is talked about I could see it being useful for managing that and making it easy to share components around etc (probably with some tweaks)

hadils17:03:07

Hi @U037ENVB11C. Is Expo a viable possibility for you? It will work with iOS, Android and Web.

Jonovono17:03:09

@UGNMGFJG3 was exploring it. I havn't used expo in awhile but looks like it's come along way. I have some native libraries, thats what makes it tricky working with expo, but maybe its worth a try

mruzekw17:03:27

Expo has recently added a workflow for native modules. That was also holding me back

👀 1