Fork me on GitHub
#carry
<
2017-05-25
>
albaker13:05:44

@metametadata so it looks like Carry provides a more organized signal dispatch system, based on a pseudo FSM blueprint model, and you can basically plug-in any of the other frameworks with it (e.g. reagent) ?

metametadata15:05:38

@albaker I think it does resemble a FSM, in a sense, but the the terminology is not the same and it happened accidentally anyways 🙂 Yes, using any UI framework (reagent, rum, etc.) was one of the goals. Another goal was being able to implement time traveling debugger. This explains why there are 2 kinds of "events" distinguished: signals and actions. Only actions (model mutations) can be replayed. In this regard it looks very similar to VueX architecture (https://github.com/vuejs/vuex). Funnily enough, I haven't used the provided debugger for work because its GUI is not useful with big models yet 🙂

viesti16:05:35

quite close to using in production here

viesti16:05:42

although if starting anew, would reconcider re-frame, for it has subscriptions and maybe more eyes are looking at it 🙂

viesti16:05:56

might be that the “any ui framework” goal made understanding how data is passed to reagent a bit complex, at least for me

albaker18:05:22

@viesti do you mean the carry signals have some issues compared to re-frame subscriptions? I kind of liked the blueprint/signal as a way to tie everything together

viesti18:05:43

signals/actions are for changing state, subscriptions (in re-frame) are for observing state

metametadata18:05:17

@viesti nice to know that someone uses it! Yeah, although re-frame is definitely more battle tested, I feel pretty confident about the Carry pattern since it closely resembles the other "proofed" frameworks like Redux and co. Speaking about hidden bugs, there's not much LOC to break in the core, so potentially error-prone code can be mostly in additional packages, e.g. carry-history. I see your point about passing data. Maybe I could a better job explaining the Reagent reactions, at the moment it's kinda terse and points the reader to learn about them elsewhere.

metametadata18:05:15

Do you have any examples of particular pain points that subscriptions could solve better (vs. using raw Reagent reactions as in Carry examples)?

viesti18:05:44

maybe a case when app state becomes larger

viesti18:05:21

on how to pass state onwards from root component to leaves

viesti18:05:08

I'd think that explaining reactions would help too

viesti18:05:22

I had made one React Native app so redux was familiar and the lack of behind-scenes global state made carry appealing (although the latter point might not be a deal-breaker for me now)

metametadata19:05:33

Got it, thank you for your input! Speaking about Reagent, I think I also stumbled upon the same problems: it was not always obvious how it would redraw the screen depending on the wiring between the components. I think that it's primarily a problem with Reagent and one would have the same struggles at first with any React wrapper 😄

metametadata19:05:07

To deal with a bigger app I use the approach from this example: https://github.com/metametadata/carry/tree/master/examples/blueprint-splitting-hof. E.g. view-model is merged from several smaller view-models residing in independent folders (where folder is created per screen).