- Variables like
process.env.IS_GUTENBERG_PLUGIN
have been replaced byglobalThis.IS_GUTENBERG_PLUGIN
. Build systems usingprocess.env
should be updated (#61486). - Increase the minimum required Node.js version to v18.12.0 matching long-term support releases (#31270). Learn more about Node.js releases.
- Updated dependencies to require React 18 (45235)
- Deprecate non-string descriptions (#44455).
- The block attribute sources
children
andnode
have been deprecated. Please use thehtml
source instead. See https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/ and the core blocks for examples.
- Packages: Replace
is-plain-obj
withis-plain-object
(#43511).
withBlockContentContext
is no longer used by the block editor and therefore got deprecated (#41395).
- The shortcode transformer now accepts a
transform
method to allow advanced controls over the transformed result. For instance, it's now possible to define custominnerBlocks
for the transformed block. (#42001)
- Register a block even when an invalid value provided for the icon setting (#34350).
- The
isMatch
callback on block transforms now receives the block object (or block objects ifisMulti
istrue
) as its second argument.
- Upgraded React components to work with v17.0 (#29118). There are no new features in React v17.0 as explained in the blog post.
- The deprecated
registerBlockTypeFromMetadata
function was removed. Please useregisterBlockType
that covers the same functionality (#32030).
registerBlockType
method can be used to register a block type using the metadata loaded fromblock.json
file (#32030).
registerBlockTypeFromMetadata
was deprecated in favor ofregisterBlockType
that support now the same functionality (#32030).
- Drop support for Internet Explorer 11 (#31110). Learn more at https://make.wordpress.org/core/2021/04/22/ie-11-support-phase-out-plan/.
- Increase the minimum Node.js version to v12 matching Long Term Support releases (#31270). Learn more at https://nodejs.org/en/about/releases/.
registerBlockTypeFromMetadata
method can be used to register a block type using the metadata loaded fromblock.json
file (#30293).
- Reverted
cloneBlock
back to its original logic that doesn't sanitize block's attributes. #28379
cloneBlock
now sanitizes the attributes to match the same logiccreateBlock
has. #28379
- Added a store definition
store
for the blocks namespace to use with@wordpress/data
API (#26655).
- Blocks can now be registered with an
defaultStylePicker
flag in thesupports
setting, allowing the default style picker to be removed.
- Omitting
attributes
orkeywords
settings will now stub default values (an empty object or empty array, respectively).
- The
'blocks.registerBlockType'
filter is now applied to each of a block's deprecated settings as well as the block's main settings. Ensuressupports
settings likeanchor
work for deprecations.
- Added a default implementation for
save
setting inregisterBlockType
which saves no markup in the post content. - Added wildcard block transforms which allows for transforming all/any blocks in another block.
- Blocks'
transforms
will receiveinnerBlocks
as the second argument (or an array of each block's respectiveinnerBlocks
for a multi-transform).
- Block validation will now correctly validate character references, resolving some issues where a standalone ampersand
&
followed later in markup by a character reference (e.g.&
) could wrongly mark a block as being invalid. (#13512)
isValidBlock
has been removed. Please useisValidBlockContent
instead but keep in mind that the order of params has changed.
- The block validator is more lenient toward equivalent encoding forms.
getBlockAttributes
,getBlockTransforms
,getSaveContent
,getSaveElement
andisValidBlockContent
methods can now take also block's name as the first param (#11490). Passing a block's type object continues to work as before.registerBlockStyles
andunregisterBlockStyles
can be triggered at any moment (before or after block registration).
- Paste: Google Docs: fix nested formatting, sub, sup and del.
- Expose @wordpress/editor to Gutenberg mobile.
- Separate Paste Handler.
isValidBlockContent
function has been added (#10891).
isValidBlock
function has been deprecated (#10891). UseisValidBlockContent
instead.
- Attribute type coercion has been removed. Omit the source to preserve type via serialized comment demarcation.
setUnknownTypeHandlerName
has been removed. Please usesetFreeformContentHandlerName
andsetUnregisteredTypeHandlerName
instead.getUnknownTypeHandlerName
has been removed. Please usegetFreeformContentHandlerName
andgetUnregisteredTypeHandlerName
instead.
- Added a
unregisterBlockStyle()
function to remove a block style variation.
getDefaultBlockForPostFormat
has been removed.
- The
isSharedBlock
function is removed. UseisReusableBlock
instead. - Change how required built-ins are polyfilled with Babel 7 (#9171). If you're using an environment that has limited or no support for ES2015+ such as lower versions of IE then using core-js or @babel/polyfill will add support for these methods.
- The
getDefaultBlockForPostFormat
function has been deprecated.