Fork me on GitHub
#om
<
2015-08-26
>
grav10:08:44

I’ve been looking into this blog post http://blog.circleci.com/local-state-global-concerns/ which describes how to mount the component-local state into the global app state

grav10:08:26

I’m not able to figure out whether it’s still used in CircleCI?

grav10:08:47

Do any other of you have any experience with this approach?

robert-stuttaford11:08:49

@grav we tried it and ended up ditching it

robert-stuttaford11:08:18

localstate changes deep in the component tree were causing the whole app to re-render due to writes happening to the root cursor

robert-stuttaford11:08:51

it shouldn’t have done this, but when i reported it to david, his response was that he sees no-local-state-descriptor as a debugging tool rather than something to use in prod

robert-stuttaford11:08:17

any effort people are putting into this problem is now happening outside of Om.current

robert-stuttaford11:08:28

my personal suggestion: don’t bother with it

grav11:08:49

ok, thanks for the advice. It actually leads to another question in my head - is it a problem with whole-app rerendering? I thought that the way Om checks equality on subtrees of the state would prohibit re-rendering, and next, if the app actually rerenders, it won’t necessarily lead to dom updates because of React’s dom diffing

grav12:08:05

In another wording: isn’t the performance impact of re-rendering the root-note in a component tree mitigated by 1) clojure’s re-use of subtrees in the state and 2) React’s DOM diffing?

jackjames13:08:49

@grav: your understanding is generally correct. it's likely that robert's issue could be mitigated by making sure that the "global local" state map isn't passed down the component tree as props. that said, it's definitely rough around the edges and it's pretty likely that it will cause unexpected behavior in your app that make it impossible to leave in place in production (and you'll definitely want to remove it as a first step when doing any troubleshooting).

jackjames13:08:55

i have a couple open issues w/ minimal cases for some of the issues i ran into w/ it

grav13:08:19

@jackjames: can you link to those?

grav14:08:05

@jackjames: I just tried to use no-local-descriptor in my app, and I experienced and error as well - one component-state variable is updated in the :state-map, another isn't

grav14:08:03

So it seems it’s not usable yet. Pity, we do a whole lot of unfunny book-keeping of the UI state currently

grav14:08:48

I’m still playing around with the idea of dumping cursors though. To me, it seems cursors do not help performance wise but is more of a state segmentation help, and mostly wrt. updating the state. Any thoughts?

jackjames14:08:48

@grav: there seems to be a consensus that cursors were a nice bridge to a better approach. they're not used at all in the only real existing om production app that we have visibility to (circleci frontend). and looks like cursors will not be a part of om-next.

grav14:08:06

@jackjames: ok, thanks for the input