Skip to content

Framework: Upgrade Rememo dependency to 2.4.0#5002

Merged
youknowriad merged 2 commits intomasterfrom
try/weak-map-cache
Feb 12, 2018
Merged

Framework: Upgrade Rememo dependency to 2.4.0#5002
youknowriad merged 2 commits intomasterfrom
try/weak-map-cache

Conversation

@aduth
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
gutenberg_get_script_polyfill( array(
'\'Promise\' in window' => 'promise',
'\'fetch\' in window' => 'fetch',
'\'WeakMap\' in window' => 'WeakMap',
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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