-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce use-optimized-selector #1226
Conversation
Staging deploy success. Link to test editor: https://utopia.pizza/p/?branch_name=performance-use-optimized-selector |
I believe there is an update that fixes the issues! |
Staging deploy success. Link to test editor: https://utopia.pizza/p/?branch_name=performance-use-optimized-selector |
Link to test editor |
Link to test editor |
Is this PR still something we want to merge? |
Tagged and closed |
Part way to a solution to #1186
Problem:
We're still stuck on an old build of
use-context-selector
as we're relying on a patch of that for adding an equality check param.Fix:
Introduce
use-optimized-selector
for applying a layer of caching around selectors used by the above, as discussed in this comment thread. I'm opening this PR primarily to see how the performance tests run with this, since it completely removes the passing of that equality function to the patched build ofuse-context-selector
.I have also tested this out with the latest version of
use-context-selector
(1.3.7), which pushes the render count tests up again, so there is still further work to be done to allow us to move onto the latest version of that.Commit Details:
useContextSelector
toreact-performance.ts
, which combines the above two librariesuse-context-selector
to the above functionAnnoyingly, the
react-hooks/exhaustive-deps
eslint rule was tripped in a few cases by generic type symbols (e.g. inuseGetMultiselectedProps
the rule complains thatP
is not included in the list of dependencies, which is nonsense!), so I've had to disable those on a few lines. I'll check to see if there is an update for that rule to fix the issue.