docs(blocks): correct block-schema.mdx to the declared vocabulary, drop the phantom slot node - #5937
Merged
Merged
Conversation
) Carries the recorded maintainer ruling on #4895 (Option B: docs-truth fix, family re-scoped as type-level). - Delete the phantom `type: 'slot'` node from the Complete Example template. Nothing registers `slot`, so a reader who copied it got OBJUI-001. - Teach the declared `slotContent` path instead, and state plainly that it is declared-but-not-yet-consumed: nothing reads `slots` / `slotContent` / `template` at runtime. - Frame `BlockSchema` as a definition and drop the component-schema framing for `block-library` / `block-editor` / `block-instance`. - Disambiguate from the slot system that IS wired end to end (slotted record pages), which is an unrelated vocabulary. - Drop the now-stale `slot` entry from DOC_TYPE_EXEMPTIONS in scripts/check-doc-component-types.mjs, and re-point the three terse family reasons at the ruling's framing. Option A (build renderers) is rejected on zero pull; Option C (retire the family) is deferred. Neither is implemented here.
Empty frontmatter: docs and a gate ledger only, no released package `src/` is touched. Declared explicitly rather than left undeclared.
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.
Part of #4895
Carries the maintainer ruling recorded on that card (comment 5339693569, 2026-08-19, 「全部接受」): Option B — docs-truth fix, the block family re-scoped as type-level. Option A (build renderers) was rejected on zero pull; Option C (retire the family) is deferred. Neither is implemented here, and neither is argued for.
Reference keyword is deliberately
Part of, not a closing keyword: the ruling leaves Option C open, to be revisited if a later liveness pass shows the published types inert externally. The measurement below strengthens that future case rather than settling it, so the card should stay open for the PM seat to judge.What was wrong
content/docs/blocks/block-schema.mdx:254taught this insideBlockSchema.template:templateis typedSchemaNode | SchemaNode[], so that snippet sat on the render path — and nothing registersslot. A reader who copied it got the renderer'sOBJUI-001"Unknown component type" panel. That node is deleted; the page now teachesslotContent, the keyBlockSchemaandBlockInstanceSchemaactually declare.The measurement that changed how this is written
The ruling says "teach
slotContent". Before writing that, I measured whetherslotContentis consumed by anything — a renderer, a hook, an adapter. It is not.Every occurrence in the repository, excluding
node_modulesanddist:packages/types/src/blocks.ts:201BlockSchema.slotContentdeclarationpackages/types/src/blocks.ts:377BlockInstanceSchema.slotContentdeclarationpackages/types/src/zod/blocks.zod.ts:77packages/types/src/zod/blocks.zod.ts:134content/docs/blocks/block-schema.mdx:297scripts/check-doc-component-types.mjs:283Zero renderers, zero hooks, zero adapters. The same holds for
slotsandtemplateon this family — outsidepackages/types(the interfaces, the Zod mirror, and that package's own parse test) nothing reads them.So the page does not present
slotContentas the working path. It documents it as the declared path and states plainly that it is not yet consumed. Rewriting one phantom into a second phantom is the failure this card exists to close, so the page carries a status callout up front rather than implying a runtime that does not exist.Two supporting measurements are written into the page because they are what a confused reader needs:
SchemaExampledemos the page embeds are ordinary registered component trees (card,flex,stack,text,icon,button,badge). None carriestype: 'block',slotsorslotContent— nothing on the page was ever exercising the block vocabulary.kind: "slotted",page.slots), consumed byusePageAssignment,PageBlockCanvasandPageBlockInspector, documented atcontent/docs/guide/slotted-pages.md. The page now links there so the twoslotsspellings are not conflated.Full vocabulary audit, not just
slotEvery
typeliteral the page teaches, checked against the gate's derived registered-key universe (659 keys). Line numbers are pre-change.blockBlockSchemadiscriminantblock-editorBlockEditorSchemadiscriminantblock-instanceBlockInstanceSchemadiscriminantblock-libraryBlockLibrarySchemadiscriminantbooleanBlockVariable.typedata typebuttoncarddiviconlistslotstringBlockVariable.typedata typetextslotis the only unregistered value that named a renderable node. The other five unregistered values are each a discriminant of a declared interface or a variable data type, and each keeps a live exemption. So there was no secondslot-shaped defect to sweep up.One incidental observation, not a defect on this page and not changed:
booleanat :62 and :192 is aBlockVariable.typedata type that happens to collide with a registered component key, so it passes the gate's flat rule without needing an exemption. The page is correct; the gate's judgment there is a coincidence rather than a check.Gate calibration — proving the silence is a measurement
Removing the exemption is only meaningful if
check-doc-component-types.mjsactually reads this file. A gate that is silent because it never looked is not a passing gate, so this was calibrated rather than assumed. The mutation was confirmed on disk by grep count, never by the editing tool's exit code, and the script carried atrap ... EXIT INT TERMrestore.Mutation leg — rewrite the registered
type: 'card'node at :223 to a value nothing registers:Gate exit code, captured before any pipe: 1
Restore leg — probe absent, anchor back,
git statusclean for the file. Gate exit code: 0,✅ Every documented component type is registered.The gate reads this page.
The two halves are a matched pair
Both failure directions were exercised, so neither half is passing by accident:
stale-exemption:content/docs/blocks/block-schema.mdx -> slot no code block in that file spells this type any more.content/docs/blocks/block-schema.mdx:305 [unregistered-doc-type] type 'slot' (plaintext)Only both halves together are green.
Gate ledger
The
slotentry inDOC_TYPE_EXEMPTIONSpointed at this card and is dropped, as the ruling requires. With the phantom node gone it would itself report asstale-exemption, so it is deleted rather than re-pointed; a comment records why, so the next reader does not re-add it. The three terse family reasons (block-instance/block-library/block-editor) are re-pointed at the ruling's framing — each now records that the schema is absent fromAnySchemaand has no renderer, which is the fact the gate's own standard asks an exemption reason to name.Counters move coherently:
exempted139 → 138 (one entry gone),registered743 → 744 (the newtype: 'text'site), code blocks 1055 → 1056.Verification — union run at
ca35295a9(final commit)Exit codes captured before any pipe; verdicts quoted from each gate's own output.
check-doc-component-typescheck-doc-linkscheck-control-bytescheck-changeset-presencecheck-changeset-fixedcheck-changeset-no-majorscripts/__tests__/check-doc-component-types.test.ts— 34 passed (34), run atca35295a9from the repo root. Its three live-table assertions were also evaluated directly against this diff:stale-exemptionfindings[];exempted138 (asserted > 50); declaration count 82 → 81 (asserted > 20).eslint scripts/check-doc-component-types.mjs --no-inline-config --format json— 1 file linted, 0 errors, 0 warnings.Declared narrowing:
check-doc-snippet-typesNot run to completion — it needs a full monorepo build. The narrowing is a measurement, taken with that gate's own scanner, not an assumption:
TS_FENCE_LANGUAGES = new Set(['ts', 'tsx', 'typescript'])(its own source, line 224).scanFences()on this page returnsblocks=0, markers=0in both states — atHEAD~1and on the working tree. Every fence on the page isplaintext(10 → 11), and the one I added isplaintexttoo.UNGATED_DOCS, so no ledger entry of mine can go stale.The gate collects zero blocks from this page either way, so this diff cannot change its verdict. CI runs it in full regardless.
Changeset
.changeset/block-schema-docs-truth-4895.md, empty frontmatter — docs and a gate ledger only, no released packagesrc/is touched, declared explicitly rather than left undeclared.objectuihas noskip-changesetlabel; the empty-frontmatter changeset is this repo's declaration mechanism.Deliberately not done
block-library/block-editor/block-instance(Option A, rejected on zero pull).packages/types(Option C, deferred). No published type is touched.Generated by Claude Code