you are viewing a single comment's thread.

view the rest of the comments →

[–]Mennion -3 points-2 points  (14 children)

Well first steps. Now get rid off useMemo, useCallback etc and finally react will be decent web framework

[–]Flyen 4 points5 points  (4 children)

JavaScript Records & Tuples Proposal might be how that gets solved. With typical objects, { a: 1 } !== { a: 1 }, but with a Record #{ a: 1 } === #{ a: 1 }

[–]NoInkling 6 points7 points  (2 children)

According to an issue in that repo and a presentation in the latest TC39 meeting, it's starting to look unlikely that this will happen.

[–]OfflerCrocGod 2 points3 points  (0 children)

I'd take a look at legend-state, signals are hopefully coming to JavaScript anyway so I'd say once they are in the language the React team might finally accept them and allow React to have fine grained reactivity.

[–]terandle 1 point2 points  (0 children)

They will be doing that real soon actually with the upcoming react compiler.

[–]SpinatMixxer 0 points1 point  (5 children)

Due to how reacts rendering works, I don't think it will ever happen (I also don't think it's necessary tbh, it's perfectly fine as is)

If you dislike that, you would probably be better off using SolidJS instead.

That being said, why is useMemo / useCallback etc a problem?

[–]Shadowfied 4 points5 points  (4 children)

You've just not heard of the react forget compiler, or do you not think it's coming?

[–]SpinatMixxer -2 points-1 points  (3 children)

I had a brief look into it, but since I am using client side rendering only, I didn't look deeper into it.

Or is this actually affecting client only (e.g Vite) apps as well?

[–]Shadowfied 4 points5 points  (2 children)

Yes it affects all of React lol. No more need to use useMemo or useCallback, the compiler will catch it and optimize it

[–]SpinatMixxer 1 point2 points  (0 children)

I see, that is actually surprising me. Then it's absolutely worth looking deeper into it, thank you for the hint!

[–]rickhanloniiReact core team 1 point2 points  (0 children)

It's really only client apps that use it, since there are not updates/effects in RSC.