Skip to content

Dev Notes for WordPress 5.8 #32365

Closed
Closed

Description

@youknowriad

https://github.com/WordPress/gutenberg/pulls?q=is%3Apr+is%3Amerged+label%3A%22Needs+Dev+Note%22

Here are all the PRs that need a Dev Note to be written. I tried organizing the PRs in different sections and each section represents a single make/core post.

Please share the dev notes here as comments here or links to shared documents. Please let me know if you're unable to write a note for your PR. The notes should be posted before WP 5.8 RC (June 29), but the sooner, the better.

Global Styles and Global Settings (theme.json)

Template Mode for classic themes

New Block Supports flags and Customizations Options

It seems most PRs introducing these are unlabeled. cc @nosolosw in case you know what new options have been stabilized/introduced during the 5.8 cycle.

Widgets Editor

A post about the new widgets editor and how it impacts third-party developers.

Related PRs:

Various Block Editor API removals.

Various new Block Editor APIs

Various changes to styling of blocks and editor potentially impacting themes.

I feel there's a number of unlabeled changes here. Let me know what we should include here cc @carolinan @scruffian @aristath @MaggieCabrera @kjellr

Please update the issue If you think there are other changes that would require a dev note.

Also cc @zzap as documentaion lead.

Activity

  1. added
    [Type] Tracking Issue
    on Jun 1, 2021
  2. MaggieCabrera commented on Jun 2, 2021

    @MaggieCabrera
    Contributor

    #30804 Comes to mind as a change that can affect block-based themes using the Query block

  3. youknowriad commented on Jun 2, 2021

    @youknowriad
    ContributorAuthor

    @MaggieCabrera Query block has never been released in Core so maybe we need a post for all new blocks but it's not necessarily something for theme authors I think.

  4. MaggieCabrera commented on Jun 2, 2021

    @MaggieCabrera
    Contributor

    @MaggieCabrera Query block has never been released in Core so maybe we need a post for all new blocks but it's not necessarily something for theme authors I think.

    If they are using the Query block in their templates they need to change the markup (we've had to do it for some of our themes), but I agree it's not relevant in this case since the block is not in Core yet so forget I mentioned it :D

  5. oandregal commented on Jun 2, 2021

    @oandregal
    Member

    ― A post to introduce the theme.json file

    Probably worth pointing to the existing docs as well, which contains the rationale, examples, and the whole specification. This note can also be useful in explaining how the theme.json values relate to the existing add_theme_support values.

    The docs also need to be adapted to highlight which parts are stable and landed in 5.8 and which parts are plugin-only.

    ― New Block Supports flags and Customizations Options

    The new additions also need to be documented in the block supports doc. I compared current 5.8 with what was in the 5.7 line and this is what I see:

    ― Should we remove these block supports from core?

    I've noticed a few block supports have been ported to core in WordPress/wordpress-develop#1176, such as: __experimentalBorder, __experimentalFontFamily, __experimentalFontStyle, __experimentalFontWeight, __experimentalTextDecoration, __experimentalTextTransform. The corresponding theme.json settings (as well as styles) have not been included. Because not allowed settings are removed and we check for them to decide whether to show the UI for these, these won't work in the editor anyway without the plugin.

    However, I wonder if we should remove this code from core?

    A plugin could enable them by hooking into the block editor settings filter. The UI for these is not clear yet. And for some, such as border, @aaronrobertshaw had queued up some breaking changes.

  6. youknowriad commented on Jun 2, 2021

    @youknowriad
    ContributorAuthor

    However, I wonder if we should remove this code from core?

    Some core blocks do use these block supports even if they are experimental (not allowed for third-party blocks yet)

  7. aaronrobertshaw commented on Jun 3, 2021

    @aaronrobertshaw
    Contributor

    The UI for these is not clear yet. And for some, such as border, @aaronrobertshaw had queued up some breaking changes.

    There are two PRs specifically relating to the border block support. One to allow non-pixel units and another to allow individual border radius values per corner. These are needed to refine the border support UI before the support gets wider use (#31585).

    The PRs updating the border support both currently contain code to handle backwards compatibility so if those approaches are accepted those PRs wouldn't be breaking changes. Still, minimising their exposure before those changes land makes sense to me.

  8. oandregal commented on Jun 3, 2021

    @oandregal
    Member

    Some core blocks do use these block supports even if they are experimental (not allowed for third-party blocks yet)

    What's the expectation of those block supports I shared? Is it that they work with WordPress 5.8 without the plugin? If so, we need to port more things to theme.json and probably the PRs Aaron shared as well. My understanding was that they didn't.

  9. youknowriad commented on Jun 3, 2021

    @youknowriad
    ContributorAuthor

    What's the expectation of those block supports I shared? Is it that they work with WordPress 5.8 without the plugin?

    I think for me, there are two different things:

    • Do we want to allow core blocks to use these feature ? if it's the case, we need to backport the theme.json support for this (to enable/disable).
    • Do we want to allow third party core blocks to use these features? If it's the case, we need to backport the theme.json support and stabilize the flag.
    • If we still consider breaking changes for any of these, keep them unstable, and don't backport into Core.
  10. ntsekouras commented on Jun 3, 2021

    @ntsekouras
    Contributor

    Dev note for Additions to the Block Patterns Registration API #30471

    Contextual patterns for easier creation and block transformations

    We’ve all been there. Staring at a blank page sometimes with an idea of what you want to create and sometimes with a mind as blank as the page. To make the creation process easier there is now a way to suggest patterns based on the block one is working with. This is now implemented for Query block and there are some core patterns to start with.

    In addition there is way to suggest pattern transformations that are contextual to the currently selected blocks. So how this is different to the patterns current behaviour? Patterns have some demo content and you have to update that content after insertion. With this feature it's possible to use some patterns and retain some of attributes/content you already have.

    So it's for existing blocks!

    An important thing to note here is that a pattern transform can result to adding more blocks than the ones currently selected.
    You can see this with an example like the below where we have a Quote block but the pattern consist of more blocks:

    Quote.mp4

    This is the first iteration of the feature that covers most simple blocks (without innerBlocks). A new experimental API has been created where we can mark what block attributes count as content attributes. You can see more details in the PR.

    In the long run as this work continues and spreads to more blocks, it will be easier to create content and get inspired without leaving the editor.

    Pattern Registration API

    if you’re creating your own custom block patterns, there’s a new blockTypes property that will allow your patterns to show up in other contexts like the transform menu. blockTypes property is an array containing the block names.

    example

    register_block_pattern(
    	'heading-example',
    	array(
    		'title'         => __( 'Black heading' ),
    		'categories'    => array( 'text' ),
    		'blockTypes'    => array( 'core/heading' ),
    		'viewportWidth' => 500,
    		'content'       => '<!-- wp:heading {"level":3,"backgroundColor":"black","textColor":"white"} -->
    							<h3 class="has-white-color has-black-background-color has-text-color has-background">Demo heading</h3>
    							<!-- /wp:heading -->',
    	)
    );
    

    --props to @annezazu for some of the above content 💯

  11. dashkevych commented on Jun 3, 2021

    @dashkevych

    Since 5.8 includes support for Template Mode, would it be possible to include information in notes on how to detect a custom template using PHP?

    For example, currently we can use the following conditional tag to detect a template provided by the theme:

    is_page_template( 'templates/front-page.php' );

    Is it possible to detect a custom template built by the user using Template Mode?

  12. oandregal commented on Jun 4, 2021

    @oandregal
    Member

    re: Should we remove these block supports from core?

    I took a deeper look at this and discussed with some folks (Riad, Jorge, Miguel, Aaron): these aren't expected to work without the plugin.

    As per the code in core: it's fine that it stays there. When the plugin registers the supports it overwrites the core's, so two different implementations can't run at the same time. There's still the possibility that any other plugin activates them. We deem this as no problematic as they're experimental and judge the cost of removing them/syncing with core higher.

    From the block supports side, we only need clarification/dev notes for the the ones at "New Block Supports flags and Customizations Options" here.

  13. zzap commented on Jun 8, 2021

    @zzap
    Member

    Hello friends, I come bearing gifts and praises ❤️ Not sure if you hear this often enough but you're all heroes and, personally, I admire your work, dedication and, especially, patience with us who wants more docs.

    Now business. We have 3 Trac tickets for Editor component marked for dev note. Reviewing everything in this thread, I believe they're not mentioned (correct me if I'm wrong) but think we could use some info about them in dev notes. These are:

    • #50328 - Enqueue script and style assets only for blocks present on the page
    • #52920 - Editor: Abstract block editor configuration
    • #53233 - Editor: Extend register_block_type to accept the path file or folder with block.json

    I have two questions at this point:

    1. Will these 3 be covered in already listed dev notes?
    2. If answer to the first question is no, is anyone volunteering to write them? (P.S. I have a reputation of bribing docs contributors with cookies, just saying 🤷‍♀️)

    Thanks ❤️

  14. youknowriad commented on Jun 8, 2021

    @youknowriad
    ContributorAuthor

    hi @zzap thanks for highlighting these.

    #50328 - Enqueue script and style assets only for blocks present on the page

    @aristath would know more, I believe we did a post about it (maybe a dev note in the previous release or something but I'm uncertain). If there are changes in the behavior, a dev note would be needed yes.

    #52920 - Editor: Abstract block editor configuration

    Good one yes, I'll add to the list cc @gziolo

    #53233 Editor: Extend register_block_type to accept the path file or folder with block.json

    This one is already covered by: "Consolidate block registration using registerBlockType #32030 #30293"

  15. gziolo commented on Jun 8, 2021

    @gziolo
    Member

    I'm planning to provide this week both dev notes @zzap and @youknowriad discussed above 👍🏻

  16. 7 remaining items

  17. mkaz commented on Jun 25, 2021

    @mkaz
    Member

    @nosolosw published Introducing theme.json dev note 👍 marked complete above

  18. youknowriad commented on Jun 28, 2021

    @youknowriad
    ContributorAuthor

    Block Editor API deprecation and removals

    Remove APIs

    Keeping deprecated JavaScript APIs around has a cost on performance and bundle size, this means at some point we need to consider removing some of the very old deprecated APIs, especially the ones with low usage. WordPress 5.8 does remove two APIs that were deprecated on WordPress 5.2.

    • EditorGlobalKeyboardShortcuts component, this was a component used to define some keyboard shortcuts of the block editor, it was not really meant to be used by third-party developers. We verified that it's not used by any plugin in the repository but if you rely on this component, it should be safe to just replace with VisualEditorGlobalKeyboardShortcuts.
    • The hasUploadPermissions selector from the core store. We contacted all the three plugins in the repository that were using this API. If you're still relying on this selector, it can be safely replaced with select( 'core' ).canUser( 'create', 'media' )

    Removed blocks

    Before WordPress 5.0 and in the very early days of the Gutenberg plugin, we used to have a block called Subheading, this block has never been included in WordPress Core and it was hidden/deprecated very early. We expected its usage to be very small. WordPress 5.8 removes the code of this block meaning that if you open content relying on that block in the editor, it will ask you to fallback to the HTML block instead. We don't expect this to have a noticeable impact on the frontend of your site.

  19. ellatrix commented on Jun 28, 2021

    @ellatrix
    Member

    This is the proposed dev note for the iframe in the template editor: https://make.wordpress.org/core/?p=89760&preview=1&_ppp=b976a86b78

  20. mkaz commented on Jun 29, 2021

    @mkaz
    Member

    @ellatrix That looks good, I do a couple of minor edits and added the proper tags. Feel free to review and publish when ready 👍

    @youknowriad The Block Editor API deprecations looks good. :shipit:

  21. youknowriad commented on Jun 29, 2021

    @youknowriad
    ContributorAuthor

    @mkaz I also have this dev note that is almost ready https://make.wordpress.org/core/?p=89618&preview=1&_ppp=1f2254d383 it's just missing a potential Gif for the layout options in the sidebar.

    I'm AFK the next couple days, so feel free to ship it once you think it's ready.

  22. mkaz commented on Jun 29, 2021

    @mkaz
    Member

    I added a GIF and published layout dev note at: https://make.wordpress.org/core/2021/06/29/on-layout-and-content-width-in-wordpress-5-8/

    I also published the iframed editor here: https://make.wordpress.org/core/2021/06/29/blocks-in-an-iframed-template-editor/

    Both marked complete above 👍

  23. aristath commented on Jul 1, 2021

    @aristath
    Member

    Enqueue script and style assets only for blocks present on the page @aristath

    https://make.wordpress.org/core/2021/07/01/block-styles-loading-enhancements-in-wordpress-5-8/

  24. youknowriad commented on Jul 5, 2021

    @youknowriad
    ContributorAuthor

    The field guide is now published and it seems the latest items here are not that important to require their own dev note, so I'm going to close this temptatively. Thanks all for your work on these dev notes.

  25. ntsekouras commented on Jul 5, 2021

    @ntsekouras
    Contributor

    Just noting that I don't believe the patterns one has been published: #32365 (comment).

    It's perfectly fine if we don't want to, but noting in case it has slipped through the cracks 😄

  26. youknowriad commented on Jul 5, 2021

    @youknowriad
    ContributorAuthor

    @ntsekouras missed this one, maybe we can do a "Miscellaneous block editor API changes" and include it with some other remaining small ones. WDYT @mkaz

  27. niklasp commented on Jan 24, 2022

    @niklasp
    Contributor

    @youknowriad Please write a dev note for #31375. I am totally lost with styling and hooking into the correct functions now.

  28. youknowriad commented on Jan 24, 2022

    @youknowriad
    ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] Tracking Issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions