Skip to content

[stable35] perf(editor): derive heading ids from the doc instead of plugin state - #9625

Merged
mejo- merged 1 commit into
stable35from
backport/9555/stable35
Nov 16, 2026
Merged

mejo- merged 1 commit into
stable35from
backport/9555/stable35

Conversation

@backportbot

@backportbot backportbot Bot commented Nov 16, 2026

Copy link
Copy Markdown

Backport of PR #9555

Heading ids are now computed by getHeadings(doc), which caches the
result per doc node. The headingAnchor plugin only keeps its
DecorationSet, mapping it through transactions while heading ids stay
the same and rebuilding it otherwise.

Anchor widgets are keyed by heading id, so ProseMirror reuses their DOM
without looking up existing anchors. That lookup ran once per heading
on every rebuild, making edits that change a heading id quadratic in
the number of headings (~280 ms vs ~5.6 ms per keystroke with 500
headings in jsdom).

Signed-off-by: Jonas <jonas@freesources.org>
Assisted-by: ClaudeCode:claude-opus-5-5
@backportbot backportbot Bot added 3. to review performance 🚀 AI assisted This PR contains AI-assisted commits labels Nov 16, 2026
@backportbot backportbot Bot added this to the Nextcloud 35.0.4 milestone Nov 16, 2026
@mejo-
mejo- enabled auto-merge November 16, 2026 09:26
@mejo-
mejo- merged commit 3d89d03 into stable35 Nov 16, 2026
77 of 81 checks passed
@mejo-
mejo- deleted the backport/9555/stable35 branch November 16, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review AI assisted This PR contains AI-assisted commits performance 🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant