What’s new in Gutenberg? (18 November)

While the work on Full Site Editing and Global styles is continuing, GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ 9.4.0 introduced some nice additions to existing blocks and APIs. Let’s take a look at some of them:

Button widths

Instead of relying on dynamic widths, you can set percentage widths for button blocks.

BlockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. Variations Transformations

Blocks can provide block variations. In Gutenberg, a variation switcher can be added to the block inspector for these blocks.

Social Icons size support

Users can change the size of the icons in the Social Icons block.

Font size support for the List block

9.4 🇸🇰

Features

  • Add Keyboard Input inline format. (26801)
  • Add Block variations transformations. (26687)
  • Add width selector for button block. (25999) (26781).
  • Add font size support to the List block. (26257)
  • Social Links: Add ability to change social icon sizes. (25921)

Enhancements

  • Unify the inserter search UIUI User interface. (26595)
  • Polish custom select menu styles. (26956)
  • Polish menu item styles. (26889) (26720) (25218) (26572)
  • Polish the link interface. (26551)
  • Code & Preformatted Blocks: Delete on backspace if empty. (26605)
  • File Block: Move the URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org button to the Block toolbar. (26602)
  • Allow adding a headerHeader The header of your site is typically the first thing people will experience. The masthead or header art located across the top of your page is part of the look and feel of your website. It can influence a visitor’s opinion about your content and you/ your organization’s brand. It may also look different on different screen sizes. by typing /h1, /h2 etc. (26597)
  • Polish ShortcodeShortcode A shortcode is a placeholder used within a WordPress post, page, or widget to insert a form or function generated by a plugin in a specific location on your site. block styling. (26456)
  • Polish Search block styling. (26446)
  • Use a wider canvas for themes that don’t provide a custom width. (26357)
  • Show reduced UI on hover. (26882)
  • Update Legacy WidgetWidget A WordPress Widget is a small block that performs a specific function. You can add these widgets in sidebars also known as widget-ready areas on your web page. WordPress widgets were originally created to provide a simple and easy-to-use way of giving design and structure control of the WordPress theme to the user. toolbar button font to match UI when displayed in Widget Screen. (26841)
  • Update token field icon. (26726)
  • Windows 10 high contrast mode improvements. (26567)

New APIs

  • Create block: Add support for external templates installed from npm. (23712)
  • Add optional icon to snackbar notices. (26907)
  • wordpress/env: Add support for custom WP_HOME port. (26507)
  • wordpress/lazy-import: Allow importing local paths. (23751)
  • Format library: Introduce useAnchorRef. (26782)

Bug Fixes

  • Fix block context injection hook after CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. change in block rendering. (26998) (27011)
  • Fix Query block’s Toolbar popover width. (26992)
  • Fix IE11 interface bugs. (26944)
  • Improve arrow navigation between blocks. (26921)
  • Fix block alignments when theme styles are disabled. (26912) (26680) (26376)
  • Fix padding of text-only buttons mode. (26769)
  • Fix horizontal mover icon position. (26761)
  • Fix column width units. (26757)
  • FormTokenField input position when typing. (26741)
  • Fix applying colors to outlined buttons. (26707) (24626)
  • Render big font sizes properly in the font size picker. (26705)
  • Use currentColor in quote blocks to better support dark themes. (26684)
  • Fix “Browse All” in Quick Inserter for container blocks. (26443)
  • Fix responsive embeds in the widget screen. (26263)
  • Fix undefined index notice in Social Link Block. (25663)
  • Buttons block: Fix default alignment icon in toolbar to reflect the actual default alignment of buttons. (26910)
  • Block Support: Fix font size style when applying block support. (26762)
  • Do not invalidate the entity record cache during optimistic update in saveEntityRecord. (26627)
  • Provide a minimum of code wrapping for the code block. (26623)

Experiments

  • Full Site Editing Framework: Rework templates and template parts synchronization. (26650) (26383)
  • Full Site Editing Blocks:
    • Post ExcerptExcerpt An excerpt is the description of the blog post or page that will by default show on the blog archive page, in search results (SERPs), and on social media. With an SEO plugin, the excerpt may also be in that plugin’s metabox. block: Allow editing of generated excerpts. (26637)
    • Post Excerpt block: Add missing closing div tagtag A directory in Subversion. WordPress uses tags to store a single snapshot of a version (3.6, 3.6.1, etc.), the common convention of tags in version control systems. (Not to be confused with post tags.). (26806)
    • Add wide and full alignment options to the post/site title blocks. (26601)
    • Template Part block: Render preview as div. (26873)
    • Post Taxonomies: Fix PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher Fatal erroor for unregistered taxonomyTaxonomy A taxonomy is a way to group things together. In WordPress, some common taxonomies are category, link, tag, or post format. https://codex.wordpress.org/Taxonomies#Default_Taxonomies. (#26851). (26854)
    • PostAuthor: Safeguard to wait for authors to load. (26776)
    • Query block: Update the order of settings and filters in the sidebarSidebar A sidebar in WordPress is referred to a widget-ready area used by WordPress themes to display information that is not a part of the main content. It is not always a vertical column on the side. It can be a horizontal rectangle below or above the content area, footer, header, or any where in the theme.. (26647)
  • Site Editor:
    • Fix responsiveness. (26021)
    • Fix alignment of the new template button. (26934)
    • Add default block widths styles. (26853)
    • Refactor menu creation code. (26966)
    • Only show auto-draft template parts corresponding to current theme. (26948)
    • Polish the template navigation menuNavigation Menu A theme feature introduced with Version 3.0. WordPress includes an easy to use mechanism for giving various control options to get users to click from one place to another on a site.. (26933), (26930).
    • Add navigation panel back button slot. (26846)
    • Remove dashboard button focus on mount. (26845)
    • Saving flow: Use template and template parts entities titles. (26708) (26653)
    • Reorder template creation dropdown. (26610)
  • Global styles:
    • Fallback to theme color pallete. (26783) (26786)
    • Hide Block panels without content. (26609)
    • Update styles to rely on CSSCSS Cascading Style Sheets. variables for colors and gradients. (26319)
    • Fix Table block global styles selector. (26973)
    • Hide the line height panel if disabled in theme.jsonJSON JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML. file. (26778)
    • Cache generated styles. (25680)
    • Add: Mechanism to detect if a block instance matches a global styles selector. (26945) (26991)
    • Extract theme json processor. (26803)
    • Add support for line height at the global level. (26767)
    • Add preset classes generation on the client side. (26224)
  • Navigation block: Fix color support declaration. (26928)
  • Popover: Add sticky boundary element prop. (26728)
  • Block Support:
    • Add font style and weight options with combined UI. (26444) (26868)
    • Add text transform block support flag. (26060) (26059)
    • Add Font Family picking mechanism. (24868), (26750), (26759).

