-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Remove the utility property from the inserter items objects #22523
Conversation
Size Change: +1.45 kB (0%) Total Size: 1.12 MB
ℹ️ View Unchanged
|
#5540 (comment) has some background on why this exists. To illustrate, if one registers two blocks like so: registerBlockType( 'acme/product', {
edit() {
return (
<InnerBlocks
// All blocks are allowed in a Product block...
allowedBlocks={ true }
/>
);
},
} );
registerBlockType( 'acme/buy-button', {
// ...but Buy Button *must* be in a Product block
parent: [ 'acme/product' ],
} ); Then it's expected that the Buy Button block will appear at the top of the inserter when the user goes to add a block to a Product block. I'm fine with removing |
That's already the case but implemented differently. AFAIK Right now when we have a "parent" we only show its children on the inserter, there's no "Most used blocks" any more which means, utility is useless. |
Just tested it locally and you're right! I'm OK with this then 🙂 |
Minor: Noting the deprecation in |
closes #21462
This property was very confusing and was more something the components (since they can evolve and decide to show things differently) should care about and not computed by selectors.
@noisysocks what do you think, I believe you originally implemented this.