-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Framework: Upgrade Rememo dependency to 2.4.0 #5002
Conversation
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.
Nice 👍
I'm merging to update the other related PRs |
@@ -155,6 +155,7 @@ function gutenberg_register_scripts_and_styles() { | |||
gutenberg_get_script_polyfill( array( | |||
'\'Promise\' in window' => 'promise', | |||
'\'fetch\' in window' => 'fetch', | |||
'\'WeakMap\' in window' => 'WeakMap', |
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.
I don't think we ever register WeakMap
polyfill.
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.
Oh, whoops, I was used to my original implementation which had passed this through as a feature argument to polyfill.io . I'll see about fixing this up.
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.
Noting that this should not cause breakage for users without WeakMap support, as in later iterations of the new rememo release, it was made to be an optional enhancement.
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.
Nice, I guess we need those optimizations for WP community :D
Related: aduth/rememo#1
Related: #4939
Related: #4955
This pull request seeks to upgrade the
rememo
dependency from 2.3.4 to 2.4.0 .View Changelog
Notably, the new version improves support for nested dependants, which is important for the
getBlock
selector which otherwise has its cache busted much more frequently than desired, having performance impact on frequent block changes (such as those proposed in #4955).Testing instructions:
Verify that there are no regressions in the behavior of block changes.
Note that block changes should only incur rerenders to the relevant block†, e.g. using React Developer Tools Highlight Updates feature.
Ensure unit tests pass:
† There are still some unnecessary rerenders, though not nearly as bad as original in #4955 where every block would re-render.