denoland / fresh

The next-gen web framework.
https://fresh.deno.dev
MIT License
12.17k stars 621 forks source link

Support React as alternative to Preact #2375

Closed gerabell closed 5 months ago

gerabell commented 5 months ago

Even so very similar in many aspects, there are also more and more differences between those two. Working with both in parallel is getting quite challenging. Do you see any options for allowing to use / support React for Fresh - on the server-side but also for islands? Especially in expectation of React 19 this would be a great support for Fresh.

marvinhagemeister commented 5 months ago

There are no plans to change the underlying framework at the moment. What parts of React 19 are you interested in specifically and would like to see in Fresh?

gerabell commented 5 months ago

I am most interested in the new React compiler approach which prevents to use manual, error-prone memoization to speed up rendering/avoid unneeded refreshing. Maybe this would also have an effect on the server to avoid expensive re-calculation. Apart from that the new „Actions“ approach for submits etc seems interesting.

marvinhagemeister commented 5 months ago

Signals are an alternative to the React compiler which already work today. They offer even more granular control over when something re-renders compared to what we've seen so far from what has been revealed about the React compiler so far.

The server actions are certainly interesting, but it's more of a next.js feature, not something that comes with React. If Fresh would switch to React there wouldn't be server actions out of the box. It's something that's built on top of React. Whether you build server actions on React or Preact makes no difference in the end.

katungi commented 5 months ago

Preact supports using React stuff using compat. Is it possible to opt into compat mode using fresh? Just curious.

marvinhagemeister commented 5 months ago

Yes that's possible, see https://github.com/denoland/fresh/issues/1395 .

Closing this issue as there are no plans to move to React.