Remove content-container support (decision PR) - #3009
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Removes the ability to combine content: "inline" / "plain" with children on a block config. A "content container" compiled to three ProseMirror nodes (the block node plus generated <type>__content and <type>__children nodes); all of that machinery is deleted: - the three-node compilation path (buildContentContainerNode) and the extraNodes plumbing through the spec and extension manager - the containerContent node group, the generated node names, and the isContentContainerNode / isContainerBlockNode predicates, collapsing every isContainerNode(x) || isContentContainerNode(x) site onto the pure-container predicate - the content-container branches in keyboard behavior (Enter splits the content head into a first child, Backspace merges the first child back into it, mergeIntoContainerContent), fixContainer, block/node conversions, HTML serializers, and the React node view - the tests, fixtures, and docs sections that covered them Combining children with any content other than "none" is now a schema-creation error, keeping the door open to re-add the combination later. Pure containers (content: "none" + children - callout, column, columnList) are unaffected; the string-prop editable-title pattern is now the documented way to give a container a heading.
2f57816 to
7ec114f
Compare
What this PR is
A decision artifact for the container blocks API, stacked on
container-blocks/examples-docs:content: "inline" | "plain"combined withchildren) are cut from v1. Containers are alwayscontent: "none"; an editable title/caption is a string prop rendered as an input (the pattern the callout example and docs already use).The diff is the exact price of keeping the feature: everything below exists only to support combining a block's own content with children.
What's removed (34 files, +149 / −2,531)
Schema compilation — a content container compiled to three ProseMirror nodes: the block node plus generated
<type>__content(groupcontainerContent) and<type>__childrennodes. Deleted:buildContentContainerNode, the generated node names and their name-collision validation, thecontainerContentgroup, and theextraNodesplumbing through the spec type and extension manager.Predicates —
isContentContainerNodeand theisContainerBlockNodewrapper are gone; everyisContainerNode(x) || isContentContainerNode(x)disjunction (containerNav, fixContainer, insertBlocks, conversions) collapses to the pure-container predicate.getContainerChildrenHolderandgetContentContainerNodeTypes(which existed to locate the generated nodes) are gone with it.Behavior — the keyboard branches for Enter-splits-the-content-head-into-a-first-child and Backspace-merges-the-first-child-back-into-it (
mergeIntoContainerContent), thefixContainerguard that waited for the content head to empty, the splitBlock/mergeBlocks/updateBlock content-container arms, and the content-container paths inblockToNode/nodeToBlock/fragmentToBlocks.DOM contract — the
[data-content-type]/[data-children-of]sibling-region rendering in the internal HTML serializer and the React node view.data-children-ofitself stays: pure containers still use it to scope their round-trip parse rule.Validation —
children+ anycontentother than"none"is now a schema-creation error with a message pointing at the string-prop pattern, keeping the door open to re-add content containers later without an API change.Tests & docs — the contentContainers unit/browser/conversion suites and fixture, the content-container cases in the parse/React/insert-placement tests (a new test asserts the inline+children error), and the "Containers with their own content" / two-regions docs sections. The string-prop editable-title pattern is now the documented pattern.
Untouched
Pure containers (
content: "none"+children) work exactly as before: callout, the container-table example, and xl-multi-column (columnList/column) need no changes. ReactcontentReffor containers keeps working.Verification
vp run lint/vp run format: cleannode docs/validate-links.mjs: 0 errors