Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

CollaborationExtension registered at runtime installs no sync plugin, so edits never reach the Y.Doc

未關閉
#3,175 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@adarshsm 已經在處理了。

開始於 2026年10月10日。

  • #3178 來自 @adarshsm —— 未關閉

評估

難度
4/5
預估耗時
3-5 天
新手友好度
25/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
react, typescript
領域
frontend, web-dev

研究方向

Start in ExtensionManager.replaceExtension, which installs the plugins of the extension passed in but skips its nested blockNoteExtensions; CollaborationExtension is where YSync, YCursor and YUndo live. Reproduce by creating an editor without the collaboration option and registering CollaborationExtension at runtime, then check whether the Y.XmlFragment changes after typing. Done means nested extensions are installed on runtime registration, or registration throws when they cannot be.

由索引模型根據 Issue 內容生成。

描述

Version: BlockNote 0.55 (@blocknote/core, @blocknote/react)

What happens

Collaboration registered on an editor that already exists doesn't sync. The editor becomes editable, typing works locally, and nothing is written to the Y.XmlFragment, so edits are silently lost.

We create a read-only editor without collaboration (fed a static snapshot, no provider). When the user switches to editing, we attach collaboration to that same editor instead of remounting it, which keeps scroll position and node views stable.

Cause (from reading the source)

ExtensionManager.replaceExtension installs the ProseMirror plugins of the extension it is given, but not those of that extension's nested blockNoteExtensions. For CollaborationExtension, the nested ones carry the actual plugins: YSync, YCursor, YUndo and the rest. So none of them are installed.

Workaround

Registering the sub-extensions flat works, in this order (the cursor plugin reads the sync plugin's state in its init):

  • YSync
  • YCursor
  • YUndo
  • ForkYDoc
  • RelativePositionMapping
  • SchemaMigration

FixUpSchemaExtension is not exported, so it can't be registered that way.

Repro
  1. Create an editor without the collaboration option.
  2. Register CollaborationExtension at runtime, with a Y.XmlFragment and a provider.
  3. Type in the editor.
  4. The fragment stays empty, and other clients see nothing.
Expected

Either nested blockNoteExtensions are installed when an extension is registered at runtime, or registering an extension whose nested extensions can't be installed throws instead of failing silently. A documented way to attach collaboration to an existing editor would also help.

主要語言
TypeScript
星號
10.3k
分支
777
平均合併
2 天 10 小時
30 天內合併 PR
39

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TypeCellOS/BlockNote 的其他 Issue

查看 TypeCellOS/BlockNote 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。