These are chat archives for jdubray/sam

26th
Aug 2017
Fred Daoud
@foxdonut
Aug 26 2017 00:41
@Vertex21 fwiw you could use SAM with Mithril.
You would just use @jdubray 's example but use Mithril instead of React as the vdom library.
Vertex21
@Vertex21
Aug 26 2017 00:44
@foxdonut Do you think it's worth worrying about that Lichess made that switch to Snabbdom? Does Snabbdom perform that much better that it was worth that swap?
Fred Daoud
@foxdonut
Aug 26 2017 00:49
@Vertex21 I never got a real answer on whether that was the reason. Also, they were using Mithril 0.2, not 1.x. We also don't know whether they made any effort to figure out why their code was less performant (if that was the issue) with Mithril, there could have been some possible improvements. Finally, it also depends on the kind of application you are building; a game with lots of graphics and animation would be more performance-sensitive. If you're building a data/table/form/etc. type of application, less so. I wouldn't worry unless you were building an app where fps was an issue, and even then, I would get some real evidence on Mithril vs Snabbdom performance.
Vertex21
@Vertex21
Aug 26 2017 00:52
That definitely makes sense.. I just worry about scalability in the future too much I guess.. lol
Fred Daoud
@foxdonut
Aug 26 2017 01:14
@Vertex21 well if you're worried you could always just go with Snabbdom, it's really not a huge difference.
Most notable is that you have to distinguish between attributes and properties.
Jean-Jacques Dubray
@jdubray
Aug 26 2017 01:41
Great perspective from Kyle Simpson on componentized UI https://t.co/nuoYZ9kALa?amp=1
Vertex21
@Vertex21
Aug 26 2017 16:18
Good musings.. Isn't his example just an example of poor architecture though? It seems like if LI had put enough thought into it they would have had all three of those alert areas part of the same "component"
I think the main issue is "micro"-componentized UI.. It's broken down too far in a lot of cases.
Jean-Jacques Dubray
@jdubray
Aug 26 2017 17:39
@Vertex21 actually, I am not sure it works that way, as I mentioned, I don't believe you can always define a boundary of the view components that matches the natural boundaries of the model. That's a traditional problem in SOA/Microservices. User Interfaces have become so complext that we are seeing the same kind of dilema poping up.
Vertex21
@Vertex21
Aug 26 2017 17:48
Good point.. Is this something the SAM model addresses or is this a separate issue?
Jean-Jacques Dubray
@jdubray
Aug 26 2017 17:59
SAM addresses these questiosn by having a "building block" approach. SAM building blocks are individually reusable:
  • a view component (props and events/intents)
  • an action
  • a model acceptor
  • a "reactor" (~ blocks of computed values in the State function)
  • "states" (computed value) and their relationship to next-action
This means that several view component can be "wired" to the same action, an action can trigger multiple acceptors, an acceptor can be triggered by different action (proposals)
The unit of reuse are these individual building blocks there is no "component" that ties them together.
Fred Daoud
@foxdonut
Aug 26 2017 19:26
@Vertex21 if you are worried about performance you could also consider InfernoJs.