-
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
getDirectInsertBlock: Remove 'directInsert' as a callback handler #59172
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +46 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
Flaky tests detected in 05f8c3c8313e9e4449ff3adc9386e84663201372. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7959228136
|
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.
Tests well, thanks for the nice cleanup.
There's a JSDoc here that needs updating:
gutenberg/packages/block-editor/src/components/inner-blocks/use-nested-settings-update.js
Line 40 in cab4b28
* @param {?Function|boolean} directInsert If a default block should be inserted directly by the appender. |
Since InnerBlocks
is a public API this is technically a breaking change.
I can't find any usage of the API in wpdirectory.net and it was only ever documented via the useNestedSettingsUpdate
JSDoc which is pretty obscure so I think it's acceptable to output a deprecated()
warning in useNestedSettingsUpdate
and no longer support the behaviour.
05f8c3c
to
bdfcd07
Compare
@noisysocks, I added the deprecation notice. Screenshot |
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.
👍
What?
PR removes support for the
directInsert
callback value ingetDirectInsertBlock
.Update: I've also removed selector memoization; now that data comes directly from the store, there's no need for that.
Why?
The logic was introduced as part of initial experiment #34899 but hasn't been used in the core for a while. The setting became a boolean after the stabilization. See #52083.
The block edit components are better suited to derive similar setting values based on the state and context.
Testing Instructions
Testing Instructions for Keyboard
Same.