-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Restore block prop for BlockListBlock filter #12943
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
Conversation
c167be5 to
759c0e5
Compare
gziolo
left a comment
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.
This fix looks legit, it would be nice to get confirmation from @aduth whether using memize doesn't introduce any issues. I sense that we should be using Weak Map instead but I'm also not quite sure how it would look implementation wise :)
0fda510 to
8ed5f80
Compare
|
Moving forward, we need to rethink how to take over control what can be passed to the filtered component. Ideally, we should seek a way to abstract away all usages of filters in Gutenberg. It never occurred to me before how bad it can become if the number of props passed to the filter introduced |
|
Also, we should explore separately how to catch errors in |
99e4d9c to
61df553
Compare
|
Tests are funky at the moment. I'm going to merge while we figure out what's wrong with our test setup. |
* Restore block prop for BlockListBlock filter * Restore hook order * getBlock with memory leak * Add clientId and isValid to the block prop
closes #12938
Plugins used to be able to access the
blockprop in theBlockListBlockfilter which was inadvertently removed when we moved the filter. The intention for this filter was to only allow plugins to useclientIdand with this, and using selectors they can retrieve any information about the blocks.This PR restores the
blockprops for backward compatibility purpose.Testing instructions