react

"mulling over state management stuff"
orestis 2020-05-03T05:23:55.345800Z

Sorry about that - didn’t mean to be rude or insinuate anything. Arguing on slack isn’t the easiest form of getting my point across.

orestis 2020-05-03T13:58:25.346200Z

Something is brewing over at react: https://github.com/facebook/react/pull/18774

orestis 2020-05-03T13:59:07.347100Z

I’m honestly tired of trying to ride this wave. I was just reading the docs of om.next -> such a nice paradigm, created almost 5 years ago.

dominicm 2020-05-03T14:29:02.349400Z

Interesting... I'm... Hmm. I don't think this stuff matters does it? I can't convince myself to care all that much about the scheduler. It's nice that input events get handled first, but beyond that I'm not sure it matters :thinking_face:

Aron 2020-05-03T15:44:47.352700Z

it does and it doesn't. From cljs perspective, where you have several options to choose from libraries that allow all kinds of optimizations on how to handle state (to components), it doesn't much really, the good thing is the reconciler that updates the dom. OTOH, from javascript perspective, it's impossible to guarantee that you calling this.setState({some: 'literal'}) won't block the UI unless you have something like their async renderer that basically cuts long running renders into chunks. It's an overkill for antyhing that one person can write, but facebook has between 30k-70k components internally that they have to maintain...

Aron 2020-05-03T15:45:42.353300Z

Unless they got rid of them in the past couple of months, I don't have a live counter : D

Aron 2020-05-03T15:48:03.355800Z

but even from cljs perspective I think it's a nice to have optimization when you do have to write a lot of components. Or, I also feel it's helpful, when you are using messages internally on the frontend and you don't have to care about calling ReactDOM.render() 60 times a second.

Aron 2020-05-03T15:48:18.356100Z

It's fine, it's how it should work ; )

orestis 2020-05-03T15:57:05.359500Z

I think I had a kind of personal clarity moment, for the thing I want to pursue - a way to bind one (or more) external store to native React in a suspense-friendly way. The store should be abstracted behind a protocol and could be as simple as a map inside an atom, or could be anything else.

1
orestis 2020-05-03T15:59:04.362200Z

This way, mutating the store can be a separate concern that’s much more targeted to the complexity of the application you’re building. For simple stuff, swapping an atom is ok. For more complex, dispatching actions or whatever. Same for handling async stuff, normalized caches etc.

orestis 2020-05-03T16:28:45.363600Z

And, I want to pursue a Clojure-minded approach, with REPL interactions, build your own tools etc.

orestis 2020-05-03T16:32:43.365700Z

Hopefully we can approach the domain by having libraries that compose well and also integrate well with React. Ideally you’d be able to build re-frame on top of this adapter (for example).