Post

tried writing this blog 3 times but it’s really boring, so here’s the short version: React won. Every mainstream f/w now implements its ideas, and developed their own ecosystems. The ones that didn’t, lost and died. This implies there’s no _strong_ reason to not pick one of the other winners.

I still genuinely don't know what "React adopt signals" would _mean_ at a technical level. Per other comments in this thread, React works at the component level. What would a hypothetical native-to-React signals integration do differently?

It would have to have been something new. Breaking likely. Signals would allow: - finer grained updates than “component” e.g. jsx fragments - state/data flow that isn’t tied to component hierarchy and doesn’t need to rerender (or subscribe to a store to rerender) itself and its children

for change detection. - useMemo/useCallback would actually only get used for heavy computations instead of referential stability Just spitballing here. But look at Preact signals for more ideas.

The cynical reason why this never happened in React would be because it devalues React. If you don't need components to build complex trees of state, you barely need components at all. And then you barely need react at all. Working on React or a React FW subconsciously biases away from that.

You still need components for the domain modeling benefits. So signals let you re-render at the element level? That’s pretty neat. Guess you could do that by composing even smaller components but that probably gets unwieldy 🤔

The domain modelling thing is 50/50 - you can do it elegantly in signals using function or class composition, which is pretty nice compared to the mess of hooks since your functions/classes are purely factories/constructors and never re-run. You just need components for the view, and even then...

I guess the nice side-effect of React has been to force a lot more people to learn about function/class composition, idempotent pure functions, … Once you get used to that, you can use any framework imo

0 reposts5 likes

No replies yet.