Stackable
Stackable copied to clipboard
Refactor usage of __unstableGetClientIdsTree before WordPress 6.4
__unstableGetClientIdsTree
of wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree()
will be removed from WordPress in 6.5, we need to remove it by 6.4
Currently, we are using __unstableGetClientIdsTree
in 2 areas:
- Navigator panel
-
useBlockContext
hook
We will need to remove our dependency from this experimental function. I think we can do it the following way.
Navigator panel
Options:
- We can re-create this method because we really need to get the entire tree for the Navigator to work.
- We can discuss next time whether we can remove this Navigator feature because more and more people are using the Block Editor and there might not be any need for this feature now.
useBlockContext
hook
We created the useBlockContext
hook to increase the speed of looking up the surrounding context of a block (it's siblings, parent block, index, etc). From our performance release before, we found out that using the native methods were slower than expected.
Options:
- We can re-create the
__unstableGetClientIdsTree
method - not too sure about this because the benefit of using__unstableGetClientIdsTree
is that it's already using the data in the core store - we might lose efficiency by recreating our own - We can revisit the code that use
useBlockContext
and see whether we can refactor the use of the hook out.