Performance

  • Use 2-pass terser compression. (24821)
  • Memoize getEntityRecords to prevent infinite re-renders. (26447)
  • Resolve per-entity resolvers after receiving a list of records. (26575)

Documentation

Code Quality

  • Use date-fns and date-fns-tz instead of moment. (25782) (27002)
  • is-shallow-equal: Convert to ESM. (26833)
  • Minor code refactoring in template part previews. (26949)
  • Drop zone: Rewrite with hooksHooks In WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same. and simplify. (26893)
  • PostTitle: Rewrite with hooks (+ avoid globals). (26820)
  • Avoid relying on a the global document. (26834) (26814) (26813) (26657)
  • Format library: Use hooks for all components. (26779)
  • Sandbox: Use hooks and avoid withGlobalEvents. (26742)
  • Draggable: Use hooks and prepare for iframeiframe iFrame is an acronym for an inline frame. An iFrame is used inside a webpage to load another HTML document and render it. This HTML document may also contain JavaScript and/or CSS which is loaded at the time when iframe tag is parsed by the user’s browser.. (26897)
  • PostLockedModal: Use hooks and avoid withGlobalEvents. (26743)
  • WpEmbedPreview: Use hooks and avoid withGlobalEvents. (26740)
  • FocusableIframe: Use hooks and avoid withGlobalEvents. (26737)
  • Navigation Component: Update styles to reference grid spacing helper. (26523)
  • Hooks: Type package. (26430)
  • Deprecated: Type package. (26429)
  • Movers: Small positioning refactor. (26353)
  • Use useAnimate for all Animate component usage. (26201)
  • Gallery block: Use APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways. v2. (26145)
  • Gallery: Remove obsolete deprecation entry. (26736)
  • Cleanup: (24831), (23598), (27000).
  • Remove useMemo in Query inspector controls. (26658)

Build Tooling

  • Add eslint rule to warn against using globals for addEventListener. (26810)
  • Update workflows to use Node 14.x. (26835)
  • Add command to format PHP files. (26850)
  • Build Tooling: Rebuild stylesheets when imported styles are modified. (26649)
  • Fix GH actions “cancel” step. (27025)
  • Run assign fixed issues and first time contributor label tasks for PRs from forks. (26876)
  • Update .nvmrc to use latest LTS. (26855)
  • Update nodegit to 0.27.0 in wordpress/env. (26712)
  • Tests: Add fixture for Column deprecation. (26774)
  • Store screenshots of CI end-to-end failures as CI artifacts. (26664) (26957)
  • End 2 End Tests:
    • Fix improper assertion in template-part.test. (26709)
    • Fix RTL end-to-end tests. (26508)
    • Add regresion end-to-end test for the empty reusable block causing WSODs issue. (26913)
    • Add block drag and drop test. (26869) (26904)
    • Add Delete on backspace from empty code/preformatted blocks test. (26972)
    • Merge end-to-end test relying on order into one. (26883)
    • Add template part conversion end-to-end tests. (26788)
    • Make the allowed blocks test more stable. (26631)
    • Add end-to-end test utils to install and activate themes. (23685)

Various

  • TextControl: Support forwarding refs. (26209)
  • Update gutenberg_is_fse_theme function to make it filterable. (27021)
  • Windows: Use wp-env instead of file location. (26671)
  • Site Editor: Rename left sidebar → secondary sidebar. (26517)
  • Add State locks for concurrency control to wordpress/core-data. (26389) (26661)
  • Avoid PHP warnings when Gutenberg pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party folder isn’t writable. (17671)

Performance Benchmark

The following benchmark compares performance for a particularly sizeable post (~36,000 words, ~1,000 blocks) over the last releases. Such a large post isn’t representative of the average editing experience but is adequate for spotting variations in performance.

VersionLoading TimeKeyPress Event (typing)
Gutenberg 9.46.2s26.6ms
Gutenberg 9.36.3s23.7ms
WordPress 5.56.7s22.1ms

Kudos for all the contributors that helped with the release. 👏

#core-editor, #editor, #gutenberg, #gutenberg-new