Skip to content

Generate TipTapNode type for rich text blocks - #6200

Draft
VPS-Obi wants to merge 2 commits into
mainfrom
claude/tiptapnode-generate-block-types-dbuvaw
Draft

Generate TipTapNode type for rich text blocks#6200
VPS-Obi wants to merge 2 commits into
mainfrom
claude/tiptapnode-generate-block-types-dbuvaw

Conversation

@VPS-Obi

@VPS-Obi VPS-Obi commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR improves type safety for TipTap rich text blocks by generating proper TypeScript types instead of using unknown.

Changes

  • Added TipTapNode and TipTapMark interface definitions to the generate-block-types command output
  • Changed TipTap rich text block types from unknown to TipTapNode in generated block types
  • The type definitions are only included in the generated output when TipTap rich text blocks are actually used
  • Updated the demo site to remove unnecessary type casting, now that the block is properly typed

Implementation Details

  • A new isTipTapNodeTypeUsed flag tracks whether any TipTap rich text blocks are present
  • The TipTapNode and TipTapMark interfaces are prepended to the generated content only when needed
  • TipTapNode supports the full TipTap node structure with optional attrs, content, marks, and text properties
  • This eliminates the need for consumers to cast TipTap content before using it

https://claude.ai/code/session_01KeW8jj95RuXHci5TBJKfKy

claude added 2 commits August 13, 2026 12:33
TipTap rich text fields were generated as unknown, so consumers had to
cast the content before rendering it. Generate a TipTapNode (and
TipTapMark) type matching the one exported by site-react whenever a
TipTap rich text block is present, and use it for those fields.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeW8jj95RuXHci5TBJKfKy
@VPS-Obi VPS-Obi changed the title Generate TipTapNode type for rich text fields Generate TipTapNode type for rich text blocks Aug 13, 2026
attrs?: Record<string, unknown>;
}

export interface TipTapNode {

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.

duplicating the TipTapNode that is already defined in site-react is not optimal.

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