Repository navigation
perf(rich-text): stop re-rendering links and embeds on every keystroke - #2261
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio. |
Yves Rijckaert (YvesRijckaert)
force-pushed
the
perf/rich-text-rerenders
branch
from
October 11, 2026 07:57
47bbe22 to
50a37e6
Compare
Hyperlinks and embedded entry/resource elements subscribed to the full editor state, so every keystroke re-rendered all of them. Hyperlinks now select only whether the cursor is inside them; embeds use the editor ref. Also skip Plate's slow plugin resolution for unregistered keys in editor.getType. The list normalizer looks up `taskList` on every node. Adds regression tests for commits per keystroke, unregistered plugin lookups during normalization, and the getType shortcut. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Yves Rijckaert (YvesRijckaert)
force-pushed
the
perf/rich-text-rerenders
branch
from
October 12, 2026 07:16
edbcb51 to
26979c9
Compare
Yves Rijckaert (YvesRijckaert)
marked this pull request as ready for review
October 12, 2026 08:04
Yves Rijckaert (YvesRijckaert)
requested a review
from a team
as a code owner
October 12, 2026 08:04
Contributor
There was a problem hiding this comment.
https://vitest.dev/config/benchmark could be an alternative ;)
Chris Helgert (chrishelgert)
approved these changes
Oct 12, 2026
Chris Helgert (chrishelgert)
left a comment
Contributor
There was a problem hiding this comment.
Great job :)
Kudakwashe Mupeni (2wce)
approved these changes
Oct 12, 2026
MayaGillilan
approved these changes
Oct 12, 2026
This branch was successfully deployed
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.
What & why
Typing in large rich-text documents was slow because every link and embed re-rendered on every keystroke.
taskListplugin on every node, and Plate deep-merges a throwaway plugin for each lookup.getTypenow returns the key directly for unregistered plugins, which is what Plate returned anyway.Result
300-block document,
mastervs this branch:No behaviour change: cards still update on outside value and entry changes, and "Edit link" still targets the right link after outside updates.
Tests
src/__tests__/performance.test.tsxfails if typing exceeds 18 commits per keystroke or normalizing looks up an unregistered plugin. Undoing any single fix fails it.pluginAdapter.test.tschecks that thegetTypeshortcut returns the same as Plate's own lookup, so a Plate upgrade that changes that fails CI.🤖 Generated with Claude Code