-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Improve transaction confirmation page performance #16205
Conversation
@Gudahtt Maybe this PR should be renamed to something else given that it now affects both stable and Flask? While the main goal was to fix a Flask bug. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello sir
Agreed! Maybe something about improving transaction confirmation page performance. It should generally be a perf improvement across the board. |
In the future, that screen might be rerendered again for other reason, but it still shouldn't call |
Strictly if the transaction changes or you switch the tab back and forth (unmounting and remounting). In my opinion that should be fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Explanation
This issue fixes a Flask issue by fixing an underlying problem with the selectors used in the transaction confirmation screen (also in stable). The issue arose in Flask because we relied on the
txData
object for auseEffect
. ThetxData
object was continuously updated through spreads etc without memoization. This PR fixes the problem by wrapping the existing logic inreselect
selectors and enabling deep equal memoization for these selectors.More Information
Fixes MetaMask/snaps#828
Manual Testing Steps
(Perhaps another way to test in stable?)