Let the framework register the blocks - #1
Merged
Merged
Conversation
edit.jsx rendered the scaffold placeholder "Hero – Block Editor" while save.jsx stores "Hero": the editor did not show what the page would hold. It now mirrors save.jsx, as make:block's static stub does.
Framework v13.32.0-beta.7 registers every theme's resources/views/blocks itself. BlocksServiceProvider deferred its own registration to `init`, which has already run when a theme's providers boot in a web request: it only ever registered the blocks under WP-CLI. It goes, with the contract test that required it. The install check asked WP-CLI for the registry, the context that hid this. It now asks the REST API, logged in, over HTTP. v13.4.0 registers no block in a web request and is tagged, so its leg passes --expect-blocks=no and the check asserts that absence. The overlay only added and overwrote files, so a file deleted by the commit under test survived from the tag and CI measured a theme that still had it. It now removes, under app/, config/ and resources/, what the commit no longer has.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
BlocksServiceProvideronly ever registered the blocks under WP-CLI: in a web request,inithas already run when a theme's providers boot. Since framework v13.32.0-beta.7 the framework registersresources/views/blocksitself.hero/edit.jsxshowed the placeholder "Hero – Block Editor" whilesave.jsxstores "Hero".Changes
wp eval.v13.4.0leg:--expect-blocks=no. That version never registered blocks in a web request, so the check asserts their absence.dev-mainleg: every block must be present.app/,config/,resources/). Without that, CI would have measured the theme with the provider still there, from tag v1.4.4.hero/edit.jsxmirrorssave.jsx.After the tag: remove
previewGapfordefault/heroin the framework'stests/e2e/specs/blocks.spec.ts.