Upgrading
Before and after for each breaking change, and which registry item it lives in.
Copied source does not get a compatibility shim when you re-pull an item. This page is the migration for every breaking change in the changelog. Each section is the one that changelog entry links to.
The formatting toolbar gained items, filter, and named parts. <Editor.FormattingToolbar> with children still replaces the row, so that change is not breaking. It is at the end of this page.
The footnotes add-on is removed
Items: footnotes.
The footnotes item, footnotes(), FootnoteOptions, the Footnote slash item, Mod-Alt-N, and Word export of footnotes are gone. If you installed the item:
- Delete
src/components/editor/footnotes/. - Remove
footnotes()(orcreateFootnoteExtensions()) from your add-ons or extensions.
// before
createBlockcnEditor({ addons: [table(), footnotes()] });
// after
createBlockcnEditor({ addons: [table()] });Saved documents that contain footnoteReference or footnote nodes still load. The nodes stay in getJSON(), so saving does not drop them, but their text is not shown. To keep the notes visible, convert them before loading, for example into a numbered list at the end of the document.
The comments add-on's exportAs: "footnotes" and commentFootnotes are unrelated and unchanged.
Add-on serializers are per editor
Items: columns, media-blocks, math, toc, excalidraw-block, and any add-on you wrote against editor-core.
defineAddon no longer takes serializer() and no longer registers HTML on import. registerSerializer still writes a shared fallback and warns once in dev. It will be removed.
// before
defineAddon({
id: "note",
extensions: [Note],
serializer() {
registerSerializer("note", { html: (node) => `<aside>${node.text ?? ""}</aside>` });
},
});
// after
const note = defineAddon({
id: "note",
extensions: [Note],
serializers: {
note: { html: (node) => `<aside>${node.text ?? ""}</aside>` },
},
});
createBlockcnEditor({ addons: [note] });
renderDocument(json, { addons: [note] });A drawing add-on passes collectDrawings the same way, instead of registerDrawingCollector.
mentions() requires fetchMentions
Item: mentions.
The sample directory is not built in. Calling mentions() with no argument is a type error. In JavaScript it still runs, warns once in dev (mentions() requires fetchMentions.), and suggests nobody. mentionExtensions is that empty list.
// before
mentions()
// or
extensions.push(...mentionExtensions)
// after
mentions({
fetchMentions: async (query) => {
const people = await searchPeople(query);
return people.map((person) => ({ id: person.id, label: person.name }));
},
})editor-shell no longer installs export, media, or the whiteboard
Items: editor-shell, export-menu, media-blocks, excalidraw-block.
Editor.Export is gone. Install the add-on and render it yourself.
// before
<Editor.Chrome>
<Editor.Export />
</Editor.Chrome>
// after — export-menu, and media-blocks / excalidraw-block if you want those blocks
<Editor.Chrome>
<ExportMenu />
</Editor.Chrome>Spread mediaExtensions and excalidrawExtensions into the editor extensions, and pass their slash categories to createEditorExtensions.
Text alignment is logical by default
Items: editor-core, editor-shell.
TextAlign used to default to left, so every block rendered style="text-align: left". It now has no default. Unaligned blocks follow the reading direction. start and end are alignments. The toolbar buttons are Align start, center, and end. Stored left and right values are unchanged.
// before — getHTML() contained this on every paragraph
// <p style="text-align: left">
// after — no style until the block is aligned
// <p>Example server: POST /api/upload requires a token
Items: the example server, and media-blocks (createUploadFile).
Uploads used to accept any request. A multipart POST is a simple CORS request, so another site could upload through a visitor's browser. Every upload now needs Authorization: Bearer <token> (permission: "upload", or a room token with permission: "write"), signed with COLLAB_SECRET. Missing or invalid tokens get 401. read tokens get 403.
// before
createUploadFile({ endpoint: "/api/upload" })
// after
createUploadFile({
endpoint: "/api/upload",
getHeaders: async () => ({ Authorization: `Bearer ${await getUploadToken()}` }),
})Mint tokens the same way as collaboration tokens: signCollabToken({ permission: "upload", sub }, secret). For local testing, pnpm collab:token --upload. UPLOADS_ALLOW_ANONYMOUS=true accepts token-less uploads from an origin in CORS_ORIGINS (or localhost). UPLOAD_DIR is capped by UPLOADS_MAX_TOTAL_MB (default 1024); past the cap the server returns 507.
Example server: room files are named room-<hex>.bin
Item: the example server (file storage only).
FileStorage stored <encodeURIComponent(room)>.bin. On a case-insensitive disk, Team and team shared one file. Files are now room-<hex>.bin, or room-h-<sha256>.bin when the name would exceed 255 bytes. An old file is still read when no new file exists and the case matches exactly. The next save writes the new name. SQLite storage is unchanged. Delete the old files after every room has been saved again.
Exports and the live editor drop unsafe URLs
Items: editor-core, export-menu.
HTML export, Markdown export, and the editor keep http:, https:, mailto:, tel:, relative URLs, #anchors, and data:image/(png|jpeg|gif|webp). javascript:, vbscript:, and other data: URLs are removed, including mixed-case, padded, and entity-encoded ones. An unsafe link becomes plain text. An unsafe media src becomes empty. Collaborative documents also drop blob: srcs. The helper is safeUrl from lib/mediaUrl.ts.
Shared documents: no object-URL uploads, server-side seeding, placeholder ownership
Items: media-blocks, collaboration.
Without uploadFile, a collaborative editor used to write tab-local blob: URLs into the shared document. Uploads are now refused unless you pass uploadFile (or createMediaExtensions({ collaborative: true }) finds one). Seed new rooms on the server with createCollaboration({ seed }). The example server turns that on with COLLAB_SEED=demo. useSeedCollaborativeContent still exists for a setup with no server hook. Placeholders carry uploaderClientId and uploadStartedAt (uploadAttributes from mediaUpload.ts).
// before
createMediaExtensions()
useSeedCollaborativeContent(editor, content)
// after
createMediaExtensions({ uploadFile: createUploadFile({ endpoint, getHeaders }) })
// seed in onLoadDocument on the server, not in the clientToggles open and close locally; columns are 2-4 and edit as single steps
Items: editor-core (toggle), columns.
Clicking a toggle chevron no longer writes the open attribute, so it is not undone, not synced, and it works while the editor is locked. open is only the default for a new toggle and for export. setToggleOpen still edits the attribute.
The columns schema is column{2,4} (it was column+); it is now column{2,5}, and a sixth column folds into the fifth. A loaded 1-column layout unwraps. Columns past the fourth fold into the fourth. Widths rescale to 100. A collaborative document drops a schema-invalid columns block instead of repairing it, because y-tiptap removes invalid elements. Add and remove column are each one undo step. Resizing writes once on release.
Upload failures stay visible; files are checked before upload
Item: media-blocks.
A failed paste or drop used to delete the placeholder. The block stays, with the error, Retry, and Remove. createMediaExtensions takes accept, maxSize, and onUploadError. createUploadFile defaults those to the example server's list and 10 MB. Pass null to turn a check off, or pass the limits your server actually enforces. Deleting a placeholder aborts its upload.
Ask AI: cut-off responses are no longer shown as finished
Items: ai-menu, and the example server if you use it.
useAskAI status "truncated" means text arrived and the stream then stopped. truncation is "max_tokens", "refusal", or "error". The panel says "Response was cut off — accept anyway?". A switch on status has to handle "truncated".
A custom backend can send X-Blockcn-Stream: v1 and end a plain-text failure with \n\u0000BLOCKCN_ERROR:{"error","reason"}. SSE uses event: error and no [DONE]. TRUST_PROXY accepts true, false, a hop count, or a list of IPs. An invalid value stops startup.
Editing behaviour changes
Item: editor-core.
- Plain text becomes Markdown only with two signals, or a fence or table on its own. A lone heading, list item, or link stays text. Mod-Shift-V pastes plain text. Formatted HTML is pasted as HTML.
- The outline and the table of contents include headings inside columns, toggles, callouts, and quotes.
- Turn into only offers conversions that keep the content.
- Mod-K with no selection links the word under the caret. On whitespace the key is not swallowed.
- Move up, move down, and duplicate work when an atom (image, math, table of contents) is selected.
- Enter in an empty
@,:, or slash popup goes to the editor and closes the popup. - Slash search ignores case and accents.
- Markdown export indents nested lists to the marker's content column and lengthens fences that would break. HTML export keeps several paragraphs in one list item as separate
<p>elements.
Collaboration tokens are enforced on open connections
Items: collaboration, and the example server.
The server used to check exp only when a connection opened. It now closes that document once the token expires (close code 4401, TOKEN_EXPIRED_CLOSE_CODE). About a minute before expiry it asks for a fresh token, which calls token again. Pass token as a function if a session outlives one token.
// before
useCollaboration({ url, room, token: mintedToken })
// after
useCollaboration({ url, room, token: () => mintToken(room) })CollabContext.user includes expiresAt. The demo strips ?token= from the address bar.
useEditor starts empty, and it is created once
Item: editor-shell.
useEditor() used to load DEFAULT_EDITOR_CONTENT and recreate the editor when the extensions array changed. It now starts empty, and it is created once. content is read only at creation. Pass a dependency array to recreate it.
// before — the demo document, and a new editor whenever `extensions` changed
const editor = useEditor({ extensions });
// after
const editor = useEditor({ extensions }); // empty
const editor = useEditor({ extensions, content: DEFAULT_EDITOR_CONTENT });
const editor = useEditor({ extensions, content }, [docId]); // recreate when docId changesIn development, changing extensions without deps warns once and keeps the first editor.
Editor root class is blockcn-editor
Items: editor-shell, editor-ui (editor.css).
The editor element class was notion-editor. It is blockcn-editor (EDITOR_CLASS_NAME). If your CSS selected .notion-editor, use .blockcn-editor. The drop cursor class notion-dropcursor and the table class notion-table are unchanged.
BlockType is any string
Item: editor-core.
BlockType was a closed union of the core block ids. It is now string, so an add-on can use its own id. Use CoreBlockType where you still want the core set. Turn into is a TurnIntoItem registry: editor.commands.registerTurnInto, or the turnInto prop on Editor.SideMenu.
Named colours are CSS variables
Items: editor-core, editor-ui.
A named swatch used to store a hex colour. It now stores a token, var(--blockcn-text-red) or var(--blockcn-highlight-yellow) (gray, brown, orange, yellow, green, blue, purple, pink). Light and dark values live in editor.css. The custom colour input still stores hex. HTML export replaces a token with its light-theme hex. A document that already stored the old hex keeps that fixed colour. Re-apply the swatch to store the token.
Formatting toolbar parts
Item: editor-shell.
children still replaces the row. items sets the order, filter drops ids, and FormattingToolbar.Bold, Italic, Underline, Strike, Code, Link, Color, Highlight, Align, TurnInto, AskAI, Separator, and Button are the parts. Turn into stays off the default row until items includes "turnInto".
// still works
<Editor.FormattingToolbar>{myRow}</Editor.FormattingToolbar>
// subset, without replacing the row
<Editor.FormattingToolbar items={["bold", "italic", "link"]} />