Repository navigation
fix: editor performance - #2702
Merged
Merged
Conversation
- patch y-tiptap to re-render from Yjs only on the first sync plugin view, not on every reconfigure - patch tiptap core to compute extension attributes once per nodeViews/markViews call
- destroy editors before child cleanups so unmount skips full-document redraws - load the IndexedDB copy before joining the collab room so the first sync is a diff
- move the IndexedDB-first load into usePageYdoc - fall back after 2 seconds, or at once when the database cannot be opened - never hand out another page's document
- move useDestroyEditorBeforeChildren into its own hook file - re-render once when the layout effect finds its editor destroyed, so useEditor creates a new one
- clear the page editor atom when its editor is destroyed - split the title into the page only after the insert succeeded - skip Copy as Markdown on a destroyed editor
- guard the link menu, paste menus, slash menu and resize handlers
- fail when node or mark views recompute extension attributes per view
- Mantine keeps closed Select dropdowns mounted, one hidden list of every language per code block - each mounted dropdown also forced its own synchronous React commit when node views were created
- UniqueID assigns each pasted block its id in a separate step that moves no position - autolink mapped every changed range through every one of those steps
- tiptap combined and mapped every changed range after each update to emit an event nothing listens to
- every Portal looked up the shared node with a document-wide querySelector - each closed tooltip and popover mounts one, which adds up on large pages
- walk the document once instead of resolving a position for every block - debounce the update while typing
- the decoration wrapped every text node of the selection on each blur and focus
- EditorContent redraws the whole document when it adds the React node views - the content now goes in after that instead of being rendered twice
- keep the highlight result of each code block and reuse it while the block is unchanged - look up code blocks per top-level block, so unchanged blocks are not walked again - skip the lookup when a transaction does not change the document
- every code block looked up its position on each selection change, though only mermaid uses the result - a block that becomes mermaid checks the selection once, so its source stays visible while the caret is in it
- the placeholder shows in the block that holds the caret, but every block of the page was checked on each update
- an editable page has no sort controls, yet every update searched the whole page for them
- the whole document was turned into JSON on every keystroke, then written to the cache three seconds later
…lding them - an edit that leaves every heading as it is only shifts the buttons, so the set is mapped - headings are looked up per top-level block, so unchanged blocks are not walked again
…removed - the spacing rule "> * + *" made the browser recalculate every element of the page on each block insert or removal - ":where(:not(:first-child))" matches the same blocks with the same specificity
kurerere
added a commit
to kurerere/docmost
that referenced
this pull request
Nov 16, 2026
…tream * perf(search): rebuild tsvectors only when the indexed text changes (docmost#2684) * refactor: keep page trees within their space (docmost#2681) * feat(ee): announcements (docmost#2683) * New Crowdin updates (docmost#2668) * fix(collab): skip database migrations on the collab server (docmost#2685) * feat(ee): disable export (docmost#2653) * fix: update packages (docmost#2688) * New Crowdin updates (docmost#2687) * test(editor): leave tab strip drop cursor cleanup to the plugin (docmost#2691) * chore(client): disable node web storage in vitest (docmost#2690) * perf(editor-ext): faster array diff for page history compare (docmost#2689) * feat(history): highlight formatting-only changes (docmost#2692) * fix: skip unchanged history versions (docmost#2693) * feat(ee): API key scopes (docmost#2694) * feat(history): configurable page history interval (docmost#2696) * fix(history): record versions for pages with no content (docmost#2697) - skip mention and internal link extraction when page content is null - fixes submit for approval and verify on never-edited pages * fix(history): let wide tables scroll in the history modal (docmost#2699) * fix: base cursor precision (docmost#2701) * refactor: list shares through the share service (docmost#2703) * feat(ee): base csv import (docmost#2700) * fix(ee): cap API key expiration at 3 years (docmost#2704) * refactor(mail): adjust account email links (docmost#2705) * feat: status filter for space, announcement and member lists (docmost#2706) * fix: reload member lists after a member's status changes (docmost#2707) * fix: editor performance (docmost#2702) * fix: editor followup (docmost#2708) * fix(editor): resync collaboration after restoring editor state * fix(editor): release destroyed collaboration views * perf(editor): skip attribute scans without custom views --------- Co-authored-by: Philip Okugbe <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
patch tiptap core to compute extension attributes once per nodeViews/markViews call
Previously, each custom node or mark view accessed this.attributes, which recalculates attributes across all extensions. The patch computes that list once and reuses it for each view. This reduces setup overhead in an editor with many extensions.
patch y-tiptap to re-render from Yjs only on the first sync plugin view, not on every reconfigure
Registering or unregistering a plugin, for example, when a bubble menu mounts or unmounts—recreates ProseMirror’s plugin views. Previously, that triggered y-tiptap’s
_forceRerender(), rebuilding the document from Yjs. The patch remembers the EditorView and skips that initial render when reconnecting to the same view. Collaboration listeners still reconnect normally.Other performance fixes.