Skip to content
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

Merged
merged 2 commits into from
Feb 12, 2018
Merged

Conversation

aduth
Copy link
Member

@aduth aduth commented Feb 12, 2018

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:

npm run test-unit

† There are still some unnecessary rerenders, though not nearly as bad as original in #4955 where every block would re-render.

@aduth aduth added the Framework Issues related to broader framework topics, especially as it relates to javascript label Feb 12, 2018
Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@youknowriad
Copy link
Contributor

I'm merging to update the other related PRs

@youknowriad youknowriad merged commit a0b9242 into master Feb 12, 2018
@youknowriad youknowriad deleted the try/weak-map-cache branch February 12, 2018 10:56
@@ -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',
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants