Skip to content

Conversation

t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Aug 7, 2025

Part of #70743

Why?

If the block is registered with API version 2 or lower, the post editor may work as a non-iframe editor. However, we aim to have all editors work as iframes in the future. To encourage more block developers to test their products in the iframe editor, let's only allow the value 3.

Testing Instructions

  • Create the following block.json file:
    {
    	"$schema": "https://raw.githubusercontent.com/WordPress/gutenberg/refs/heads/block-json-schema-api-version-3/schemas/json/block.json",
    	"name": "test/test",
    	"title": "Test Block"
    }
  • The code editor should warn you when anything other than 3 is entered.
  • Confirm the description text.

Screenshots or screencast

image image

@t-hamano t-hamano self-assigned this Aug 7, 2025
@t-hamano t-hamano added [Type] Developer Documentation Documentation for developers Developer Experience Ideas about improving block and theme developer experience labels Aug 7, 2025
@t-hamano t-hamano changed the title block.json schema: Only allow 3 in the apiVersion field block.json schema: Require 3 in the apiVersion field Aug 7, 2025
@t-hamano t-hamano changed the title block.json schema: Require 3 in the apiVersion field block.json schema: Make the apiVersion field required and only allow 3. Aug 7, 2025
@t-hamano t-hamano changed the title block.json schema: Make the apiVersion field required and only allow 3. block.json schema: Make the apiVersion field required and only allow 3 Aug 7, 2025
@t-hamano t-hamano force-pushed the block-json-schema-api-version-3 branch from bef7209 to 967f93e Compare August 7, 2025 08:11
@t-hamano t-hamano added the No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core label Aug 7, 2025
@t-hamano t-hamano force-pushed the block-json-schema-api-version-3 branch 2 times, most recently from 1cf4e74 to 626d34c Compare August 7, 2025 12:47
Copy link

github-actions bot commented Aug 7, 2025

Flaky tests detected in 603028b.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/16859849782
📝 Reported issues:

@t-hamano t-hamano force-pushed the block-json-schema-api-version-3 branch from 626d34c to 275bbff Compare August 8, 2025 07:15
@t-hamano t-hamano marked this pull request as ready for review August 8, 2025 08:15
Copy link

github-actions bot commented Aug 8, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @t-hamano!

This looks good for me. Let's keep track of all apiVersion related changes, and we can combine them in a single dev note.

@t-hamano
Copy link
Contributor Author

@Mamaduka Thanks for the review!

@t-hamano t-hamano merged commit 08921f9 into trunk Aug 13, 2025
69 checks passed
@t-hamano t-hamano deleted the block-json-schema-api-version-3 branch August 13, 2025 06:06
@github-actions github-actions bot added this to the Gutenberg 21.5 milestone Aug 13, 2025
@t-hamano t-hamano added the Needs Dev Note Requires a developer note for a major WordPress release cycle label Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Experience Ideas about improving block and theme developer experience Needs Dev Note Requires a developer note for a major WordPress release cycle No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants