Repository navigation
[WIKI-1268] chore: upgrade Tiptap and Hocuspocus to v3 - #10101
Conversation
Ports makeplane/plane-ee#9883 to the community editor and live server: Tiptap 3.31.3, @tiptap/y-tiptap 3.0.9 and Hocuspocus 3.4.4, with no change to stored Yjs documents or the editor schema. - Editor: bubble menu on @tiptap/react/menus, AI menu on floating-ui instead of tippy.js, StarterKit's new bundled link/underline/list keymap/trailing node turned off, setContent on the v3 options form, CharacterCount/Placeholder from @tiptap/extensions. - Document codecs: v3's @tiptap/html only works in a browser, so the helpers are built from one factory and a new @plane/editor/server entry uses the happy-dom codec; live imports from it. - Placeholders are computed from the current view state, as in v2. v3's incremental placeholder state reads the previous editor state and only rescans touched blocks, so a comment box lost its placeholder after typing and deleting, and empty lines kept it after the caret left. - Live: Redis extension on the v3 API (with Redlock on the configured DB), title fragment built with y-tiptap instead of @hocuspocus/transformer, and shutdown drains pending saves before Redis disconnects. - Pin prosemirror-state/transform and the Tiptap menu extensions so the graph keeps one copy of each; dedupe linkifyjs. - Clear the strict pre-commit lint warnings in touched files (named Tiptap imports, renamed shadowed variables). Tests: placeholder regression tests in the editor, drain/Redis readiness/ shutdown unit tests and a two-server Redis integration test (v2-written pages, cross-server sync, title migration, HTML conversion) in live.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
|
React Doctor found 1 new issue in 1 file · 1 warning · score 79 / 100 (Needs work) · 1 fixed · vs Reviewed by React Doctor for commit |
|
Caution Review failedThe pull request is closed. No actionable comments were generated in the recent review. ℹ️ Recent review info
Walkthrough
Merge Risk:
|
Converge the editor and live with upstream makeplane/plane v1.5.0 (b4b48c9, 8e07d40, 9cefae8). Backport of upstream makeplane/plane b4b48c9 (makeplane#10101), 8e07d40 (makeplane#10121) and 9cefae8 (makeplane#10267), with the happy-dom 21.0.4 pin of b98e1de (makeplane#10144): Tiptap 3.31.3, @tiptap/y-tiptap 3.0.9, Hocuspocus 3.4.4, Redlock and happy-dom; tippy.js, y-prosemirror and @hocuspocus/transformer are gone. The document codecs come from one factory, with a new @plane/editor/server entry on happy-dom that live imports. This closes GHSA-cp6q-959q-f8rh on @tiptap/core. Adapted: - The shared codecs keep normalizeDocumentJSON on both the browser and the server entry. - Paste parsing stays on parseInertHTML; prosemirror.css is now copied from the 3.31.3 core style (injectCSS stays off) and loses the tippy rule. - live's onAuthenticate is now upstream's: Hocuspocus 3 names the per-socket config connectionConfig, so the guest read-only flag lands there. The fork's secret-key middleware on the document controller, the PDF asset fetch guard and the Compose live service stay. - The delete plugin takes ySyncPluginKey from @tiptap/y-tiptap, so it still ignores remote collaborator changes; markdown paste reads tiptap-markdown's runtime parser through a local type, which the typed v3 storage leaves out; the callout keeps stringToEmoji. - The editor's security suites keep running without a DOM; upstream's hook and placeholder tests run in a separate happy-dom vitest project. - Title saves stay with the editing client connection's credential, so upstream's Redis integration test renames the title from a client rather than from a server-side direct connection. - The browser codecs' @tiptap/html DOMParser call is recorded as a reviewed Trusted Types sink in the web and space inventories.
Description
Upgrades the community editor and live server from Tiptap 2 / Hocuspocus 2 to Tiptap 3.31.3,
@tiptap/y-tiptap3.0.9 and Hocuspocus 3.4.4, ported from makeplane/plane-ee#9883. Stored Yjs documents and the editor schema are unchanged: no data migration, and pages written by v3 still open in a v2 client (checked), so rollback is safe.Editor (
packages/editor)@tiptap/react/menus(floating-ui). It re-shows after a drag selection, since v3 only re-evaluates on a selection/doc change.tippy.jsfor@floating-ui/dom.history→undoRedo.setContentcalls use the v3 options form.CharacterCount/Placeholdercome from@tiptap/extensions;y-prosemirror→@tiptap/y-tiptap.@plane/editor/serverentry. v3's@tiptap/htmlthrows outside a browser, so the HTML↔Yjs helpers are built from one factory (helpers/document-codecs.ts): the browser entries use@tiptap/html, the server entry uses@tiptap/html/server(happy-dom).Live (
apps/live)@plane/editor/server. The title fragment is built with@tiptap/y-tiptapinstead of the removed@hocuspocus/transformer.publishwith a Buffer;SELECTs DB 0);stop_grace_period.Dependencies
prosemirror-state/prosemirror-transformand the Tiptap bubble/floating menu packages are pinned so the graph keeps one copy of each (the menus otherwise resolve to 3.32.0 against core 3.31.3).linkifyjsis deduped. v3's StarterKit pulls in a second copy.tippy.js,y-prosemirror,@hocuspocus/transformer,@tiptap/extension-character-count,@tiptap/extension-placeholder.Touched files also get the strict pre-commit lint fixes: named Tiptap imports and renamed shadowed variables.
Found while testing, older than this PR, not fixed here
apps/api/plane/bgtasks/page_version_task.py:63readspage.description, which was renamed todescription_json, so page versions are never created.All four reproduce on a
previewbuild.Type of Change
Screenshots and Media (if applicable)
No intended visual change.
Test Scenarios
Automated
pnpm turbo run check:types check:lint check:format test --filter=live --filter=@plane/editor --filter=web --filter=spacepasses.packages/editor/src/extensions/__tests__/placeholder.test.ts).Server.destroyunit tests.TEST_REDIS_URL(skipped when unset, so CI won't run it). It covers:Manual (full local stack: API, web, Space, live)
@mention and:emojidropdowns;Not covered
References