fix(plugin-sdk-value): prevent transient duplicate remote pastes#3017
Merged
Conversation
🦋 Changeset detectedLatest commit: 43da00c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📦 Bundle Stats —
|
| Metric | Value | vs main (68b5d17) |
|---|---|---|
| Internal (raw) | 807.5 KB | - |
| Internal (gzip) | 155.1 KB | - |
| Bundled (raw) | 1.42 MB | - |
| Bundled (gzip) | 319.4 KB | - |
| Import time | 97ms | +2ms, +1.6% |
@portabletext/editor/behaviors
| Metric | Value | vs main (68b5d17) |
|---|---|---|
| Internal (raw) | 467 B | - |
| Internal (gzip) | 207 B | - |
| Bundled (raw) | 424 B | - |
| Bundled (gzip) | 171 B | - |
| Import time | 2ms | -0ms, -0.8% |
@portabletext/editor/plugins
| Metric | Value | vs main (68b5d17) |
|---|---|---|
| Internal (raw) | 2.7 KB | - |
| Internal (gzip) | 894 B | - |
| Bundled (raw) | 2.5 KB | - |
| Bundled (gzip) | 827 B | - |
| Import time | 7ms | +0ms, +0.6% |
@portabletext/editor/selectors
| Metric | Value | vs main (68b5d17) |
|---|---|---|
| Internal (raw) | 82.7 KB | - |
| Internal (gzip) | 15.4 KB | - |
| Bundled (raw) | 78.4 KB | - |
| Bundled (gzip) | 14.3 KB | - |
| Import time | 8ms | +0ms, +1.8% |
@portabletext/editor/traversal
| Metric | Value | vs main (68b5d17) |
|---|---|---|
| Internal (raw) | 28.1 KB | - |
| Internal (gzip) | 5.6 KB | - |
| Bundled (raw) | 28.1 KB | - |
| Bundled (gzip) | 5.5 KB | - |
| Import time | 6ms | -0ms, -1.1% |
@portabletext/editor/utils
| Metric | Value | vs main (68b5d17) |
|---|---|---|
| Internal (raw) | 30.6 KB | - |
| Internal (gzip) | 6.4 KB | - |
| Bundled (raw) | 28.2 KB | - |
| Bundled (gzip) | 6.1 KB | - |
| Import time | 6ms | +0ms, +1.2% |
🗺️ . · ./behaviors · ./plugins · ./selectors · ./traversal · ./utils · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @portabletext/markdown
Compared against main (68b5d174)
| Metric | Value | vs main (68b5d17) |
|---|---|---|
| Internal (raw) | 53.8 KB | - |
| Internal (gzip) | 9.8 KB | - |
| Bundled (raw) | 348.9 KB | - |
| Bundled (gzip) | 96.3 KB | - |
| Import time | 40ms | +0ms, +0.6% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
christianhg
approved these changes
Jul 23, 2026
christianhg
left a comment
Member
There was a problem hiding this comment.
Looks sensible! We can probably mitigate this in the editor engine by making it better at not producing scratch work. But that fix requires some more thought put into it and in the mean time this SDK mitigation makes sense to ship!
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.
Description
Remote clipboard pastes can arrive as a temporary span insert followed by a text diff, while the cleanup unset reaches peers later. Receivers briefly rendered the pasted text twice.
Filter keyed inserted items that are absent from the SDK's current value before applying remote patches. The text diff still applies immediately.
What to review
packages/plugin-sdk-value/src/plugin.sdk-value.tsx: filters transient staged inserts from incoming remote patches.packages/plugin-sdk-value/src/plugin.value-sync.browser.test.tsx: covers the staged insert plus text-diff sequence.Testing
pnpm test:unitpnpm test:browser:chromiumpnpm check:typespnpm check:lintpnpm buildNotes for release
Prevents remote editors from briefly displaying pasted plain text twice.