You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We all know, hydration and re-hydration (or re-rendering) costs a lot of CPU and may block main-thread while doing it on large application. The fact, we cannot do anything to eliminate or reduce CPU cost of initial hydration (only React can), I propose Remix should at least minimize re-hydrations when possible.
Currently, every loader revalidation causes full tree re-hydration twice (with strict mode 4 times), even when data has not been changed, due to React's context nature. I described the issue more deeply here. Unfortunately, it were closed without understanding issue report correctly. I don't think unnecessary re-renders should be marked as "expected behaviour". However, I understand this particular context is really hard to inform how it has to be memoized since there are a lot of data and callbacks inside.
But.. The answer might be to use signals instead of React state & context inside Remix and react-router. Nature of the Signals is to avoid unnecessary revalidations on the tree, which results in better performing app.
Of course, switching is not as easy as it sounds, but I think it deserves consideration.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We all know, hydration and re-hydration (or re-rendering) costs a lot of CPU and may block main-thread while doing it on large application. The fact, we cannot do anything to eliminate or reduce CPU cost of initial hydration (only React can), I propose Remix should at least minimize re-hydrations when possible.
Currently, every loader revalidation causes full tree re-hydration twice (with strict mode 4 times), even when data has not been changed, due to React's context nature. I described the issue more deeply here. Unfortunately, it were closed without understanding issue report correctly. I don't think unnecessary re-renders should be marked as "expected behaviour". However, I understand this particular context is really hard to inform how it has to be memoized since there are a lot of data and callbacks inside.
But.. The answer might be to use signals instead of React state & context inside Remix and react-router. Nature of the Signals is to avoid unnecessary revalidations on the tree, which results in better performing app.
Of course, switching is not as easy as it sounds, but I think it deserves consideration.
Beta Was this translation helpful? Give feedback.
All reactions