Fixes block-editor component index to export ButtonBlockAppender with correct name#27709
Fixes block-editor component index to export ButtonBlockAppender with correct name#27709gaavar wants to merge 2 commits intoWordPress:trunkfrom
Conversation
There was a problem hiding this comment.
@gaavar Thanks for picking this up!
I think there are two things to address.
Unfortunately there might be plugins importing/using ButtonBlockerAppender, so we should continue to export it. It could be deprecated. That's done by calling the deprecate function. The following will output a console warning:
import deprecated from '@wordpress/deprecated';
deprecated( 'wp.blockEditor.ButtonBlockerAppender', {
alternative: 'wp.blockEditor.ButtonBlockAppender'
} );The tricky bit is that the message should only be shown if the user imports ButtonBlockerAppender, so I think you'd want to wrap ButtonBlockAppender, a bit like the following code elsewhere in the codebase, and then export that as ButtonBlockerAppender 😄 :
gutenberg/packages/editor/src/components/deprecated.js
Lines 66 to 72 in b52d33b
The second thing is that there's some documentation associated with the components that needs to be regenerated (which is why the 'Static Analysis' task is failing). It can be regenerated by running npm run docs:build locally and then committing and pushing the results.
|
@gaavar I think there's some misunderstanding of my comment. The deprecation for ButtonBlockerAppender will have to be in the packages/block-editor/src/components/index.js file. I think it's fine to copy some of the code over for deprecating the component from the other file. |
|
@gaavar Any concern if I pick this task up? |
Fixes block-editor's component index to export ButtonBlockAppender with the correct name (#25885)
Description
Revised
block-editor's component index to exportButtonBlockAppenderwith the correct name.ButtonBlockAppenderwas earlier exported with the incorrect nameButtonBlockerAppender.Deprecated
ButtonBlockerAppender.How has this been tested?
Screenshots
Types of changes
Bug fix
Checklist: