Skip to content

Include the link block of rich text blocks in the block meta - #6362

Open
VPS-Obi wants to merge 2 commits into
nextfrom
claude/relaxed-allen-03kdes
Open

VPS-Obi wants to merge 2 commits into
nextfrom
claude/relaxed-allen-03kdes

Conversation

@VPS-Obi

@VPS-Obi VPS-Obi commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Addresses #6340 (comment): add the rich text blocks' link blocks to the block meta instead of adding a new referencedBlocks field to Block.

Rich text blocks created with createRichTextBlock now use the new RichTextBlock field kind (instead of Json) for their draftContent field, which contains the link block:

{
    "name": "draftContent",
    "kind": "RichTextBlock",
    "nullable": false,
    "linkBlock": "Link"
}

Rich text blocks created with createTipTapRichTextBlock contain the link block in their existing TipTapRichTextBlock field, next to the child blocks. It is omitted when links are disabled:

{
    "name": "tipTapContent",
    "kind": "TipTapRichTextBlock",
    "nullable": false,
    "childBlocks": {},
    "linkBlock": "Link"
}

Since the field kind of draftContent changes, this is a breaking change for projects that read block-meta.json themselves. The changeset is therefore a major one and the branch targets next (the base branch of this PR still needs to be changed from main to next).

The second commit starts the v11 migration guide with the section for this change.

https://claude.ai/code/session_01HpJKNHRbSSBCFdfgLao1zo

@VPS-Obi VPS-Obi self-assigned this Sep 14, 2026
@VPS-Obi VPS-Obi changed the title Include link block in rich text block metadata Include the link block of rich text blocks in the block meta Sep 14, 2026
@VPS-Obi
VPS-Obi force-pushed the claude/relaxed-allen-03kdes branch from e779920 to 58d31ed Compare September 14, 2026 12:37
Comment thread .changeset/rich-text-block-meta-link-block.md
Comment thread .changeset/rich-text-block-meta-link-block.md Outdated
@VPS-Obi
VPS-Obi marked this pull request as ready for review September 14, 2026 13:50
@VPS-Obi
VPS-Obi requested a review from nsams September 14, 2026 13:50
@VPS-Obi
VPS-Obi force-pushed the claude/relaxed-allen-03kdes branch from 58d31ed to d3bf2c7 Compare September 14, 2026 14:05
@VPS-Obi
VPS-Obi added this pull request to stack #6365 September 14, 2026 14:21
@VPS-Obi
VPS-Obi force-pushed the claude/relaxed-allen-03kdes branch from d3bf2c7 to aa95ecd Compare September 15, 2026 06:17
@BlockDataMigrationVersion(migrate.version)
class RichTextBlockData extends BlockData {
@BlockField({ type: "json" })
@BlockField({ type: "richTextBlock", linkBlock: LinkBlock })

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if someone doesn't use our cli package to generate-block-types and accesses the bkock-meta json directly this is incompatible. Should we ignore that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've found five projects that have a custom generate-block-types.ts script, two of them being unmaintained. Should we update the three projects or target next for this? I can work around the duplicate space block in the application.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@nsams I'd target next and make this a breaking change, what do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if you don't need it in main the easiest solution if of course next.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It now targets next. I also started the migration guide.

The block meta didn't say which link block is used for links inside rich
text content, so consumers of block-meta.json had no way to resolve the
link data embedded in the content.

Blocks created with createRichTextBlock now use a new RichTextBlock field
kind (instead of Json) for draftContent, which carries the link block.
Blocks created with createTipTapRichTextBlock carry it in their existing
TipTapRichTextBlock field, next to the child blocks.

The generated block types are unchanged: rich text fields are still typed
as unknown, but generate-block-types has to know the new field kind.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HpJKNHRbSSBCFdfgLao1zo
@VPS-Obi
VPS-Obi force-pushed the claude/relaxed-allen-03kdes branch from aa95ecd to 02b148d Compare September 17, 2026 12:22
@VPS-Obi
VPS-Obi removed this pull request from stack #6365 September 17, 2026 12:24
@VPS-Obi
VPS-Obi changed the base branch from main to next September 17, 2026 12:24
Add the guide for the breaking changes that are on next so far: the new
RichTextBlock field kind in the block meta and the removal of FormMutation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HpJKNHRbSSBCFdfgLao1zo
@VPS-Obi
VPS-Obi force-pushed the claude/relaxed-allen-03kdes branch from 02b148d to 69bef12 Compare September 17, 2026 12:27
@VPS-Obi
VPS-Obi added this pull request to stack #6398 September 17, 2026 12:30
@VPS-Obi
VPS-Obi requested a review from nsams September 17, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants