These are chat archives for jdubray/sam

6th
Mar 2018
Jean-Jacques Dubray
@jdubray
Mar 06 2018 14:56
TBH, I'd be really interested in understanding the rationale for their state management, knowing all that we know in 2018.
Paolo Furini
@pfurini
Mar 06 2018 14:59
That's the weakest point I fear.. like I said before, it seems an afterthought
It seems more or less the same approach with polymer, where everything is tied with component instances, so there should be some component holding the state
see for example this article, this kind of hacks are simply awful (after a quick skim through it): https://medium.com/@maksimrv/reactive-app-state-in-flutter-73f829bcf6a7
Paolo Furini
@pfurini
Mar 06 2018 15:06
and see the (somewhat) official redux implementation for flutter: https://pub.dartlang.org/packages/flutter_redux
it's hacky as well, because in flutter it seems "standard" to derive widget from StatefulWidget component, thus tying every component with its state, without abstraction and proper orchestration
To go around it, one should derive widgets (components) from StatelessWidget instead, and delegate the state management to other headless widgets, holding state
Paolo Furini
@pfurini
Mar 06 2018 15:11
Probably it could be possible to build some similar approach taken by the flutter_redux package, implementing SAM pattern, but I don't know if it will fit well with the flutter architecture
Paolo Furini
@pfurini
Mar 06 2018 15:21
yes, it should be possible to fork the flutter_redux package, and build corresponding SAM widgets to handle state.. instead of dispatching actions directly to the store, we could dispatch them to the SAM instance, that in turn will be responsible to present them to the model. Then the StoreConnector widget will become StateConnector, and will react on state representation changes instead of being directly tied to state (model) mutations
in the end you'll have a purely reactive pattern, and it should be pretty efficient
Leszek Żarna
@leszarna_twitter
Mar 06 2018 19:13
Yesterday wanted to read some links like this https://www.ebpml.org/blog2/index.php/2015/04/12/star-based-component-model and site is down. Didn't want to bother, not sure if you know.
Jean-Jacques Dubray
@jdubray
Mar 06 2018 21:54
@leszarna_twitter thank you. I have had some problems lately. I need to reboot my server.
devin ivy
@devinivy
Mar 06 2018 22:14

don't read into that article too much—it was received as being somewhat inaccurate by the community.

https://twitter.com/Real_CSS_Tricks/status/970309158183604225

Paolo Furini
@pfurini
Mar 06 2018 23:52
anyway, this summarize my exact feelings: I agree that redux often comes with unnecessary complexity for [pretty much everything]"