Repository navigation
Closed
Labels
[Type] Tracking IssueTactical breakdown of efforts across the codebase and/or tied to Overview issues.
Description
Here are all the PRs that need a Dev Note to be written. Please share them here as comments, see what is related, and create Make/Core posts accordingly. Please let me know if you're unable to write a note for your PR. The notes should be posted before WP 5.7 RC (Feb 23), but the sooner, the better.
- Try: Make empty paragraphs take up the same space on the frontend, as in the editor Try: Make empty paragraphs take up the same space on the frontend, as in the editor #27995
- Add srcset for cover image Add srcset for cover image #25171
- Display Block Information by matching block variations Display Block Information by matching block variations #27469
- Change replaceInnerBlocks updateSelection property to false Change replaceInnerBlocks updateSelection property to false #26312
- Remove autoFocus prop from URLInput and from the inserter search form Remove autoFocus prop from URLInput and from the inserter search form #27578
- Data: Use store defintion as param for select and dispatch Data: Use store instance as param for select and dispatch #26655,
@wordpress/data-no-store-string-literalsAdd eslint rule for preventing string literals in select/dispatch/useDispatch #28726
- Buttons block: overhaul alignment/justification controls Buttons block: overhaul alignment/justification controls #23168
- Make i18n functions filter their return values Make i18n functions filter their return values #27966
- Block supports for style properties added since 5.6. This is so themes have a heads-up on styles that users can now tweak.
Reacted by annezazu, Greg Ziółkowski and Sören Wünsch
Metadata
Metadata
Assignees
Labels
[Type] Tracking IssueTactical breakdown of efforts across the codebase and/or tied to Overview issues.
Activity
ntsekouras commentedon Jan 28, 2021
Dev note for: Change replaceInnerBlocks updateSelection property to false #26312
Inner Blocks API Changes
We noticed that the majority of block authors prefer to keep the focus on the parent block upon insertion in the editor rather than move it to one of the child blocks. Prior to the changes introduced the default behavior was the latter, so we decided to change it to follow the more popular choice that is going to simplify API usage. To accomplish that we had to change the definition of the following parts of API:
InnerBlockcomponentuseInnerBlocksPropshookreplaceInnerBlocksactionInnerBlockcomponent anduseInnerBlocksPropshookBoth handle the focus on the blocks with
templateInsertUpdatesSelectionproperty. If you want to keep the focus on the parent you can omit this property.If you want to move the focus to the first child block you have to set this property to
true. Examples:replaceInnerBlocksactionReference: https://developer.wordpress.org/block-editor/data/data-core-block-editor/#replaceInnerBlocks
This action handles focus with the third argument
updateSelection. If you want to keep the focus on the parent you can skip this argument when callingreplaceInnerBlocks.If you want to move the focus to the first child block you have to pass this argument with
truevalue. Examples:jasmussen commentedon Jan 28, 2021
Dev note for #27995, Make empty paragraphs take up the same space on the frontend, as in the editor
Empty paragraph changes
In 27995 the default behavior of a published empty paragraph (
<p></p>) changed. Before, the tag would collapse to zero width and zero height, and be inconsistent with what users saw in the editor. Now an invisible space character is output in empty paragraphs, ensuring linebreaks in the editor correspond to linebreaks on the frontend.There is a chance of empty paragraphs accidentally published, which will now take up space. If that is the case, it is easily fixed by deleting the empty paragraphs.
scruffian commentedon Jan 28, 2021
Comment by @nosolosw This has been surpassed by this other note below.
Dev note for Verse Block: Add support for Font Size #27735 and Code block: Add support for font sizes #27294
Code and Verse Blocks
The Code and Verse Blocks now support custom font sizes. These can be customized by users on a per block basis using the inspector panel. Themes can also specify a default font size for these blocks using experimental-theme.json.
ntsekouras commentedon Jan 28, 2021
Dev note for: Display Block Information by matching block variations #27469
With the new hook
useBlockDisplayInformationyou can now get some of the block's information, taking into account a matching block variation.useBlockDisplayInformationis a hook that tries to find a matching block variation and returns the appropriate information for display reasons. The returned information are the block'stitle,iconanddescription.In order to to try to find a match we need to things:
isActiveprop to a proper function.If for any reason a block variation match cannot be found, the returned information come from the Block Type. If no blockType is found with the provided clientId, returns null.
Example usage:
You can match a created block with one of its block variations by using the
isActivenew property in Block Variations API.This can be useful for cases you want to use information from the block variation, after a block's creation. For example this API is used in
useBlockDisplayInformationhook to fetch and display proper information on places like theBlockCardorBreadcrumbs.Block Variation's settings can include the new property
isActive. This optional property is a function that is used to find a block variation match from a createdBlock, by providing its attributes and a block variation attributes.We need this function to be explicitly implemented by block/plugin authors, because in many cases it doesn't make sense to try to find a match by checking dynamically all block properties. An example is
embedblock where we might have changed the responsive attribute, so a match would not be found.Example in a single block variation:
Example when all variations use the same matching function:
ajlende commentedon Jan 28, 2021
Dev note for: Add srcset for cover image #25171
Cover Block
The cover block now uses an
imgelement instead of using CSSbackground-imagefor images that are not using fixed or repeated backgrounds. This means that, when rendering the post, asrcsetattribute will be applied with the various generated image sizes, saving bandwidth by loading smaller images when possible.aaronrobertshaw commentedon Jan 29, 2021
Edited by @nosolosw : this shouldn't be part of the dev notes, see this comment.
Dev note for: Block Support: Add border radius support #25791
Border Radius Support
The ability to manage a border radius style property for blocks has been added. This support is disabled by default however it can be opted into and themes can specify default border radii using
experimental-theme.json.Opting In
An individual block can opt in by setting the
__experimentalBorder.radiusproperty to true within its support configuration:Default Border Radius Styles
Themes can apply a default border radius for desired block contexts via
experimental-theme.json:Sidebar Controls
The inspector control to manage border radius values is disabled by default while the sidebar is being refined. It can still be turned on by updating the appropriate context within
experimental-theme.json. For example:gziolo commentedon Jan 29, 2021
I don't think this is ready for prime time if it is behind the experimental flags. @nosolosw should have a better overview of where the Global Styles project is, but I don't think this is going to be possible to use this Border Radius Support in WP 5.7.
leewillis77 commentedon Jan 29, 2021
oandregal commentedon Jan 29, 2021
@gziolo is correct here: the border radius is still experimental (as other properties we added in this cycle such as font height, etc). I'm going to remove it from the issue description.
It was me who tagged that PR with "needs dev note", though. @aaronrobertshaw I'm sorry that I made you write this note down! The good news is that we can reuse that text for when it's marked as stable.
oandregal commentedon Jan 29, 2021
I've reviewed the existing dev notes and it looks like the ones for the code and verse block shouldn't be listed either: these are not dev-facing features (don't add, update, remove any API) but user-facing ones. Again, it was me who tagged those PRs ― it seems I've been misusing the "need dev note". Sorry about that. Hopefully, I've learned how to use it in the future! Going to delete them from the issue description.
leewillis77 commentedon Jan 29, 2021
Apologies, but I don't think the existing documentation is actually sufficient for "Make i18n functions filter their return values #27966" - there is another API change that should go in the dev note. I'll collate everything today and post here when ready!
leewillis77 commentedon Jan 29, 2021
Dev note for #27966 is here, which includes a note about the changes to instantiation of i18n instances:
https://gist.github.com/leewillis77/088c47a89d3319d45f93a7a3b9774ba3
noisysocks commentedon Feb 8, 2021
Thanks for getting in early everyone! Friendly* reminder that the due date for dev notes is 23 Feb. Ping me if you need help or can't do it.
* read: passive aggressive
adamziel commentedon Feb 8, 2021
The PR I was asked to write a note on was later reverted: #26828 – you may safely cross it off the list :-)
leewillis77 commentedon Feb 8, 2021
I've had a second pair of eyes over the dev note for #27966 and it's updated based on feedback here:
https://gist.github.com/leewillis77/088c47a89d3319d45f93a7a3b9774ba3
I don't have the ability to post on make core though so someone else would have to actually post it...
noisysocks commentedon Feb 9, 2021
No worries I can handle that.
kevin940726 commentedon Feb 9, 2021
Dev note for: Add widget id to blocks in the widgets screen #28379
cloneBlocknow only clones the attributes that are specified in the block types, follows the same logic as increateBlock.gziolo commentedon Feb 9, 2021
Dev note for Data: Use store definition to reference registered stored when using
@wordpress/dataAPI #26655Changes in
@wordpress/dataAPIAs of #26655, it is now possible to pass a store definition instead of the string when referencing a given store registered with
@wordpress/dataAPI. This change impacts mostly the Gutenberg project. It is fully backward compatible, so plugin and theme authors can continue using hardcoded names when referencing data stores.The store registration has now two new methods
registerthat takes the store definition as a param to register a store. There is also a new helper methodcreateReduxStorethat creates a data store definition for the provided Redux store options containing properties describing reducer, actions, selectors, controls, and resolvers.Example of the store usage before this change:
Example of the new recommended usage:
This new capability enables additional static analysis in the Gutenberg project that improve code quality. We can ensure now that all stores used in a given module are always properly defined as dependencies. In effect, it provides the correct loading order of JavaScript files. It also opens possibilities for new store implementations that share the same high-level API.
Finally, there is a new optional ESLint rule
@wordpress/data-no-store-string-literalsavailable in@wordpress/eslint-pluginpackage. It ensures that string literals aren't used for accessing@wordpress/datastores when using API methods. The store definition is promoted as the preferred way of referencing registered stores.oandregal commentedon Feb 18, 2021
Dev note for: Block supports for style properties added since 5.6. This is so themes have a heads-up on styles that users can now tweak.
Following the initial work done for WordPress 5.6 to automatically support style properties for blocks and expose UI controls for users, in WordPress 5.7 this mechanism has been expanded to new blocks. Themes may want to review if their styles need to adjust their specificity to accommodate the user choices.
User have now the ability to update the font size of the following blocks via the inspector panel:
core/code,core/list,core/preformatted,core/verse.youknowriad commentedon Feb 18, 2021
URLInput component
In previous versions the URLInput component available on the
@wordpress/componentspackage and script had theautoFocusprop set to true by default. The main reason for this was that the component was used as the first input in different modals/popovers (link, inserter) but most third-party usage had to explicitly disable that behavior (in blocks for instance). In WordPress 5.6, that prop isfalseby default. It's a better choice for most use-cases as auto-focus is often an accessibility bug, but consider checking your components if you previously relied on this behavior.ZebulanStanphill commentedon Feb 20, 2021
@youknowriad I spotted a little typo:
talldan commentedon Feb 24, 2021
Dev note for: Buttons block: overhaul alignment/justification controls #23168
Changes to the Buttons block's alignment options
The buttons block now provides justification options for its inner button blocks (Justify items left, Justify items center, Justify items right, Space between items).
To implement this feature, the block's
<div>element is now a flexbox container (display: flex)—previously it wasdisplay: block. It's recommended that theme developers check that the buttons block still displays correctly for users for the various alignment and justification options it now provides.The left and right alignment options for the buttons block have now been deprecated. Users can achieve the same results using a combination of a full alignment and left or right justification. Any buttons blocks that were already added to posts with left and right alignment will be migrated (via the block deprecation system) to use justification in this way when a post is loaded—users should see no change in the visual appearance of buttons.
noisysocks commentedon Feb 24, 2021
Thanks everyone!
ZebulanStanphill commentedon Feb 24, 2021
I'd tweak the dev note to be a bit clearer:
The Buttons block now provides justification options for its inner button blocks (Justify items left, Justify items center, Justify items right, Space between items).
To implement this feature, the block's
<div>element is now a flexbox container (display: flex)—previously it wasdisplay: block. It's recommended that theme developers check that the buttons block still displays correctly for users for the various alignment and justification options it now provides.The left, right, and center block alignment options for the buttons block have now been deprecated. The center option was deemed redundant with the introduction of the "Justify items center" option, and the left and right options (which applied
display: floatstyling) were considered confusing since most users expected them to behave like the new left and right item justification controls.Users can achieve the same results as the center block alignment option by using the "Justify items center" option, and they can recreate the wrapping/float behavior of the left and right block alignment options by wrapping the Buttons block in a Group block and using its block alignment controls.
Since the wrapping behavior was unexpected and out of place for most use cases of the block, any Buttons blocks that were already added to posts using left, right, or center alignment will be migrated (via the block deprecation system) to use the corresponding justification options when a post is loaded in the editor—Buttons on the front-end will continue to appear as they did until their containing post is edited and updated.