These are chat archives for jdubray/sam

12th
Jul 2017
Jean-Jacques Dubray
@jdubray
Jul 12 2017 00:00
It will be very interesting how Vuex develops. I don't have much hope for Mobx
Zach Dahl
@schtauffen
Jul 12 2017 13:24
I have doubts about mobx. I might try using it on a small project, but fear it would not scale great.
Jean-Jacques Dubray
@jdubray
Jul 12 2017 15:34
It's hard to say, for me two big turn offs:
  • like react it's too reactive, I like to have control as to what renders ( as functional HTML or pub/sub)
  • the OOP stiching of Model and Actions
Fred Daoud
@foxdonut
Jul 12 2017 15:36
What were your thoughts on Cerebral @jdubray ?
Jean-Jacques Dubray
@jdubray
Jul 12 2017 15:41
It was promising, I had a call with the main author, but it never went anywhere.
Fred Daoud
@foxdonut
Jul 12 2017 16:09
Where did you hope the call to go?

I like the ideas behind Cerebral. I agree with most of its principles. I like its low-level router (url-mapper), and functional-tree looks nice (although I never tried it out.) However, the main reason I haven't tried out Cerebral is because of this:

state.set('user.prefs.style', 'dark')
state.push('user.friends', 'Joe')
state.merge('user.info', {
  email: 'cheetah@jungle.com',
  name: 'Cheetah'
})

I am reluctant to use a library that forces me to relinquish control over my model, i.e. makes my code be tied to a Cerebral-specific API to make changes to the model.

Jean-Jacques Dubray
@jdubray
Jul 12 2017 16:17
Ultimately mutation needs to be synchronized so I understand why they would want to do that, but for most (99%?) of Web Apps, that completely overkill, it's synchronized by design.
Fred Daoud
@foxdonut
Jul 12 2017 16:19
Right, I understand they need that to implement the features that they bring to the table. I just don't like the idea of everything to do with my model being tied to a library-specific API.
Jean-Jacques Dubray
@jdubray
Jul 12 2017 16:19
That's why I don't like frameworks that are too reactive because when they are tied to the model, it ends up making the mutation hard to control.
Fred Daoud
@foxdonut
Jul 12 2017 16:20
Yes, exactly.
devin ivy
@devinivy
Jul 12 2017 17:42
interesting, i haven't run into this issue! what's an example of a practical problem that occurs there?
e.g. rendering before nap completes?
it also would be trivial to extend setState() to wait for something like a flushState()
(for example)
Jean-Jacques Dubray
@jdubray
Jul 12 2017 17:51
maybe I don't know React enough, but my basic understanding is that you have to set the Root state and rely on vdom to avoid rendering the entire tree. With Redux the store is updated in one big swoop from the model. In don't see people using setState() at the component level, but I may be wrong.