refactor(clipboard-plugin): remove meta from editorjs clipboard payload - #179
refactor(clipboard-plugin): remove meta from editorjs clipboard payload#179ilyamore88 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>
Unit Tests
Mutation Tests
|
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.
| ); | ||
| }); | ||
|
|
||
| it('should not include meta in the editorjs clipboard payload', () => { |
There was a problem hiding this comment.
This duplicates test case should add custom editorjs data-type to native event: existing case will fail anyway if meta appears in object. Better drop it.
Also since we use agents+SDD can we clarify for agents to not duplicate test cases just to check different effects of same action with same pre-conditions?
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