Block API: Add action to update existing block registration #20548
Labels
[Feature] Block API
API that allows to express the block paradigm.
[Type] Task
Issues or PRs that have been broken down into an individual action to take
Previously: #20544 (comment)
The implementation of #20544 highlights a use-case where it may be necessary to update registered block settings after the initial registration. Today, this can only be achieved by a (non-ideal) mutation of the result of
getBlockType
.There is already some precedent in how server-side and client-side registrations are reconciled, where server-side block registrations behave as something of a "base" that the client-side registration updates (source).
Task: Implement means to update existing block registration.
Implementation Ideas:
This may or may not need new APIs. It could be possible to change the behavior of
registerBlockType
such that "registering" an existing type would simply merge with the current settings.If a new API is needed, it could be expressed as something like
extendBlockType
.Consider also:
unstable__bootstrapServerSideBlockDefinitions
?attributes
replace or merge to existing attributes)?The text was updated successfully, but these errors were encountered: