Skip to content

feat: @y/prosemirror v2 + @y/y v14 integration#2739

Draft
nperez0111 wants to merge 14 commits into
mainfrom
y-prosemirror-v14
Draft

feat: @y/prosemirror v2 + @y/y v14 integration#2739
nperez0111 wants to merge 14 commits into
mainfrom
y-prosemirror-v14

Conversation

@nperez0111

@nperez0111 nperez0111 commented May 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for the new @y/prosemirror v2 and @y/y v14 (Yjs 14) packages alongside the existing Yjs 13 (yjs, y-prosemirror) integration. This includes new collaboration bindings, versioning extensions, forked document support, and suggestion tracking built on the v14 APIs.

Rationale

The @y/y v14 ecosystem introduces significant improvements over Yjs 13, including better TypeScript support, a new protocol layer, and improved ProseMirror bindings. This PR adds first-class support for v14 while keeping full backward compatibility with Yjs 13.

Changes

New @blocknote/core/y entry point

  • YSync extension — ProseMirror plugin bridging @y/prosemirror v2 with TipTap/BlockNote
  • YCursorPlugin — collaborative cursor/selection rendering for v14
  • Suggestions extension — track suggested changes (insertions/deletions) via @y/prosemirror v2
  • ForkYDoc extension — fork a Yjs document for isolated editing, then merge or discard changes
  • Versioning extension — snapshot-based version history using @y/y v14 APIs
  • RelativePositionMapping — cursor position mapping across collaborative edits
  • YjsThreadStore — comment threads stored in Yjs, with REST-backed variant

Versioning system (@blocknote/core extensions)

  • Generic Versioning extension — framework-agnostic version history with preview/restore, works with pluggable backends (in-memory, Yjs 13, Yjs 14)
  • In-memory versioning — simple snapshot store for non-collaborative use
  • Yjs 13 versioning — snapshot-based version history for the existing yjs package
  • React components: VersioningSidebar, Snapshot, CurrentSnapshot

Editor improvements

  • UniqueID — skip ID rewriting for suggested-deletion blocks (nodes with y-attributed-delete mark) to avoid corrupting suggestions
  • Block infogetBlockInfoFromPos now handles nodes with marks (suggested changes)
  • PreviousBlockType — scoped to changed range instead of full document scan
  • Various fixes for block manipulation commands (moveBlocks, replaceBlocks, splitBlock, nestBlock) to handle marked/attributed nodes

Patches

  • @y/prosemirror@2.0.0-2 — extensive patch for BlockNote compatibility
  • @y/y@14.0.0-rc.16 — minor patch
  • lib0@1.0.0-rc.13 — compatibility patch

Examples

  • Versioning + Suggestions — full demo with comments sidebar, suggestion actions, version history
  • YHub — 4-mode editor demo (edit, suggest, comment, view)
  • Yjs 13 versioning snapshots — version history with Yjs 13 backend
  • Yjs 14 versioning snapshots — version history with Yjs 14 backend
  • Generic versioning — standalone versioning without collaboration

Tests

  • UniqueID duplicate handling (plain + suggested-deletion blocks)
  • ForkYDoc (fork, merge, discard for both v13 and v14)
  • Versioning (preview, restore, snapshot management for all backends)
  • RelativePositionMapping (position tracking across edits)
  • YjsThreadStore (CRUD for comment threads)
  • getBlockInfoFromPos (marked node handling)

Impact

  • No breaking changes — all @y/ packages are optional peer dependencies
  • Existing Yjs 13 integrations continue to work unchanged
  • New @blocknote/core/y export for v14 users, parallel to existing @blocknote/core/yjs

Screenshots/Video

Live examples:

Checklist

  • Code follows the project's coding standards
  • Unit tests covering the new features have been added
  • All existing tests pass
  • The documentation has been updated to reflect the new features

@vercel

vercel Bot commented May 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blocknote Ready Ready Preview Jun 17, 2026 10:53am
blocknote-website Error Error Jun 17, 2026 10:53am

Request Review

@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 56e8bdaa-bc2e-44c4-82b9-76057486f8aa

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch y-prosemirror-v14

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new

pkg-pr-new Bot commented May 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/@blocknote/ariakit@2739

@blocknote/code-block

npm i https://pkg.pr.new/@blocknote/code-block@2739

@blocknote/core

npm i https://pkg.pr.new/@blocknote/core@2739

@blocknote/mantine

npm i https://pkg.pr.new/@blocknote/mantine@2739

@blocknote/react

npm i https://pkg.pr.new/@blocknote/react@2739

@blocknote/server-util

npm i https://pkg.pr.new/@blocknote/server-util@2739

@blocknote/shadcn

npm i https://pkg.pr.new/@blocknote/shadcn@2739

@blocknote/xl-ai

npm i https://pkg.pr.new/@blocknote/xl-ai@2739

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/@blocknote/xl-docx-exporter@2739

@blocknote/xl-email-exporter

npm i https://pkg.pr.new/@blocknote/xl-email-exporter@2739

@blocknote/xl-multi-column

npm i https://pkg.pr.new/@blocknote/xl-multi-column@2739

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/@blocknote/xl-odt-exporter@2739

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/@blocknote/xl-pdf-exporter@2739

commit: c6143ef

@nperez0111 nperez0111 force-pushed the y-prosemirror-v14 branch from 00569fc to 38d3e13 Compare May 13, 2026 16:09
@nperez0111 nperez0111 force-pushed the y-prosemirror-v14 branch from 38d3e13 to a56bb0d Compare May 13, 2026 16:12
@nperez0111 nperez0111 changed the base branch from main to decouple-yjs May 13, 2026 16:25
@nperez0111 nperez0111 force-pushed the decouple-yjs branch 3 times, most recently from a9f7067 to 2ad90dc Compare May 13, 2026 17:34
@nperez0111 nperez0111 force-pushed the y-prosemirror-v14 branch from a56bb0d to 6b9a6f6 Compare May 13, 2026 20:12
@nperez0111 nperez0111 force-pushed the decouple-yjs branch 4 times, most recently from e44394d to 17ab49f Compare May 14, 2026 05:20
@nperez0111 nperez0111 force-pushed the y-prosemirror-v14 branch from 6b9a6f6 to d13fcac Compare May 14, 2026 05:23
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://TypeCellOS.github.io/BlockNote/pr-preview/pr-2739/

Built to branch gh-pages at 2026-06-17 07:56 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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.

1 participant