feat(ui,sdk,server,mcp): retire EditorJS — de-name export IR to block-native, creators emit blockdoc#100
Merged
Merged
Conversation
Retire the legacy 'EditorJS' name from the internal export intermediate-representation with ZERO change to exporter output: - EditorJsOut -> ExportDoc, blocksToEditorJs -> projectBlocksForExport, blockSnapshotToEditorJs -> projectSnapshotForExport (exportBlocks.ts) - EditorJsBlock / RawBlock / AnyEditorJsBlock re-declarations -> ExportBlock (exportAssets, documentModel, toHtml, sdk/mtime) - Update all importers/consumers (export pipeline + BlockPageDocument + tests) to the new symbol names PERSISTED FIELD: the on-disk/wire key PageSnapshot.editorjs is UNCHANGED and now documented as a retained storage/back-compat alias; only in-memory types/functions/vars were renamed, so old stored snapshots still read. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…, CSS) - packages/app/vite.config.ts: drop the stale @editorjs/* optimizeDeps prebundle block (those packages are no longer dependencies) and the EditorJS example from the build-target comment. - packages/ui/src/lib/editorChrome.ts: delete the file — its exports poked live EditorJS .ce-popover DOM and had zero importers. - packages/ui/src/index.css: remove the dead .ce-*/.cdx-*/.codex-editor/.tc-* rules (verified emitted by no live source). Kept mixed rules' live selectors (.max-w-content, [data-placeholder], .ob-page-fonts headings) and all live .ob-mention/.reactive-block/.block-* rules. No runtime behavior change; dead-code deletion only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- packages/app/vite.config.ts: drop the stale @editorjs/* optimizeDeps prebundle block (no longer dependencies) + the EditorJS example in the build-target comment. - packages/ui/src/index.css: remove dead .ce-*/.cdx-*/.codex-editor/.tc-* rules (verified emitted by no live source). Kept mixed rules' live selectors (.max-w-content, [data-placeholder], .ob-page-fonts headings) and all live .ob-mention/.reactive-block/.block-* rules. No runtime behavior change; dead-code deletion only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Text-only cleanup (no logic change): - ARCHITECTURE.md: remove the retired EditorJS-document intro + the reactive/ and liveSync.ts subsections (those files no longer exist); reframe the block editor as the sole editor; drop the stale editorJsReactAdapter.ts reference; retitle the file-drop WKWebView note. - TODOS.md: swap stale 'EditorJS block list' / editorjs-* plugin mentions. - pageLinks.ts / emojiPicker.ts / i18n/index.ts / viewer/types.ts: clean stale EditorJS mentions in the live files' comments. Left untouched (out of scope): the PageSnapshot.editorjs field and its SDK/MCP export/import/migration machinery. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-on-read
Creators emit blockdoc from birth so NO new legacy (no-blockdoc) pages are
made; the renamed migrator stays as the on-open path for pre-existing pages.
- sdk/content.ts: textSnapshot / paragraphBlocks / appendTextToSnapshot now
produce block-native blockdoc ({editor:'blocks', blockdoc:{blocks}}), JSON-
projection form (no CRDT update) that decodeSnapshot rebuilds without the
migrator; appendTextToSnapshot handles block pages (merge into blockdoc,
drop stale update) and keeps pre-existing LEGACY pages in their stored
editorjs shape (no dialect mixing, no data loss); returns non-null now
- callers: agent.ts create page/db-host, mcp create_page, plugin pages.create
route through textSnapshot; mcp append_to_page drops the dead block-page guard
- model.ts: migrateEditorJs -> migrateLegacyBlocks, EditorJsBlock -> LegacyBlock
(kept as migrate-on-open for legacy stored snapshots); re-exports + call site
(BlockPageDocument) + blockModel.test.ts updated
- tests: new sdk content.test.ts (creator shape + legacy-append), ui round-trip
proving created blockdoc decodes without migrateLegacyBlocks, mcp e2e now
asserts append_to_page works on a block page (read-back)
S2 back-compat intact: persisted editorjs stays readable; migrator still READS
legacy editorjs, creators WRITE blockdoc. Sanitizer (bookfile.ts) untouched.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pre-endorsed follow-up to S1 (comment/doc-only, no logic change): - index.css .block-callout placeholder comment: drop the EditorJS/.ce-paragraph reference, keep the 'why' (custom contenteditable needs an explicit placeholder). - index.css .block-button__cta doubled-class comment: the EditorJS .ce-block a rationale is moot; reword to the truthful intent (specificity bump so a CTA never inherits link-underline). Doubled class kept (de-doubling is behavior). - TODOS.md T6: fix the dangling 'The plugin' antecedent left after the Pros reword; also drop the dead liveSync reference in the same sentence. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Jul 5, 2026
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.
Problem
The classic EditorJS editor was removed as an editing surface in June, but its name and shape lingered: a dead Vite prebundle + an orphaned helper + ~204 lines of dead CSS; an export intermediate-representation still named "EditorJS" (
blocksToEditorJs/EditorJsOut/the.editorjsfield); and the AI agent, MCP server, and plugin API still minting pages in the legacy{type,data}shape that depended on a migrator at first open. This is the "remove EditorJS altogether" cleanup. Board: Epic "Retire EditorJS" (OB-EJS S1/S2/S3); absorbs OB-364.Solution
Three stacked, independently-reviewed phases:
@editorjs/*Vite prebundle, the orphanededitorChrome.ts(0 importers), ~204 lines of dead.ce-*/.cdx-*/.codex-editor/.tc-*CSS (each class grep-verified dead), and stale docs/comments. No behavior change.EditorJsOut→ExportDoc,blocksToEditorJs→projectBlocksForExport,blockSnapshotToEditorJs→projectSnapshotForExport,EditorJsBlock/RawBlock/AnyEditorJsBlock→ExportBlock. The persistededitorjsJSON key is deliberately UNCHANGED (documented back-compat alias) so no stored data is stranded. Exporter output is byte-identical.blockdocdirectly (text stored as escaped runs — strictly safer than the old HTML-interpreteddata.text);migrateEditorJs→migrateLegacyBlocks, kept as the on-open upgrade path for pre-existing legacy pages (a local-first store can't be centrally migrated).Key files:
blockeditor/exportBlocks.ts,export/documentModel.ts,export/toHtml.ts,sdk/content.ts,blockeditor/model.ts,server/ai/agent.ts,mcp/server.ts,ui/plugins/api.ts. New deps: none (the EditorJS runtime was already gone).Before / After
@editorjsVite config / CSS / helperExportDoc/project…/ExportBlock){type,data}, migrated on openblockdocfrom birthmigrateEditorJs)migrateLegacyBlocks, renamed, kept)append_to_pageon block pageseditorjssnapshot keyTest procedure
pnpm verifygreen on this integration branch (build:libs, typecheck 6/6, lint 6/6, unit sdk 158 / ui 848 / server 586, server e2e + MCP 40/40).export/__tests__/exportReactive.test.ts+blockExport.test.ts(byte-identical output).sdk/content.test.ts+blockModel.test.ts(decode without the migrator);mcp/scripts/e2e.mts(append + read-back).migrateLegacyBlocks(BlockPageDocument load path).Operational notes
editorjskey is retained as a read alias; legacy pages upgrade lazily on open. Breaking changes are limited to internal API/type names + the publicparagraphBlocksreturn shape (no in-repo consumers).append_to_pagenow writes to block pages (previously refused all, since blockeditor is the only editor) — same authz/write surface asappend_blocks(security-reviewed).Footer: verify green (counts above); gates cleared — code (S1/S2/S3) + security (S3).