Restore block prop for BlockListBlock filter#12943
Conversation
c167be5 to
759c0e5
Compare
gziolo
left a comment
There was a problem hiding this comment.
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