react

"mulling over state management stuff"
Aron 2020-05-11T05:28:59.054600Z

"initial render" is definitely not the right level here though šŸ™‚ What does the API say about Suspense not being resolved? If anything, could be a bug.

Aron 2020-05-11T06:52:19.055200Z

I keep forgetting to mention immer together with redux and mobx and rx https://github.com/immerjs/immer

lilactown 2020-05-11T18:06:47.057400Z

immer is super cool

lilactown 2020-05-11T18:07:14.057900Z

I wish we had something like its ā€œpatchesā€ feature for CLJS structures

orestis 2020-05-11T18:09:31.058100Z

I wasnā€™t going crazy: https://github.com/facebook/react/pull/18547

šŸ˜… 1
aisamu 2020-05-11T18:10:37.058300Z

Good lord, talk about corner cases

lilactown 2020-05-11T18:11:35.058600Z

WAT

lilactown 2020-05-11T18:11:43.058800Z

thatā€™s totally wild

lilactown 2020-05-11T18:12:39.059100Z

thatā€™s awful

lilactown 2020-05-11T18:13:16.059600Z

I would open an issue with details about how confusing that was when trying to debug your app

orestis 2020-05-11T18:13:34.060Z

Well, OTOH -> experimental builds and all.

lilactown 2020-05-11T18:14:49.060500Z

hahahaha

orestis 2020-05-11T18:23:54.063700Z

One other thing that became obvious with Concurrent Mode, and specifically useTransition: dispatching events that trigger state changes is more nuanced. One example I was playing around with, was fetching images from Nasa picture of the day. I have a button to go the next day. Clicking the button changes the showing date and kicks off the fetch of the picture (which is inside a suspending component). I want the showing date to change immediately (responds to user input), but the suspending component stuff should use useTransition to stay on the old value a little bit.

orestis 2020-05-11T18:26:20.066200Z

In the re-frame approach, Iā€™d dispatch an event [:new-date "some date"] which would get handled, and mutate the db atomically which means everything would render at once.

orestis 2020-05-11T18:33:27.067300Z

The only approach I can thing is to only ever use local state for updating inputs, and keep the event handling atomic. Then, the caller can choose whether to dispatch the event inside a transition or not.

orestis 2020-05-11T18:34:05.068Z

Of course, the whole event dispatching and processing has to be synchronous. Iā€™m not sure how useTransition plays with useMutableSource, Iā€™ll try that in my next experiments.

orestis 2020-05-11T18:34:43.068600Z

OTOH, theyā€™re just trying out a new reconciler, so all these experiments might end up being for nothing: https://github.com/facebook/react/pull/18889

lilactown 2020-05-11T19:29:46.069Z

I too struggled with useTransition the last time I tried it

lilactown 2020-05-11T19:29:56.069300Z

I was trying to use react-router which was not behaving well with it at all

orestis 2020-05-11T19:52:03.069700Z

I used it just fine for a small demo

orestis 2020-05-11T19:53:00.071Z

It does feel very nice - itā€™s worth for a nice UX but boy is it annoying to work against these experimental stuff.

dominicm 2020-05-11T19:56:08.071500Z

Is it noticeably better in some way? From a ux perspective?

orestis 2020-05-11T19:59:32.072900Z

Well - I havenā€™t made a production app with it, but I see the problem it addresses in my own app.

dominicm 2020-05-11T20:02:18.073700Z

Do you mean useTransition or something related to suspense?

lilactown 2020-05-11T20:03:23.074100Z

this page (and the linked videos) do a really good job of explaining the benefits to the UX: https://reactjs.org/blog/2019/11/06/building-great-user-experiences-with-concurrent-mode-and-suspense.html

lilactown 2020-05-11T20:03:33.074500Z

itā€™s kind of hard to translate into a slack message šŸ™‚

dominicm 2020-05-11T20:05:41.075800Z

The data fetching & loading is good, for sure

orestis 2020-05-11T20:06:07.076600Z

I have an exact use case - searching on the server by typing into a field. user land solutions suck and are super brittle.

dominicm 2020-05-11T20:07:03.076800Z

Ah

dominicm 2020-05-11T20:33:51.077900Z

This is my return to that document, I didn't remember the suggestion that data fetching should move upwards to the router/transition event. Very re-frame.

Aron 2020-05-11T23:24:34.078200Z

I wonder how I got over this, I also use almost exclusively console.log, I also use experimental and latest and start something new every week, so I kind even vaguely remember something related to this, but I don't really remember having any real issues. I do stuff like useEffect(() => console.log(value), [value])

Aron 2020-05-11T23:25:11.078400Z

I wonder if that's also disabled?

lilactown 2020-05-11T23:30:17.078700Z

I want better REPL support for React

Aron 2020-05-11T23:33:31.078800Z

This is confusing me. The new reconciler is still Fiber no? Or has Fiber already become the old and there is some even new-er coming? Or are they just referring to the different modes it can be ran it in? https://reactjs.org/docs/concurrent-mode-adoption.html#feature-comparison

Aron 2020-05-11T23:36:18.081600Z

I want a better browser

lilactown 2020-05-11T23:54:57.081900Z

one of these I can reasonably do myself šŸ˜›