Replies: 3 comments
-
Preact users are generally gravitating more towards a signal based approach to managing state in apps. This eliminates the performance problems the React compiler is trying to address entirely as Signals ensure that state updates are decoupled from rendering and only trigger components to re-render when they need to. This means both The beauty about Signals is that they are not constrained to a particular framework or pattern and can be used anywhere. They don't require a complex machinery to make them work like the React compiler as they're plain JavaScript. I've used them in some personal non-preact apps and even backend-only apps a few times. |
Beta Was this translation helpful? Give feedback.
-
Hi @marvinhagemeister , I get your point, and I totally agree with that, but maybe I haven't been clear about what was worrying me or I haven't fully understood your reply. I was focusing more on the usage of libraries made for the react ecosystem with Preact. For example, I'm using React-mui or React-router with preact with 0 issues, and I was wondering what will happen when (and if?) such libraries would stop using internally useMemo to totally rely on the new compiler. |
Beta Was this translation helpful? Give feedback.
-
As far as I'm aware, the compiler generates output that uses
No, the official recommendation is to ship pre-compiled libs to NPM:
|
Beta Was this translation helpful? Give feedback.
-
I have seen that React is introducing a new Compiler which would essentially make useMemo and React.memo useless. I don't know if this will eventually lead to the deprecation and removal of useMemo and React.memo, but even if they weren't deprecated, I believe that libraries would start stopping using them, as the aim of the compiler is just handling such optimizations automatically, under the hood, at compile time.
So, I'm worried that if libraries stop using such methods, using them in Preact would, at the minimum, bring to a lower performance?
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions