-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Bundle the block autocompleter in the block-editor package #21534
Conversation
Size Change: -63.9 kB (7%) ✅ Total Size: 839 kB
ℹ️ View Unchanged
|
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.
Everything worked well on my tests 👍
@@ -26,7 +29,13 @@ import { withBlockEditContext } from '../block-edit/context'; | |||
*/ | |||
export function withFilteredAutocompleters( Autocomplete ) { | |||
return ( props ) => { | |||
let { completers = [] } = props; | |||
let { completers = [], blockName } = props; |
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.
Each time we arrive to this function with undefined completers, completers will be set to a new array reference and useMemo will execute again. Should we have an empty array constant and set the completers default value to it?
closes #20619
This PR bundles the block autocompleter by default in all block editor instances. This makes the slash inserter work on the widget screen, edit site screen and the playground.
There's still another WordPress autocompleter that is not enabled on these pages (user) but this one can't be enabled by default as it's WordPress specific, so we need to find another home for it (today it's inside the editor package).