feat: @y/prosemirror v2 + @y/y v14 integration#2739
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
776ca34 to
5fae30a
Compare
5fae30a to
d70df64
Compare
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
00569fc to
38d3e13
Compare
38d3e13 to
a56bb0d
Compare
a9f7067 to
2ad90dc
Compare
a56bb0d to
6b9a6f6
Compare
e44394d to
17ab49f
Compare
6b9a6f6 to
d13fcac
Compare
|
Make suggestionFixture.sync() async and wait for the ySyncPlugin to flush PM->Y into baseDoc before encoding it into suggestionDoc. The previous synchronous sync() encoded a stale/empty baseDoc, causing racy/cross-contaminated baseDoc snapshots in addRemoveBlocks tests. - await sync() at all single-user fixture call sites - capture baseDocXml before enableSuggestions() so baseDoc snapshots are deterministic and not polluted by attribution marks - update suggestionDoc/editorHtml snapshots for v14 userIds="" attr - re-enable add-heading-to-empty-doc and delete-image-block (now pass)
Wire the 13-versioning-yjs14 example to the YHub versioning adapter and make YHub's /activity timeline the source of truth for versions. - yhub.ts: fix v1/v2 update encoding mismatch (getContent converts v1->v2, create writes v1); list/create/restore now derive version identity from YHub activity timestamps; drop unused metaStore concept and updateSnapshotName - Versioning.ts: make Yjs adapter applyRestore a no-op since YHub /rollback publishes the reverting update over live sync - Snapshot.tsx: render version name as static text when updateSnapshotName is unsupported instead of a read-only input - example: point websocket + versioning at YHub, load versions on mount, remove localStorage/named-filter scaffolding
- remove preloadDemoDocument seeding and its versionData.json/preloadVersions.ts - bump @y/prosemirror to ^2.0.0-4 in generated playground examples
Summary
Adds support for the new
@y/prosemirrorv2 and@y/yv14 (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/yv14 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/yentry point@y/prosemirrorv2 with TipTap/BlockNote@y/prosemirrorv2@y/yv14 APIsVersioning system (
@blocknote/coreextensions)yjspackageVersioningSidebar,Snapshot,CurrentSnapshotEditor improvements
y-attributed-deletemark) to avoid corrupting suggestionsgetBlockInfoFromPosnow handles nodes with marks (suggested changes)moveBlocks,replaceBlocks,splitBlock,nestBlock) to handle marked/attributed nodesPatches
@y/prosemirror@2.0.0-2— extensive patch for BlockNote compatibility@y/y@14.0.0-rc.16— minor patchlib0@1.0.0-rc.13— compatibility patchExamples
Tests
Impact
@y/packages are optional peer dependencies@blocknote/core/yexport for v14 users, parallel to existing@blocknote/core/yjsScreenshots/Video
Live examples:
Checklist