refactor(clipboard-plugin): remove meta from editorjs clipboard payload#179
Open
ilyamore88 wants to merge 2 commits into
Open
refactor(clipboard-plugin): remove meta from editorjs clipboard payload#179ilyamore88 wants to merge 2 commits into
ilyamore88 wants to merge 2 commits into
Conversation
The `application/x-editor-js` clipboard payload carried a `meta.version`
field hardcoded to '3.0.0' with a `@todo get version info from Core`.
Nothing read it — no paste handler exists yet, and a repo-wide grep finds
the MIME type only in this plugin and its spec.
Shipping a placeholder version in a public clipboard format is worse than
shipping nothing: a future paste handler that trusted the field would
branch on a value that never reflected reality. Removing it now, before a
consumer exists, costs no migration.
The payload becomes `{ blocks }`. The object wrapper is kept rather than
serializing the bare array so that reintroducing a sibling key later stays
additive for readers.
BREAKING CHANGE: the `application/x-editor-js` clipboard payload no longer
includes `meta`. No exported TypeScript API changes — `ClipboardEditorJSObject`
and `Meta` were module-private; the break is on the wire format only.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Main specs already carried the delta, so archiving moved the change artifacts without altering spec content. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
gohabereg
approved these changes
Jul 21, 2026
Unit Tests
Mutation Tests
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR simplifies the ClipboardPlugin’s custom clipboard wire format by removing the placeholder meta.version from the application/x-editor-js payload, keeping the payload as an object wrapper containing only { blocks } and aligning tests/specs accordingly.
Changes:
- Remove
meta/versionfrom theapplication/x-editor-jsclipboard payload (now{ blocks }only). - Update clipboard plugin tests to match and add a scenario asserting
blocksis the only key. - Update the OpenSpec clipboard-plugin spec and archive the corresponding OpenSpec change artifacts.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/plugins/clipboard-plugin/src/index.ts | Removes meta from the clipboard payload and simplifies the payload factory to return { blocks }. |
| packages/plugins/clipboard-plugin/src/index.spec.ts | Updates payload expectations and adds a test asserting no meta key is present. |
| openspec/specs/clipboard-plugin/spec.md | Updates the documented payload shape and adds a scenario explicitly requiring blocks to be the only key. |
| openspec/changes/archive/2026-07-21-remove-clipboard-payload-meta/tasks.md | Archives the implementation/testing task plan for the change. |
| openspec/changes/archive/2026-07-21-remove-clipboard-payload-meta/specs/clipboard-plugin/spec.md | Archives the delta spec reflecting the updated payload requirements. |
| openspec/changes/archive/2026-07-21-remove-clipboard-payload-meta/proposal.md | Archives the change proposal describing the wire-format breaking change. |
| openspec/changes/archive/2026-07-21-remove-clipboard-payload-meta/design.md | Archives the design rationale and tradeoffs for removing meta. |
| openspec/changes/archive/2026-07-21-remove-clipboard-payload-meta/.openspec.yaml | Adds archive metadata for the OpenSpec change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Why
The
application/x-editor-jsclipboard payload carried ameta.versionfield hardcoded to'3.0.0', alongside a@todo get version info from Core. Nothing reads it — no paste handler exists yet, and a repo-wide grep finds the MIME type only in this plugin and its spec.Shipping a placeholder version in a public clipboard format is worse than shipping nothing: a future paste handler that trusted the field would branch on a value that never reflected reality. Removing it now, before a consumer exists, costs no migration.
What changed
application/x-editor-jspayload is now{ blocks }—metaand itsversionare gone.Metainterface and themetamember ofClipboardEditorJSObject.#createClipboardObjectreturns{ blocks }; the@todoabout sourcing a version from Core is dropped.openspec/specs/clipboard-plugin/spec.md) updated, plus a new scenario pinning thatblocksis the payload's only key.The object wrapper is kept rather than serializing the bare array, so reintroducing a sibling key later stays additive for readers.
Breaking change
The
application/x-editor-jsclipboard payload no longer includesmeta.No exported TypeScript API changes —
ClipboardEditorJSObjectandMetawere module-private, so no.d.tssurface moves. The break is on the wire format only, and the value it carried was a placeholder, not a real version.Verification
lint:ciclean at--max-warnings 0tsc --buildcleanNotes
Planned via OpenSpec; artifacts archived under
openspec/changes/archive/2026-07-21-remove-clipboard-payload-meta/.One thing worth a look:
openspec archiverewroteopenspec/specs/clipboard-plugin/spec.mdand, as collateral, stripped blank lines around## Requirementsand dropped the trailingImplemented in `src/index.ts`...footer. That footer is a convention in every spec file underopenspec/specs/, so I restored it — the spec diff here reflects only the intended payload change. May be worth filing against the archive tool separately.🤖 Generated with Claude Code