v5.0.0
Breaking Changes
- Replace
react-dndandreact-dnd-html5-backendwith@dnd-kit/core(^6.3.1) as a peer dependency, removing the global HTML5 backend singleton conflict (#319) so each<Tree>owns its<DndContext>. Node renderers usingref={dragHandle}keep working unchanged while customrenderRowcomponents receive drag listeners onattrs(and must spread{...attrs}while composing pointer/mouse/touch handlers);<DragOverlay>now renders drag previews soDragPreviewPropsdropsoffsetandmouseand the preview mounts only during an active drag withisDraggingalwaystrue(so previews that animated out onisDragging === falsewill not get that render);XYCoordis defined locally; pointer-onlysensors(noKeyboardSensor) andaccessibilityprops are added;dndBackend,dndManager,dndRootElement, anddragTypeare removed rather than deprecated; and capabilities tied toreact-dndor native HTML5 drag and drop (externalreact-dndtargets, OS/cross-app drops, iframedndRootElement, and shared multi-tree<DndContext>tracked in #396) are dropped (see "Migrating from v4" in the README). (#391)
v16.5.0-canary.73
- turbopack: document chunking defaults as minified sizes: #102540
- Add statically analyzed Go route and proxy configuration: #101551
- test: mock the canary lookup in the agent upgrade reuse test: #102553
Huge thanks to @sokra, @lukesandberg, and @timneutkens for helping!
v54.0.0-beta.9 (2026-11-29)
-
- Narrow
plate generateto emit exactValue,Document, named-root value types, and staticschemahandles without unreachableEditor/Mutationstypes or hardcodedplatejs/reactimports. - Fix JSON property type printing across
Readonly/ utility aliases,node_modulesdeclarations,set-of-jsonproperties (authored), and applicationschema.propertieshandles while rejecting host/callable/deep types. - Derive narrowed per-element text interfaces from
textAllowedByParentType(forcontentMarks: falseblocks), emitprefix+remainderchild tuples with fixed slot properties, and evaluate conditional targets with same-key union merging. - Resolve ESM package entries via
mainFields: ['module', 'main']without app-specific stubs, harden artifact locking and atomic backup swap/rollback, and trimplate migrate newto three files (from.ts,to.ts,migration.ts).
- Narrow
-
- Import
isNominalPluginDescriptorfromplatejs/compilerwhen bundling editor entries inplate generate
- Import
-
- Add
--export <name>toplate migrate run(defaultEditorMigrations) while keeping static single-export bundling. - Allow mixed raw and persisted envelope files in one
plate migrate run --from <version>run, matchingmigrateDocumentraw-fallback behavior. - Include
legacyandmapRangesguidance in theplate migrate newmigration template.
- Add
-
f41097bby @zbeyens – Updateplate codemod plite-to-platediagnostics for removedplitejs/historyinternal type re-exports (CarriedRun,HistoryBatchJSON,HistoryControlTx,SerializedEditorSelection) -
bf9b87cby @zbeyens – Updateplate codemod plite-to-platediagnostics for renamedplitejs/reactusePathand removeduseElementPath,useOptionalElement,useContentRoot, and renderer capability exports -
29bcbd6by @zbeyens – Update theplite-to-platecodemod to handledefinePluginCompartmentalongside legacydefinePluginSlot. -
3c2d532by @zbeyens – Drop removed Yjs codemod mappings and keepplitejs/syncsyncandSyncPluginimports onplitejs/syncwith a manual diagnostic inplate codemod plite-to-plate -
4d4154cby @zbeyens – Update theplite-to-platecodemod classification for the native-DOM pagination surface (PaginationSurface,PaginationSurfaceProps,useTableRowPageBreak) and remove retiredPagedEditorContentand Pretext pagination symbols.
Published @platejs/test@54.0.0-beta.9.
6d42192by @zbeyens – AddBaseLockPlugin.read.containsLockedcovering self, ancestors, descendants, and owned content roots, cache per-table span indices for O(1) row-drag hover vetoes, and migrateUploadPlugintoeditor.api.dom.drag.resolveTarget.
-
4d4154cby @zbeyens – Replace<PagedEditorContent />, Pretext pagination exports (measurePages,createPretextPageLayoutEngine,createEstimatedPageLayoutEngine,usePageLayoutFragments), and the@chenglou/pretextpeer dependency withPaginationPlugin,PaginationContent,usePageLayout(editableRef?), anduseTableRowPageBreak(element)for zero-remount Pageless and Paged editing on standard<EditorContent />. -
ef4c7e5by @zbeyens – CollapseRenderTextPropsback to a single host type by removingRenderTextHostProps,RenderTextPieceProps, andpiecefromplatejs/react, and drop obsoletedata-editor-insetanddata-editor-text-pieceprojection markers. -
5c8641dby @zbeyens – Set a fallbackaria-label="Autocomplete"on the editor root while an autocomplete occurrence is active and the editor has noaria-labeloraria-labelledby, restoring the root when the popup closes -
d85b122by @zbeyens – Move combobox trigger policy (trigger,triggerPreviousCharPattern,triggerQuery,maxQueryLength,queryPattern,label) andsyncPopupontouseComboboxinplatejs/combobox/react, exportComboboxCompletionandComboboxPopupState, and remove the headlessplatejs/comboboxentrypoint (ComboboxState,ComboboxEditor,filterWords,FilterWordsOptions,FootnotePluginState). -
- Add optional
continuationcallback (({ ...context, block, properties })) onHtmlElementPropertyCreateRule(createsElement: true) to merge schema-admitted properties onto non-nested trailing blocks inside multi-block HTML items - Preserve GitHub code wrappers, custom element and mark wrappers, standalone
<br>blank lines, embedded images inside<p>and<span>, andwhite-space: prespacing when parsing or pasting multi-block HTML lists, and keep display equations as block elements in continuation blocks of list items - Report
html-unsupported-content(action: 'replaced'or'unwrapped',kind: 'element',impact: 'lossy') when acreatesElementHTML mapping replaces or unwraps an unsupported leading block, matching Markdown list loss reporting; parse board clipboard HTML withlossPolicy: 'allow' - Reuse compiled plain-text mappings across repeated
serializePlainText(editor)calls and alignprojectionJSDoc with runtime behavior - Narrow
DocxExportResultto warnings-only on success and an error-first tuple on failure, exportDocxErrorDiagnosticandDocxWarningDiagnosticfromplatejs/docx/export, addimpacttolossy-contentandresource-omittedDOCX diagnostics, and classify unwrapped script-capable links and alt- or caption-preserving script-URL images asimpact: 'lossless'on DOCX export
Migration:
- Strict
editor.api.html.parse(...)andimportDocx(...)callers (lossPolicy: 'reject', the default) that parse HTML or Word lists containing unsupported leading headings, code blocks, blockquotes, or un-listable blocks now receiveok: falsewithhtml-unsupported-content; pass{ lossPolicy: 'allow' }when lossy fallback is desired. DocxExportResultnow narrowsok: truetoreadonly DocxWarningDiagnostic[]andok: falsetoreadonly [DocxErrorDiagnostic, ...DocxDiagnostic[]], andlossy-contentandresource-omittedDOCX diagnostics now requireimpact.
- Add optional
-
- Remove
skipInitialization,shouldNormalizeEditor,useCreateEditor({ enabled }), and unusedPLUGINS.navigationFeedback. OmitinitialValuefor default ormin: 0empty-root initialization, calleditor.update.value.repair()after creation when repair is needed, and conditionally mount the component that callsuseCreateEditor. - Unify
CreateEditorOptionsdefaults and maker overloads acrossplatejsandplatejs/react, fixing headlessinitialValuecallback typing andlifecycleErrorSinktyping. Conditional plugin tuples (such asflag ? [Plugin] : []or[flag ? A : B]) and statically disabled plugins (Plugin.configure({ enabled: false })) no longer expose absent plugin entries on typededitor.api,editor.read, oreditor.update.
- Remove
-
- Collapse
BaseLinkPluginupdates toupsertandunwrap, removinginsert,wrap,upsertText, andexitEnd, plusrangeBeforeOptions,defaultLinkAttributes.href, and unused link option/definition type aliases (LinkAttributes,BaseLinkPluginState,CreateLinkNodeOptions,UnwrapLinkOptions,WrapLinkOptions,UpsertLinkOptions,BaseLinkDefinition,LinkDefinition) - Preserve existing link nodes when expanded-selection link wraps are refused by schema rules, preserve
targetonlink.upsertunless explicitly passed, and preserve live selection whenatis passed - Strip leading wrappers and trailing sentence punctuation in typed autolinks, recognize
www.domains indefaultParseUrl, and fix balanced parentheses, UTF-16 emoji offsets, formatted labels, and inline-void safety inLinkRules.markdown - Fix multi-block URL paste when
keepSelectedTextOnPasteisfalseand align Markdown bare-URL detection across link and table serialization
Migration: Replace
editor.update.link.insert(...),editor.update.link.wrap(...), andeditor.update.link.upsertText(...)witheditor.update.link.upsert(...)(passatdirectly instead ofinsertNodesOptions.at, and passtarget: nullortarget: undefinedto unsettarget). RemoverangeBeforeOptionsfromLinkPlugin.configure({ initialState }), and use inferred types orLinkElementinstead of the removed type aliases. - Collapse
-
e7c50c9by @zbeyens – ExportlinkUrlValidationfor stored navigation URL schema properties and strip floor-refused optionalurlvalues during v53-to-v54 migrations. -
- Remove the legacy
scopestring option fromuseElementSelectorand throw when called outside a matchingElementProvider(pass a plugin descriptor as the first argument to scope to an ancestor element). - Add explicit
editor, field-key, and{ equalityFn }support touseViewStore, matchingusePluginStore, and stop explicit-editorusePluginStoreanduseViewStorecalls from subscribing to editor context changes. - Remove
zustandfromplatejsruntime dependencies.
- Remove the legacy
-
- Fix
usePlateModelRevisionto subscribe only to$configurationpublication commits instead of every editor commit, preventing unnecessary re-renders during typing, selection, focus, and blur. - Fix
useRootEditorto resolve underEditorControllerandEditorProviderwhile preserving editing-area lock isolation insideEditorContent. - Fix
EditorProvideruseEditorContainerRefanduseEditableRefto read live mounted refs, stabilizeEditorContainercontainer ref attachment across active view switches, and fixEditorContentViewnested lock detection andscrollSelectionIntoViewhandler freshness.
- Fix
-
518dcbaby @zbeyens – Unify list and block indentation underBaseIndentPlugin.update.increase/decreasewith flatIndentChangeOptions(at,match,mode) and boolean return values, and removeBaseListPlugin.update.outdentandOutdentListOptions. AddBaseListPlugin.update.setfor idempotent list kind, style (nullresets), and taskcheckedupdates, narrowtoggleto{ type, at? }, and returnbooleanfromclear. ConvertListTypeandListStyleto type-only unions, renameBaseListDefinitiontoListDefinition, exportListLevel/ListLevels, and removeisOrderedListandBULLETED_LIST_STYLES. AddMod+Entertask toggling and create unchecked tasks onEnterat the end of a checked task. -
86110b8by @zbeyens – ReplaceAIChatPlugin,useAIChat,AIChatRequestContext, andfindQuotedSpanwith a zero-AI-SDKplatejs/aicore (getEditorTools,createEditorAgent,registerEditorTools,createAIDraftSession,AIPlugin,useEditorAgent,useWebMCP) and removeai,@ai-sdk/react, andfastest-levenshteinpeer dependencies fromplatejs.- Add framework-agnostic document tools (
editor_read,editor_find,editor_suggest_edit,editor_list_suggestions,editor_withdraw_suggestion, opt-ineditor_list_commentsandeditor_comment, and opt-ineditor_debug_inspect) backed bywritePolicy: 'propose-only', required recursive visibility filtering, default-deny remote media guards, and revision checks. - Add
registerEditorToolsanduseWebMCPto expose multiplexed WebMCP tools per(modelContext, prefix)withallowgating, origin-grant matching, and abort teardown. - Add
createAIDraftSessionandAIPlugin(PLUGINS.ai) for detached streaming generation, provisional selection rewrites that land one minimal-diff suggestion on finish or stop,<Locked>placeholder rewrites viaeditor.api.markdown.parsePlaceholders, pinned table-cell rewrites, and cross-block comment range matching withoutfastest-levenshtein. - Require
filteronserializeAIEditContextandserializeAISelectionMarkdown, and passprojection: 'proposed'conditionally whenAuthoredPluginis installed. - Retarget
CopilotPluginsuppression toAIPluginstore state (status === 'streaming',status === 'reviewing', oropen).
Migration: Replace
AIChatPluginanduseAIChatwithAIPlugin,createEditorAgent, and your own AI SDKuseChattransport, removeai/@ai-sdk/react/fastest-levenshteinpeer expectations onplatejs, and passfiltertoserializeAIEditContextandserializeAISelectionMarkdown:import { AIPlugin, useEditorAgent, useWebMCP } from 'platejs/ai/react'; const plugins = [AIPlugin];
- Add framework-agnostic document tools (
-
- Remove
ElementStatePlugin,ElementStateApi,ElementStateDefinition,PLUGINS.elementState,AffinityPluginUpdate,AffinityEdgeNodes,editor.update.affinity.setSelection,DomPluginState['clipboardFormatKey'],DebugPluginState['isProduction'], stale v1DebugErrorTypetags,AnyObject,createHotkey, and six unused root helper/type exports (isPluginNodeClass,isPluginElementClass,WithRequiredName,PluginOwnUpdate,InferPluginReadGroups,InferPluginUpdateGroups) - Move
isNominalPluginDescriptorfromplatejsandplatejs/reacttoplatejs/compiler - Remove
process.env.NODE_ENVchecks fromDebugPlugin, defaultinglogLevelto'error'(droppingapi.debug.warn,info, andlogcalls in development unlesslogLevelis raised) andthrowErrorstotrueacross all runtimes - Refuse disabling required core plugins (
debug,html,override,inputRules) atcreateEditortime, and subtract statically disabled optional core plugins (HistoryPlugin,AffinityPlugin,TransferPlugin,DOMPlugin) from concrete editor types respecting last-wins plugin tuple order; erased(editor: Editor)helpers expectinghistorynow reject history-disabled concrete editors, whilerenderStaticHtmlaccepts anyEditorReference - Project default element updates method-by-method under application schema policies (
removeandsetstay available across policies,insertandupsertstay available underroot-only schemas, andtogglestays omitted) - Tighten widened
tx.plugin(string)to returnunknown, restorebooleanreturn types oneditor.update.nodes.unwrapandwrap, specialize React plugin portal APIs, and narrow.configure({ enabled: true }) - Reject unknown fields and array inputs with a
TypeErrorindefinePlugin,.extend(),.configure(), andtoReactPlugin(), and refresh derived toggle eligibility across live Plite schema swaps
- Remove
-
273b78eby @zbeyens – Replaceplatejs/suggestionandplatejs/suggestion/reactwithplatejs/authored(AuthoredPlugin,suggestionColorOf,AUTHORED_COLOR_COUNT) andplatejs/authored/react(AuthoredReactPlugin,useAuthoredGroups,useActiveAuthored), removePLUGINS.suggestionanduseSuggestionChanges, adduseCommentThreadIndextoplatejs/comments/react, removeusersandCommentUserfromBaseCommentsPlugin, replacesubscribePending,subscribeVisibleThreadIds, andsubscribeDraftThreadIdswithsubscribeSnapshot, and scope commentactiveIdsper presentation viaapi.activeIds(),api.setActive(), andapi.subscribeActive().Migration: Import
AuthoredPluginfromplatejs/authoredandAuthoredReactPlugin,useAuthoredGroups, anduseActiveAuthoredfromplatejs/authored/react. Move comment author profiles into a React context (such as copiedUserDirectoryProvider), replacesubscribePending/subscribeVisibleThreadIds/subscribeDraftThreadIdswithapi.subscribeSnapshot, and replacestore.get('activeIds')withapi.activeIds()andapi.subscribeActive()(callapi.setActive()on the mounted editor view rather than an unmounted model editor handle). -
8c3001bby @zbeyens – Exposedata-editor-authored-url-before,data-editor-authored-url-after, andtitleattributes on authored link URL edits. -
- Remove unused
BoardDefinitiontype export fromplatejs/board; usetypeof BaseBoardPluginorDefinitionOf<typeof BaseBoardPlugin>. - Make
BoardShaperesize handles ([data-board-handle]) render neutral geometry with no inline fill or border, and hide them when the board view or shape is read-only or locked. Migration: CustomBoardShapeconsumers should style[data-board-handle]in CSS (for example[&_[data-board-handle]]:border [&_[data-board-handle]]:border-ring [&_[data-board-handle]]:bg-background). - Respect
BaseLockPluginlocks across board views, handles, drag/resize/eraser/edit gestures, style targets, and frame moves holding locked shapes while keeping locked shapes selectable, copyable, and Alt-drag-copyable. - Fix
schema.overrideforboardFrameandboardArrow(including swapped element type names) and export customdefineBoardShapetext ontext/markdownclipboard copy without conflicting with explicit shape Markdown encoders.
- Remove unused
-
b95a34eby @zbeyens – Fix board keyboard shortcuts and clipboard inside open shadow roots, under Caps Lock and non-Latin keyboard layouts, onMod+Afrom a focused board with no shapes selected, and on extreme coordinates in copy placement andfit -
049c432by @zbeyens – Disallow formatting marks insidecodeBlockelements viacontentMarks: falsewhile keeping review metadata (authored) allowed, extendCodeBlockRules.markdownwithon: 'space'and language-capturing'space'/'break'fences plusnormalizeLanguage, align cross-block HTML/slice paste on the landing start block, checklowlight.registered(language)on highlight errors, strip disallowed formatting marks from single-text code blocks inmigratePlateV54CodeBlocks, and removeBaseCodeBlockPlugin'sread.entry,read.indentDepth,read.isEmpty, andupdate.resetBlock.Migration:
- Replace
editor.plugin(CodeBlockPlugin).read.entry()witheditor.read.nodes.above({ type: CodeBlockPlugin }). - Replace
read.isEmpty()with!NodeApi.string(block)on the containing code block. - Replace
update.resetBlock()withif (editor.read.nodes.block({ type: CodeBlockPlugin })) editor.plugin(CodeBlockPlugin).update.toggle(). - Apps that persisted unreleased
v54beta envelopes or Yjs rooms with the pre-cut code-block schema fingerprint must strip formatting marks fromcodeBlockleaves or migrate from the prior beta fingerprint before reopening.
- Replace
-
11b3a12by @felixfeng33 – Allow code block text edits, indentation, language changes, and structural conversions to record as proposals in Suggesting mode.BaseCodeBlockPluginnow usesschema.content.text({ default: 'text', min: 1 })withoutmax: 1and removes itsauthoredVeto, while plain code blocks still canonicalize to a single text leaf andBaseCodeHighlightPluginsplits syntax decorations across multi-leaf code blocks. -
- Remove the
ExternalTextDispatchResultre-export fromplatejs/reactand remove duplicate local rollback fromcreateCodeMirrorAdapter. - Preserve decorations across canonical CodeMirror resets and accept typing after unlocking a read-only code block whose composition ended without
compositionend. - Add
slots.externalTextsupport toEditorStatic(RenderElementSlotsandPlateStatic) so components usingslots.externalTextrender cleanly in static output. - Implement
ExternalTextView.scrollIntoViewoncreateCodeMirrorAdaptersoFindBarandapi.dom.scrollIntoViewreveal matches inside scrollable and tall CodeMirror blocks below sticky headers. - Fix
EditorView.lineWrappingvertical boundary navigation and pure-DOM wrapped visual-row column entry (with wrap-pointassoc) increateCodeMirrorAdapter. - Cache CSSOM decoration
styleserialization by object identity in aWeakMapand center wrapped or tall range targets inside.cm-scroller's visible box duringscrollIntoView.
- Remove the
-
c847832by @zbeyens – Renameplatejs/layoutandplatejs/layout/reacttoplatejs/columnandplatejs/column/react, replace string percentagecolumn.widthwith positive finite numeric flex weights (default1, omitted at default), addresizeColumns,unwrap,removeColumn,insertColumn, empty-column Backspace, symmetric HTML codecs, subtree/paste non-nesting, DOCX sibling percentage normalization, and v54 migration support -
- Remove
editor.anchor.save,editor.anchor.restore, andEditorDocumentRangere-exports fromplatejsandplatejs/react - Rebase
comments.creationhistory redo acrosshistory-skipedits and read stored comment anchor coordinates explicitly independent of Authored preview mode
- Remove
-
12abcd6by @zbeyens – Upgradeplatejs/commentsandplatejs/comments/reactto quote-verifiedCommentAnchorpersistence and incremental versioned remote sync:- Replace
CommentRanges,api.ranges(),api.subscribeRanges(),api.replace(), andSavedComments.rangeswithCommentAnchors(CommentAnchorwith block IDs, quote context, and document revision),api.anchors(),api.encodeAnchor(),api.subscribeAnchors(),api.applyRemote({ upserts, deletes })with monotonic versions, tombstones,mutationIdecho reconciliation, and unresolved anchor hydration. - Remove
createDraft,discardDraft,publishDraft,draftThreadIds, andCommentThread.status; addsignal?: AbortSignal,history?: 'record' | 'skip',withHistory, and{ type: 'element' }targets tocreateThread, add{ status: 'aborted' }toCommentMutationResult, passactorId,anchor, andsignalinCommentMutationRequest, and allowbegin()on read-only and preview views. - Add
incarnationandmembersto change targets,elementIdandquoteto attached range attachments, andresolveCommentChangeTargettoplatejs/comments/react. - Update
migrateDocumentinplatejs/migrationsto acceptanchorsor legacyranges, mint permanent element IDs, and returnanchors, and fix DOCX import comment range remapping across inline links and coalesced text.
Migration: Save
api.anchors()instead ofapi.ranges()and passinitialComments: { anchors, threads }. ReplacesubscribeRangeswithsubscribeAnchors,replace()withapplyRemote({ upserts, deletes }), andcreateDraft/publishDraft/discardDraftwith abortablecreateThread({ ..., signal }). Updatemutatehandlers to readrequest.anchorandrequest.actorId, and updatemigrateDocumentcallers to readresult.anchors. - Replace
-
- Move
readEditorSchemaContract,diffEditorSchemaContracts, and theEditorSchemaContract*types fromplatejsandplatejs/reactontoplatejs/compiler. - Remove
restoreEditorSchemaContract,compileEditorSchemaContract,GeneratedEditorTypeProvider, andEditorCompilation.bindings[].authoredToggle. - Extend
EditorPropertyTypes<TPlugins, TSchema = undefined>with an optionalTSchemaparameter that projects applicationschema.propertiestypes, and widenSchemaElementSupportsToggleto accept text-allowing content expressions andschemaContribution.
- Move
-
b94933cby @zbeyens – RewriteCopilotPluginfor streaming inline Markdown completions, parsed-node word acceptance, mark-aware type-ahead, filtered FIM context, and abort-on-accept.- Store parsed inline
suggestionNodesviatx.setField(history: 'skip'), streaming througheditor.api.markdown.stream({ incompleteLinks: 'text', mode: 'inline' }), truncating before newlines, and treating an empty HTTP 200 stream as no completion. - Split parsed inline nodes in
acceptNextWordwith marks preserved across Latin and CJK word boundaries while keeping inline voids (inlineEquation,date,mention) and links atomic and leaving in-flight streams alive for remaining tokens. - Match type-ahead against leading text leaves only when active marks match, rejecting atomic inline elements, mark mismatches, and IME composition.
- Add
filter: EditorVisibilityFilterand build bounded<prefix>/<suffix>FIM context skipping hidden blocks, locked blocks, and code blocks; remove unusedCopilotPlugin.update.setSuggestion. - Abort in-flight completion requests on full
acceptas well as dismiss, cursor movement, readonly transitions, and view unmount.
- Store parsed inline
-
- Compile Plate documents directly to OOXML in
exportDocxvia pluginformats.docxmappings without React static HTML rendering or a browser DOM, removing thehtml-entitiesdependency and thecolor-name,html-to-vdom,juice,mime-types,virtual-dom, andxmlbuilder2optional peer dependencies, and loadingkatexlazily only when exporting equations - Replace
mammothand browserDOMParserusage inimportDocxwith a direct OPC/WordprocessingML reader that runs on the server without DOM globals, removing themammothoptional peer dependency andconverter-messagefromDocxDiagnostic - Extend
formats.docxmappings (DocxNodeMapping) with symmetric{ encode, decode }for element, mark, and element-property plugins, opaqueencodeBlocks/encodeInlinesfragments, andcontentRoot(slot)for named-root export - Round-trip Word footnotes through
word/footnotes.xmlwhen footnote plugins are installed - Replace
DocxExportOptions.{component,presentation,stylesheet}with optional typedstyles?: DocxExportStyles(DocxExportStyles,DocxParagraphStyle,DocxRunStyle), removemissing-static-presentationfromDocxDiagnostic, and omitlinkTargetcustom properties when regenerating an edited retained source - Inherit and report Word style formatting, drop hidden text (
w:vanish/w:webHidden) with a lossy diagnostic, report missing heading/link/table plugins as lossyunsupported-content, unwrapw:customXmlwhile preserving visible text, resolve header/footer/note parts through OPC relationships, and warn without failing strict import on exclusive-mark schema repairs
Migration:
- Replace
stylesheet,presentation, andcomponentoptions onexportDocx(...)with optional typedstyles: DOCX_EXPORT_STYLES(or omitstylesfor neutral Word defaults). - Custom element and mark plugins exported or imported through
exportDocx(...)andimportDocx(...)now declareformats.docx({ encode },{ decode }, or{ dropped }) instead of relying on static React components or HTML intermediaries; unmapped elements and marks emitunsupported-content(impact: 'lossy'). - Remove
color-name,html-to-vdom,juice,mammoth,mime-types,virtual-dom, andxmlbuilder2from app dependencies if they were only installed forplatejs/docx/exportorplatejs/docx/import. - Remove any switch branch handling
diagnostic.code === 'converter-message'ordiagnostic.code === 'missing-static-presentation'.
- Compile Plate documents directly to OOXML in
-
8c37372by @zbeyens – RemoveDataTransferFormatPhasefromplatejs/domand narrowDomPluginUpdatetoAutoScrollPluginUpdate. -
- Remove
DOMResolutionErrorfromplatejs/domand adopt the single nullableeditor.api.domlookup contract (resolve*andresolveWindow(): Window | null).
Migration: Replace
editor.api.dom.assert*with nullableeditor.api.dom.resolve*, replaceeditor.api.dom.getWindow()witheditor.api.dom.resolveWindow(), and replaceeditor.api.dom.findKey(node)/resolvePath(node)/isReadOnly()witheditor.key(node),editor.read.nodes.path(node), andeditor.api.react.isReadOnly(). - Remove
-
- Re-export
ScrollMarginfromplatejs/domalongsideScrollIntoViewOptions.scrollMargin
- Re-export
-
- Remove
ExitBreakPluginandPLUGINS.exitBreak; bind read-only-safetx.break.exitdirectly inExitBreakKit. - Consult
shouldMergeNodesRemovePrevNodefor empty-block Backspace merges, guard unselectable block voids withstate.nodes.isSelectableand facing-edge structural sibling lookups, and fix cross-blockbreak.splitResetwhile preserving required title joins in one Backspace.
- Remove
-
18ff3adby @zbeyens – FixEditorRootcommit observers for named roots, frozen document views, and lazy callbacks- Deliver root-scoped
onSelectionChangeon named-rootEditorRootviews - Skip live owner commit callbacks on frozen document views and avoid replaying prior commits when attaching callbacks after mount
- Deliver root-scoped
-
9e41cf5by @zbeyens – Deliver updated elements synchronously fromElementProvidertouseElementconsumers without a one-frame stale render, while preserving nested-provider isolation and commit-only store updates foruseElementSelector. -
ba572f2by @zbeyens – FixBaseFindPlugincross-root replacement targeting, composed same-transactionreplaceadvancement, rolled-back replace cleanup, identical-text no-op skipping, whole-word lookaround boundaries, and drifted store scalar self-healing. -
- Add
FindOptions(caseSensitive,wholeWord,regexp) toBaseFindPlugin'sapi.search(query, options?) - Add
update.replace(replacement)and single-undoupdate.replaceAll(replacement)onBaseFindPlugin, skipping locked, void, and non-content ranges - Replace
FindPluginState.matchesand directstore.set({ activeIndex })writes with read-only selectors (count,activeMatch),api.matches(options?),api.matchAt(point),api.setActiveIndex(index), and scalarversion
Migration: Read matches via
find.api.matches()(orfind.store.get('activeMatch')/find.store.get('count')) and change the active match withfind.api.setActiveIndex(index)orfind.api.move(delta). - Add
-
- Accept a single map or a non-empty tuple of
defineFormats(...)calls (PluginFormatMapInput) onformatsin plugin constructors and.extend(), evaluate callbackformatsin.extend(), and removeformats: nullfrom plugin types. - Support priority-ordered Markdown element encoders, mark decoders, and mark
wrapwriters (priority?: number) withundefineddecline fallthrough, operation-scoped leaf wrapping, and equal-priority conflict errors for duplicate element encoders and cross-owner overlapping mark writers. - Compose element
plainTextencoders with multi-property element-property wrappers soBaseListPluginpreserves list markers on headings, blockquotes, code blocks, and other configured targets. - Add
DocxNodeMappingInputtuples for multi-property plugins and reject duplicate DOCX declarations targeting the same element, mark, or(plugin, property). - Remove leaked internal format-mapping type exports
PluginProductNodeMappingRegistry,PluginSelfHtmlMappingMap, andPluginForeignHtmlMappingMap.
- Accept a single map or a non-empty tuple of
-
- Re-export the trimmed
platejs/historysurface (Batch,History,HistoryJSON,HistoryStateApi,HistoryTxApi) withtx.history.isolate(),history: 'isolate', andHistory.fromJSON(editor, json, { value }) - Keep consecutive field fills after a role switch grouped in one undo step, isolate find/replace, lint fixes, input-rule follow-ups, and upload insertions as standalone undo steps, and report caught error causes on comment replay failures
- Re-export the trimmed
-
- Prefix all Plate-serialized HTML data attributes with
data-editor-html-and report any unclaimeddata-editor-html-*attribute during HTML parsing. - Overload
HtmlDecodeContext.preserveto accept a descendantElementtarget (preserve(element, ...attributes)), scoping attribute claims to each claimed element instead of inheriting across descendants. - Add
unwraptoHtmlElementPropertyCreateRulesocreatesElementrules control which sibling properties survive unwrapping a non-text leading block. - Add HTML serialization and parsing rules for
BaseCalloutPlugin,BaseDatePlugin,BaseFilePlugin, andBaseTocPlugin. - Re-export
serializeHtml,HtmlSerializeOptions, andHtmlSerializeResultfromplatejs/html/server.
- Prefix all Plate-serialized HTML data attributes with
-
- Bound prepared
text/htmlclipboard payloads exceeding 5 MiB by raw transfer bytes indecodeHtmlDataTransferwhile keeping parser node and depth limits on the prepared HTML - Add
impact('lossless' | 'lossy') tohtml-parser-recovery,html-unsupported-metadata,html-unsupported-root,markdown-tag-repair,markdown-property-omitted,markdown-unsupported-metadata, andmarkdown-unsupported-rootdiagnostics - Include
model.propertyon HTML continuation property omissions and report that property name inimportDocxproperty-droppeddiagnostics
- Bound prepared
-
14fbdbfby @zbeyens – UnifyBaseIndentPluginupdate options and removeBaseTextIndentPlugin.- Flatten
IndentChangeOptionsonBaseIndentPlugin.update.increaseanddecrease, and add list-family-safesetandclearcommands. - Require positive safe integer
indentvalues (validationVersion: 2), clamp or unsetindentMaxsafely, compose callermatchwithtargetPlugins, and skip locked blocks in indent, line-height, and alignment updates. - Remove
BaseTextIndentPlugin,TextIndentPlugin,PLUGINS.textIndent,data-text-indent, and Word pastetextIndentemission, stripping legacyindent: 0and undeclaredtextIndentduring v54 migration.
- Flatten
-
- Extend
inputRuleVetoto a discriminated union ({ element: string } | { mark: string }), contribute{ mark: context.schema.key }fromBaseCodePlugin, and block typing/break input rules inside inline code while keeping URL pastes over selected inline code, bold/smart quotes around inline code, and unclosed-backtick suppression working across all mark rules. - Bind
InputRulesPluginimmediate Backspace revert to the exact committed transaction, view, and root, fixing named-root revert misses, cross-view Backspace corruption, and multi-editeditor.updatebatch corruption. - Accept NBSP (
\u00A0) alongside ASCII space on all space-triggered block shorthand rules (HeadingRules,BlockquoteRules,HorizontalRuleRules,CodeBlockRules, and list rules). - Fix
matchDelimitedInlineacross multi-leaf text spans andrequireClosingDelimiter: true, refuse spans crossing inline elements, voids, or vetoed marks, and decline inline$a$math inside links without throwing. - Remove
createBlockStartInputRule,BlockStartInputRuleConfig,getBlockTextBeforeSelection,InputRulesDefinition,ResolvedInputRule,ResolvedInputRulesMeta,TrailingBlockDefinition, andTrailingBlockPluginState.level; require aPluginReferencedescriptor forTrailingBlockPluginState.type(defaultBaseParagraphPlugin).
Migration:
- Update
inputRuleVeto.of(context.schema.type)toinputRuleVeto.of({ element: context.schema.type })(or{ mark: context.schema.key }for literal marks). - Replace
createBlockStartInputRule(...)withdefineInputRule(...)+matchBlockStart(...), andcontext.getBlockTextBeforeSelection()withcontext.getBlockStartText() ?? ''. - Replace
TrailingBlockPlugin.configure({ initialState: { type: 'paragraph' } })withTrailingBlockPlugin.configure({ initialState: { type: BaseParagraphPlugin } })(or omittypeto use the default).
- Extend
-
d6215c2by @zbeyens – Clean up Markdown mapping types, bare-URL and break-marker serialization, runtime bugs, and default italic delimiter- Remove unused and redundant Markdown mapping fields (
build,previousSibling,serializeUnknown,decodeNodes,isFlow,isPhrasing,preserveEmptyParagraphs,encodeBlocks,resourceLink),MarkdownPluginRegistry,MarkdownNodeKinds,MarkdownDefinition, andMarkdownEditor. Usedecode,encodeFlow,PluginFormatRegistry, andeditor.plugin(MarkdownPlugin).apiinstead. - Serialize bare URLs through the Markdown serializer so CommonMark-only editors emit
<url>autolinks instead of plain text and GFM table cells keep|URLs lossless via escaped-pipe resource links. - Fix carriage-return (

), split CRLF across link boundaries, double<br/>between table-cell media blocks, literalU+200B-only paragraphs, leading BOM diagnostic offsets, CR-only block tags,remarkStringifyOptionspreserving pluginjoin/unsafesettings,<figure>/<figcaption>owned attribute validation, and table-cell list depth validation. - Change default Markdown italic serialization delimiter from
_to*so CJK italic exports without HTML character references underremark-cjk-friendly; passremarkStringifyOptions: { emphasis: '_' }to keep underscores.
- Remove unused and redundant Markdown mapping fields (
-
f38fe35by @zbeyens – Replace statelesspartialandpreviousstreaming options oneditor.api.markdown.parse*with statefuleditor.api.markdown.stream({ mode, incompleteLinks, lossPolicy, limits }).editor.api.markdown.stream()owns single-pass bounded tail healing (emphasis, strikethrough, inline code, inline and block math, links, images, GFM tables, and half-typed registered tags), incremental segment reuse, fixed-width table row and open fence fast paths, revisionedMarkdownStreamDeltapatches, and strictfinish()parity withparseSlice/parseInline.Migration:
- Replace
parseSlice(accumulated, { lossPolicy: 'allow', partial: true, previous })withconst stream = editor.api.markdown.stream()followed bystream.append(chunk)(orstream.set(accumulated)) andstream.finish(). - Remove
partialfromparse,parseSlice, andparseInlineoption objects, and removepreviousfromparseSliceoption objects.
- Replace
-
- Remove
SchemaElementShapeFor,BaseElement,BaseNode,BaseText,BasePoint, andBaseRangere-exports; useSchemaElementFor,Element,Node,Text,Point, andRangeinstead. - Export
SchemaPropertySource,SchemaPropertyDescriptorMap,EditorRuntimeCarrier, andEditorRuntimeOwnerOf. - Add an optional second contributor type parameter to
EditorElementProps<TPlugin, TContributors>inplatejs/reactandplatejs/static.
- Remove
-
- Re-export
PersistedDocument,PersistedSelection, andeditor.read.persisted(options?)fromplatejs, moveSerializedEditorSelectiontoplatejs/history, replaceEditorValueInputwithInitialValue, and removereadEditorSelectionandPlateV54Migration. - Treat
sourceinmigrateDocumentas a raw-input fallback so persisted envelopes always migrate from their verified schema identity and mixed raw-and-envelope stores convert with one call shape. - Fold deterministic, list-ownership-gated
listIdassignment intomigrateV54and remove the standalonemigrateListIdentityexport fromplatejs/migrations.
- Re-export
-
29bcbd6by @zbeyens – Rename thedefinePluginSlotre-export todefinePluginCompartment.Migration: Replace
definePluginSlotimports fromplatejswithdefinePluginCompartment. -
bf9b87cby @zbeyens – RemoveuseContentRoot,ContentRootController, andUseContentRootOptionsfromplatejs/reactMigration: Use
slots.contentRoot,useChildRoot, anduseRootChromefor element-owned child roots. -
3c20b81by @zbeyens – Consolidate Plate React read hooks and selection reads:- Add
editor.read.selection.value()and removereadEditorSelection - Merge
useEditorPluginStoreintousePluginStore(editor, plugin, ...) - Remove
useElementPath,useEditorId,useEditorMounted,useEditorHasSelection,useEditorValue,useEditorSelection, andcreateZustandStorefromplatejs/react
Migration: Replace
readEditorSelection(editor)witheditor.read.selection.value(),useEditorPluginStore(editor, ...)withusePluginStore(editor, ...),useElementPath()withusePath(),useEditorId()withuseEditor().id,useEditorMounted()withuseEditorRootElement(useEditor()) !== null,useEditorHasSelection()withuseEditorSelector((editor) => editor.read.selection() !== null, { dependsOn: 'selection' }),useEditorSelection()withuseEditorSelector((editor) => editor.read.selection(), { dependsOn: ['selection', 'document'] }), anduseEditorValue()withuseEditorSelector((editor) => editor.read.children(), { dependsOn: 'document', equalityFn: Object.is }). - Add
-
3c2d532by @zbeyens – Removeplatejs/yjs(BaseYjsPlugin,YjsPlugin,KEYS.yjs) and its Yjs/Hocuspocus dependencies; migrate collaboration setups toplatejs/sync,platejs/sync/react,platejs/sync/server, andplatejs/sync/cloudflare -
- Remove the re-exported
SelectionValue,SpanApi,SpanInterface, andEditorSelectionTargetOptionsaliases fromplatejsto matchplitejs(useEditorSelectionandLocationApi.isSpan). - Guard
NodeSelectionpointer capture and post-dragfinishFramefocus restoration against synthetic/released pointers, disconnected editables, and focus drift.
- Remove the re-exported
-
21b6496by @zbeyens – Align Plate root exports anduseStateFieldValuewith single-store shared state fields,'configuration'commits, andStateFieldDescriptorcuts- Share default
useStateFieldValueequality for cloned non-JSON field values (Date,Map,Set,Uint8Array) while preserving customfield.compare - Re-export
LocalStateFieldDescriptorandSharedStateFieldDescriptor, removeinvertEffect,mapEffect,encodeEditorEffect, anddecodeEditorEffectfromplatejs, and retirefield.effectoncollab: 'shared'fields
Migration:
- Replace
commit.dirtyStateKeys.includes('$configuration')withcommit.changed.hasAny('configuration'), and add'configuration'todependsOnorcommit.changed.hasAny(...)checks that relied on'state'waking on plugin reconfiguration. - Replace
editor.read.meta()witheditor.read.value().metaoreditor.read.getField(field). - Update shared fields via
tx.setField(field, value)instead oftx.effects.emit(field.effect, ...), and serialize collaborative changes withcommit.changes.toJSON()instead ofencodeEditorEffect/decodeEditorEffect.
- Share default
-
5b6b606by @zbeyens – Isolate static rendering from editing-only plugin behavior and fix static equation round-tripping:- Add
decorate.static?: boolean(defaulttrue) on plugin definitions and setstatic: falseonBaseFindPlugin,BaseLintPlugin,YjsPlugin, andSyncReactPluginso editing overlays never render in<EditorStatic>orrenderStaticHtml. - Filter static decoration sources by plugin name when
renderStaticHtmlreceivespresentation. - Suppress
editOnlycomponents,render.attributes,inject.nodeProps,leafAttributes,textAttributes, and wrapper slots across all static renders, with or withoutpresentation. - Support unbound component-object
afterNodeChildrenslots (such asReact.memo) in<EditorStatic>. - Preserve
attributes.ref(composing withrefwhen both exist) and makepathoptional onEditorElementfromplatejs/static. - Keep surrounding spaces when
parseHtmlcollapses whitespace around static zero-width\uFEFFplaceholders insidedata-editor-stringelements.
- Add
-
ef419a0by @zbeyens – AddcreateSyncServerAgenttoplatejs/aiand re-exportSyncServerRunResultfromplatejs/sync/serverfor server-side document agents running directly over authoritative sync rooms under suggest-only grants, and scope proposed-block reads to dirty clusters for O(page) large-document reads. -
- Unify table column and row sizing onto flat logical
update.resize,api.createResize, andTableResizeHandle, and removeupdate.setColumnWidth,update.setRowHeight,TableColumnWidthOptions,TableRowHeightOptions,edge: 'left',TableDefinition,describeTableSuggestion, anddescribeTableSuggestionGroupfromplatejs/table. - Add
update.select,update.moveColumn, andread.canMoveColumnonBaseTablePluginfor programmatic canonical cell selection and atomic column reordering. - Remove
clampTableSelectionso programmatic selection and pointer drags keep exact cross-edge ranges, resolve explicit table targets directly inupdate.removefor nested tables, negate RTL column resize deltas inuseTableResize, localize RTL cell arrow navigation, collapse Safari IME composition without cancellingwhich === 229, and landShift+Tabat the end of the previous cell.
- Unify table column and row sizing onto flat logical
-
- Add headless table symmetry commands (
read.canMoveRow,read.header,update.moveRow,update.toggleHeader,update.clearCells,update.duplicateRow,update.duplicateColumn,update.distributeColumns), renameTableMoveColumnOptionstoTableAxisMoveOptions, export named table option types, preserve custom border color/style intoggleBorders, and inherit per-column header flags oninsertRow. - Seed column resize sessions from measured DOM widths on fluid (
defaultTableWidth: null) tables, copy adjacent widths when inserting columns on resized tables, and complete multi-cell keyboard handling (Escape,Enter,ArrowUp/ArrowDown, multi-cellTab, 3-stageCmd+A, and DOM-rect horizontal-X vertical exit). - Export UI-neutral
useTableControlsfromplatejs/table/reactfor table edge hit-testing, touch/keyboard resizing,NodeKey-anchored column drag, and single-transaction+extend bars.
- Add headless table symmetry commands (
-
- Preserve the calling view on
ctx.update.*plugin portals, reject root-transaction fallbacks when a plugin defines no update group, and reflectR | undefinedrefusal return types. - Exclude
txOnlymethods andtxOnlyupdate groups from pluginshortcutsat both compile time and runtime.
- Preserve the calling view on
-
- Add typed
editor.update.result(policy?, fn)overloads on Plate editors with full plugin transaction inference. - Export
isAuthoredRefusalfromplatejs/authored,isLockRefusalandLockRefusalfromplatejs/lock, andEditorJsonObjectfromplatejs.
- Add typed
-
164c49dby @zbeyens – KeyUploadRulesbyUploadKindwith standard HTMLacceptpatterns, replaceclient+getUrlwith a single SDK-neutraluploadhandler, add key-localupdate.retry(key)andapi.accept(kind), and fix post-completion caption undo and secondary-root pasted picture uploads.Migration:
- Key
rulesby'audio' | 'file' | 'image' | 'video'with optionalaccept?: readonly string[],maxBytes, andmaxFiles(removingUPLOAD_FILE_TYPES,UploadFileType,UploadRule.kind,UploadRule.minFiles,too-few-files, andallowedTypes). - Replace
clientandgetUrlwithupload: (file, { onProgress, signal }) => Promise<string>(removingUploadClient,missing-client,missing-url-resolver,resolver-error,UploadFailure.result, andfiles-sdkfromplatejsoptional peer dependencies).invalid-urlandcompletion-errornow carryurl, andmissing-uploadreplacesmissing-client.
- Key
-
1cf5f56by @zbeyens – RemoveDOMGeometryRectfromplatejs/domand exportViewportRectforeditor.api.dom.visibleRect.Migration: Replace
DOMGeometryRectimports fromplatejs/domwithViewportRect. -
- Add fingerprint-neutral
slice: { plainText?: boolean }on block text element schemas, flattening semantic pastes at the top ofplanPaste(droppingslice.roots) and skipping rich clipboard formats only whentext/plaindiffers fromtext/html. - Make external drops atomic on refused, no-op, and non-writable targets, and fix
eventCarriesBlockFragmentto unwrap shared open block ancestors before checking for block payloads. - Replace
BaseCodeBlockPlugin's three paste-flattening hooks withslice: { plainText: true }and guardInputRulesPlugininsertDatarules against exact Plite clipboard slices.
- Add fingerprint-neutral
-
6d42192by @zbeyens – Moveeditor.api.dom.resolveDropTargettoeditor.api.dom.drag.resolveTarget, add lossless anchor-preservingeditor.api.dom.clipboard.cut, foldDOMEditorClipboardCapabilityintoDOMClipboardApi, strip embeds from handle drag previews, populateDataTransferfor read-only drags, scalepaddingSideon zoomed roots, and guard drag scroll repaints by session and owner. -
- Add fingerprint-neutral
slice: { plainText?: boolean }on block text element schemas, flattening semantic pastes at the top ofplanPaste(droppingslice.roots) and skipping rich clipboard formats only whentext/plaindiffers fromtext/html. - Make external drops atomic on refused, no-op, and non-writable targets, and fix
eventCarriesBlockFragmentto unwrap shared open block ancestors before checking for block payloads. - Replace
BaseCodeBlockPlugin's three paste-flattening hooks withslice: { plainText: true }and guardInputRulesPlugininsertDatarules against exact Plite clipboard slices.
- Add fingerprint-neutral
-
ea41af5by @zbeyens – Add{ intent?: TransferIntent }toeditor.read.transfer.check, refuse non-writable text transfer sources and targets before commit, and verify owned content-root integrity on range transfers.
-
4d4154cby @zbeyens – Replace<PagedEditorContent />, Pretext off-DOM layout engines (measurePages,createPretextPageLayoutEngine,createEstimatedPageLayoutEngine,usePageLayoutFragments), live 2-up spread mode, and the@chenglou/pretextpeer dependency with a zero-remount native-DOMPaginationSurfacewrapper,usePageLayout(editableRef), anduseTableRowPageBreak(element)over standard<EditorContent />. -
ef4c7e5by @zbeyens – CollapseRenderTextPropsback to a single host type by removingRenderTextHostProps,RenderTextPieceProps, andpiece, and delete legacy paged-projection, soft-line-end, view-line, and placed-drag internals fromplitejs/domandplitejs/react. -
- Fix Android
insertReplacementTextover non-DOM-sync text so it replaces the expanded target range instead of inserting at the collapsed caret. - Fix Korean and Android composition replacements with explicit toggled marks so mark-on and mark-off states apply to expanded syllable replacements in one undoable edit.
- Fix Android fallback selection reads inside Shadow DOM roots by reading the shadow-root selection before falling back to
window.getSelection(). - Fix Android cross-root
beforeinputrouting to redirect sibling-root selections to the target root editor and skip duplicate desktopinsertTextprobing when noonDOMBeforeInputhandler is attached. - Fix Android line rebuild resolution for nested blocks and inline elements so
rebuildLineremounts the lowest enclosing block(s).
- Fix Android
-
- Add
replaceoption totx.nodes.wrapto replace existing inline wrappers per block atomically without unwrapping refused blocks - Add
editor.read.schema.canWrapto check whether an element can wrap or land at a target location
- Add
-
2647b18by @zbeyens – Stop narrowingcreateEditoranduseCreateEditordocument types frominitialValue, removeEditorValueFromOptionsandPluginsFromOptionsfrom public root exports, and fixuseCreateEditorinherited option handlingMigration: Seeded editors without a schema plugin now infer broad
Value(assignable toEditor). Pass an explicit value type parameter (createEditor<MyValue>()orcreateEditor<MyValue, typeof plugins>({ plugins, initialValue })) or install a schema plugin when you need a narrower document type. -
cd3128cby @zbeyens – Avoid whole-block stringification on plain typing insubscribeTypedTextand reject non-collapsed selection replacements in Suggesting mode -
- Remove
editor.anchor.save,editor.anchor.restore, andEditorDocumentRange(persist plain ranges or feature-level anchors beside the document and recreate live runtime anchors on load) - Project
anchor.resolve()through its capture view by default soanchor.resolve()matchesanchor.resolve(captureView)in Authored previews - Unify v4 ID-addressed point mapping across live anchors, anchor history recovery, history selection restore, and sync presence (threading the confirmed outbox base through unsent presence batches)
- Fix
DecorationSourcerefresh lifecycle bugs: stop auto-retrying throwing observer pushes outside commits, preserve pending typing and outer observer keys across nested observer pushes, guard freshness resets by generation, and run initial full refresh whenobserve()only refreshes partially or throws synchronously
- Remove
-
273b78eby @zbeyens – PreserveauthorIdin<EditorRoot>andcreatePliteRootEditor, isolate<EditorStatic>foreign-document authored reads, moveprojectAuthoredRangetoplitejs/internal, and movecreateAuthoredPluginandAuthoredTestOptionstoplitejs/testing. -
8c37372by @zbeyens – Remove unusedinsertFragmentData,insertTextData,dom({ clipboard: false }),tx.dom.insertData,DOMClipboardInsertDataHandler,DataTransferFormatPhase, six internalplitejs/domclipboard helpers, and five deadplitejs/internalslice exports. -
12abcd6by @zbeyens – AddAuthoredChange.incarnations,authored.read.groupMembers(groupId), and optionalincarnationfiltering onauthored.read.outcome(id, incarnation?), plus internal element-ID minting admission and authored projection helpers used by Plate comments, migrations, and DOCX import. -
- Fix re-entrant commits delivering a later commit's snapshot to outer
subscribeCommitandafterCommitlisteners or rollingeditor.read.lastCommit()backward. - Fix named-root selections leaking onto main-root snapshots built by selection-only commits or cold snapshot reads.
- Type
BaseEditor.subscribeCommitwithEditorCommitListener<V>instead ofEditorCommitListener<any>.
- Fix re-entrant commits delivering a later commit's snapshot to outer
-
- Fix
projectAuthoredDocumentwithout{ editor }keeping split paragraphs and links apart in theacceptedprojection - Fix
proposeComparisonblocking when plugin corrections append blocks or when a comparison merges table cells
- Fix
-
- Move
readEditorSchemaContract,diffEditorSchemaContracts, and theEditorSchemaContract*types offplitejsonto the new public headless subpathplitejs/compiler. - Remove
restoreEditorSchemaContract,compileEditorSchemaContract, and unused compiler exports fromplitejsandplitejs/internal. - Slim serialized
EditorSchemaContractoutput toformatVersion: 2by dropping restoration-only derived tables while keeping aformatVersion: 1compatibility reader inreadEditorSchemaContract. - Fix
COMPILED_SCHEMA_CACHEsorecordSetscallbacks (namedBy.names,keep) are stripped on cache storage and rebound per editor, and includecontentRoots[slot].structurein the compiled schema fingerprint (storageRevision: 4) andEditorSchemaDeltawhile keepingstorageRevision: 3contracts readable.
- Move
-
- Fix cross-grid range deletion starting inside a read-only grid and ending inside a writable grid so writable grid cells are preserved cleanly.
-
d83d8a1by @zbeyens – Hardeneditor.api.dom.clipboard.cutagainst locked owned roots, active reads/updates, authored preview, and focus/selection-only commits duringawait, and report alossydiagnostic when all paste formats are refused. -
aee2a86by @zbeyens – Removetx.fragment.replaceandeditor.update.fragment.replacein favor ofslice.replace(ContentSlice.closed(...)), and exposesliceonEditorCorrectionTransaction. -
7c83372by @zbeyens – Remove 22 internal DOM marker, Android text-diff, hotkey compiler, and engine-detection helpers from publicplitejs/dom, and fixDOMEditor.hasEditableTargetfor interactive controls inside read-only and writable editors.Migration: Inspect
data-editor-*DOM attributes directly when checking rendered DOM elements (or useNodeApi,ElementApi, andTextApifromplitejswhen checking model nodes), useisHotkeyfromplitejs/dominstead ofcreateCompiledHotkeyMatcher, and checkevent.detail === 3instead ofTRIPLE_CLICK. -
d75f0fbby @zbeyens – RemoveDocumentChange.transform,DocumentChange.prototype.correct,DocumentChange.primaryClassification,DocumentChange.rootClassifications, and theisSetValuedoption fromDocumentChange.between. -
- Unify
editor.api.domon one nullable lookup contract by removingassertDOMNode,assertDOMPoint,assertDOMRange,assertDocumentOrShadowRoot,assertEventRange,assertNode,assertPath,assertPoint,assertRange,findKey,hasRange,isReadOnly, andresolvePath, and replacinggetWindow()withresolveWindow(): Window | null. - Remove
DOMResolutionError,Key,DOMCoverage,DOMCoverageSession,DOMCoverageBoundaryEdge,DOMCoveragePointResult,DOMCoverageMaterializeHandler,DOMCoverageMaterializeResult,isTrackedMutation, andgetEditorDOMRootfromplitejs/dom. - Isolate
editor.api.dom.resolveNode,resolvePoint, andresolveRangeper owning view and enforce painted-text freshness oneditor.api.dom.resolveRangeRect.
Migration: Replace
editor.api.dom.assert*with nullableeditor.api.dom.resolve*, replaceeditor.api.dom.getWindow()witheditor.api.dom.resolveWindow(), replaceeditor.api.dom.findKey(node)witheditor.key(node), replaceeditor.api.dom.resolvePath(node)witheditor.read.nodes.path(node), replaceeditor.api.dom.isReadOnly()witheditor.api.react.isReadOnly()(oreditor.read.view.isReadOnly()for document view policy without the<EditorContent readOnly />prop), and replace detachedDOMCoverage.createcalls withslots.contentBoundaryorslots.externalTextpassed to element renderers (RenderElementProps.slots). - Unify
-
164c49dby @zbeyens – AllowDOMDropTargetOptions['files']to accept a readonly array ofEditorElementblocks so file drops can validate multi-kind drafts at drop time. -
- Move slice deletion from
tx.fragment.delete,editor.update.fragment,editorCommands.deleteFragment,EditorFragmentDeletionOptions,EditorTransactionFragmentApi, andDeleteFragmentCommandontotx.slice.delete,editor.update.slice.delete,editorCommands.deleteSlice,EditorSliceDeletionOptions, andDeleteSliceCommand. - Support single-block
NodeSelectionintx.break.exitand refuse inserting default children into read-only containers or read-only-owned roots. - Enforce full-ancestor and owner-root read-only refusal across marks,
tx.blocks.*,NodeSelectiondeletion, and hanging slice replacements. - Unify whole-block landing between commands and raw
tx.text.insert,tx.slice.delete,tx.break.insert, andtx.break.insertSoft. - Guard unselectable block voids on boundary deletion, treat zero-distance collapsed deletes at non-editable nodes as no-ops, prevent extra empty lines on hanging container deletes, stop pulling forward collapsed delete carets into untouched empty non-void inlines, and preserve required prefix occupants on two-block
min: 2forced-layout joins when a default remainder can build.
- Move slice deletion from
-
e490ae5by @zbeyens – AddcontentMarks?: booleanonSchemaElementInput(defaulttrue) so text-admitting elements can rejectrole: 'content'text properties (formatting marks) while keepingrole: 'metadata'text properties (such asauthored) legal across schema compilation, contract/fingerprint serialization,addMark, mixed-rangetoggleMark,getProperty,tracksPlaces, andAuthoredPlugin. -
dca98acby @zbeyens – Enforce root-only transfer admission forslice: { endMatter: true }elements across block drops, side wraps, and text-range point drops, and let plugins adjust colliding end-matter slices during paste landing. -
11b3a12by @felixfeng33 – Allowslots.externalTexton non-void text-only blocks whose schema declaresmin: 1without requiringmax: 1, as long as the rendered element currently holds a single text leaf. Multi-leaf elements (such as code blocks holding pending suggestion marks) can now fall back to nativeslots.children()rendering and remountexternalTextonce back to one leaf. -
- Remove
ExternalTextDispatchResult; external-textdispatch,select,navigateOut, anddeleteOutnow returnvoidand synchronously reset the view (changes: null) when rejected or stale. - Reset active external-text compositions (
changes: null) when the editor or block becomes read-only, and reset on refuseddeleteOutwithout moving focus. - Add
ExternalTextOptions.fallbacksoslots.externalTextfalls back automatically to native children in Suggesting mode, when pending authored changes touch the block, or when the block holds multiple text leaves, while preserving read-only external views in authored previews and handing focus cleanly across mode swaps. - Add optional
ExternalTextView.scrollIntoViewand'scrollIntoView'onEditorLifecycleError, and routeDOMEditor.scrollIntoViewfor ranges, points, and paths targeting external-text views through internal reveal plus outerscrollMarginscrolling. - Replace whole-root external-text
querySelectorAllpreflight scans with O(1) per-runtime projection claims (supporting React StrictMode and<Activity>transitions), cache structural external-text bindings per snapshot while keeping dynamic non-writable checks live, and preserve adapter sync on re-entrant commits and batched split/unsplit transitions.
- Remove
-
ba572f2by @zbeyens – Fix Unicode case-folding in literal case-insensitiveNodeApi.findTextRanges, keep two-axis registeredscrollElementhorizontal scrolling active withscrollMargin, and avoid marking failed or deferred decoration refreshes as fresh. -
- Split inline text runs around inline void elements in
NodeApi.findTextRangesso matches cannot bridge inline voids - Fix case-insensitive literal match offsets in
NodeApi.findTextRangeswhen text contains characters whose lowercase form changes UTF-16 length (such as'İ')
- Split inline text runs around inline void elements in
-
8c3001bby @zbeyens – Fix structural comparison matching and inline diff generation for multi-edit paragraphs, short table cells, shifted void blocks, and inline link delete, merge, wrap, and unwrap edits. -
- Add
history: 'isolate',tx.history.isolate(), and canonical tag'history-isolate'for standalone undo steps that block both automatic and explicit merges, and keephistory: 'new-batch'/tx.history.newBatch()open for compatible follow-up edits withinnewBatchDelay - Add
History.fromJSON(editor, json, { value })to validate saved history against a replacement document for atomictx.value.replace+tx.history.restore, and report an explicit mismatch error when restored history does not match the committed document - Remove internal
unsettle,rest, andcarriedfields from publicBatch, cutCarriedRun,HistoryBatchJSON,HistoryControlTx, andSerializedEditorSelectionre-exports fromplitejs/history, and narrowHistoryJSON.undos/redostoreadonly unknown[] - Clear history on plugin-removal migrations even when schema identity does not change, isolate different property keys on single-node merges, and avoid cloning retained batches when trimming at
maxDepth
- Add
-
- Prevent focus settling and selection guards from reclaiming focus from external iframes
-
- Remove
SchemaElementShapeFor,BaseElement,BaseNode,BaseText,BasePoint, andBaseRange; useSchemaElementFor,Element,Node,Text,Point, andRangeinstead. - Add an optional second element-type parameter to
ElementOf<N, TType>and exportEditorRuntimeCarrierandEditorRuntimeOwnerOf<TEditor>sogetEditorRuntimeOwnerpreserves editor types while stripping view-onlyroot. - Enforce own-key document root lookups and reject
Object.prototyperoot names across document, selection, schema, anchor, history, content-slice, and Yjs boundaries. - Fix view scoping on
tx.break.exit,view.read.schema.{createDefaultChild,copy,canPlace}, andtx.schema.canWrap, prevent prepared-key residue from discarded specs and rolled-back updates, and deduplicate repeated node references in standalone document views.
- Remove
-
- Add
editor.read.persisted(options?)to read canonical{ document, schema, selection? }envelopes across named roots,NodeSelection, authored preview lenses, and captured-document views. - Rename
PersistedDocumentInputtoPersistedDocument, exportPersistedSelection, widenInitialValue<V>to acceptPersistedDocument<V>, widenCreateEditorOptions.initialSelectiontoPersistedSelection, and acceptPersistedDocumentincreateEditor({ initialValue }). - Remove
readEditorSelectionfromplitejs(useeditor.read.persisted({ selection: true })to persist selections) and moveSerializedEditorSelectiontoplitejs/history. - Unify envelope detection to require both
documentandschemawithoutchildren, rejectmeta.__proto__on persisted document ingress, normalize-0invalueCodecs.number, and remove unused persistence exports fromplitejs/internal.
- Add
-
9e41cf5by @zbeyens – Size the empty-block placeholder inside a dedicated[data-editor-placeholder-container]wrapper instead of writing an inlinemin-heightstyle onto the editable host element, so CSSmin-heightclasses work without!important. -
- Memoize named content-root reads during plain-text serialization and skip fallback root traversal when an encoder returns output, preventing exponential work and duplicate diagnostics on nested named roots.
-
- Reject unknown fields in
definePluginwith aTypeErrornaming the unknown key - Preserve validated compiled schema identity through plugin publication so live compartment swaps match validated schema state
- Reject unknown fields in
-
29bcbd6by @zbeyens – RenamedefinePluginSlotandPluginSlot*todefinePluginCompartmentandPluginCompartment*, removePluginSlotLike, enforce nominal compartment identity and sound replaceable capability typing, enforce the 3-lawmigrate/'history-skip'/ Suggesting-mode contract, and tighten view plugin write authority and lifecycle re-entry guards.Migration: Replace
definePluginSlotwithdefinePluginCompartment, replacePluginSlot/PluginSlotValuewithPluginCompartment/PluginCompartmentValue, removePluginSlotLike, and read replaceable compartment plugin APIs througheditor.plugin(MyPlugin)after checkinginstalled.// Before import { definePluginSlot } from 'plitejs'; const mode = definePluginSlot('mode'); const editor = createEditor({ plugins: [mode.of(MyPlugin)] as const }); editor.api.myPlugin.run(); // After import { definePluginCompartment } from 'plitejs'; const mode = definePluginCompartment('mode'); const editor = createEditor({ plugins: [mode.of(MyPlugin)] as const }); const portal = editor.plugin(MyPlugin); if (portal.installed) { portal.api.run(); }
-
- Add headless
writePolicy: 'propose-only'view confinement oncreateEditorView, keeping writes inproposemode out of human undo history and refusing direct mutations,setView,decide, and React mounting. - Propagate
setEditorReadOnly(editor, true)reactively to derived views andproposeComparison, and return{ status: 'blocked' }fromhistory.undo,history.redo, andhistory.recordon read-only orpropose-onlyviews. - Add
editor.update.result(policy?, fn)for structuredcommitted | unchanged | refusedoutcomes without triggering UI refusal listeners, and exportisAuthoredRefusalfromplitejs/authored. - Add reload-stable
editor.read.revision()andeditor.read.nodes.revision(id)(tx.nodes.revision(id)inside updates), and restrict named-rootnodes.byId(id)to the view's own root. - Support atomic same-update
tx.authored.withdraw()+tx.authored.propose()with full rollback on empty or refused replacements, block table withdrawals that cover foreign pending marks, and admit compound batches in native sync (SYNC_RULES = 9). - Add lifecycle-managed per-change
data?: EditorJsonObjectmetadata (authored-meta) ontx.authored.propose,proposeComparison, andAuthoredChange, bulkdecide({ action, all: true, authorId? }), narrowedAuthoredViewunion arms, stored-author ownership enforcement ontx.authored.propose({ changeId }), and uniformauthoredVetoenforcement on forced proposals.
- Add headless
-
e62fe85by @zbeyens – Reposition range geometry overlays and inactive selection carets when preceding sibling elements mount, unmount, or resize above an editable surface. -
bf9b87cby @zbeyens – Clean upplitejs/reacthook exports and drop caller generics fromuseElement- Rename
useElementPathtousePath(keeps returningnulloutside an element renderer) - Remove caller type parameter on
useElement(): Element - Remove
useOptionalElement,useContentRoot,ContentRootController, andUseContentRootOptions - Remove
setDOMTextSyncRendererCapability,setRetainedTextFlowRendererCapability, andDOMTextSyncRendererCapabilityContextfrom publicplitejs/react - Remove
anyfromuseEditorContextanduseOptionalEditorContextreturn types
Migration: Import
usePathinstead ofuseElementPath, remove<T>type arguments onuseElement(), and replaceuseContentRootwithslots.contentRoot,useChildRoot, anduseRootChrome. - Rename
-
18ff3adby @zbeyens – Fix derived view follow state and unmounteduseEditorRootElementscoping- Preserve live focus, composing, and DOM reach on same-root views derived from
useRootEditorwhile keeping sourcereadOnlylocks - Return
nullfromuseEditorRootElementfor unmounted non-following views instead of another view's DOM root
- Preserve live focus, composing, and DOM reach on same-root views derived from
-
3c20b81by @zbeyens – Addeditor.read.selection.value()for whole-document semantic selection reads (preserving named roots andNodeSelection), add optional(selector?, options?)touseElementPath, and removereadEditorSelection,useEditorSelection,useNodeSelector, anduseTextSelectorfrom publicplitejsandplitejs/reactexports.Migration: Replace
readEditorSelection(editor)witheditor.read.selection.value(). ReplaceuseEditorSelection()withuseEditorSelector((editor) => editor.read.selection(), { dependsOn: ['selection', 'document'] }). ReplaceuseNodeSelectoranduseTextSelectorwithuseEditorSelector(using{ nodeKey }independsOn) oruseElementPath. -
3c2d532by @zbeyens – Removeplitejs/yjsanddefineEffectshared-effect collaboration hooks (collab,collabReplay,collabSnapshot,collabTransport,getCollabEffects,getCollabEffectTypes), completing the hard cut to native v4 sync (plitejs/sync,plitejs/sync/server,plitejs/sync/cloudflare, andplitejs/sync/react) -
- Add
ScrollMarginandScrollIntoViewOptions.scrollMarginto clear overlays withscrollMode: 'if-needed'and merge with CSSscroll-marginviaMath.max - Deduplicate commit-triggered decoration reads for node keys an observer already refreshed at the same editor version, keeping first-frame paint fresh while eliminating duplicate reads
- Add
-
- Remove the duplicate
SelectionValuealias (useEditorSelection), the one-methodSpanApiandSpanInterfaceexports (useLocationApi.isSpan), andEditorSelectionTargetOptions; tightenLocationApi.isSpanto reject non-2-length path arrays. - Promote persistent
editor.anchorhandles created during a committingeditor.updateinto live commit tracking so they map across subsequent commits, while keepingtx.anchorand internal transform anchors transaction-scoped. - Split document-view snapshot anchors and shared endpoint mapping into dedicated core modules without altering live or history anchor behavior.
- Preserve named-root metadata when resolving DOM target ranges in
plitejs/reactand recognize expanded target-range boundary spellings (between blocks, next-block offset 0, and adjacent text leaves) without suppressing collapsed cross-block or cross-leaf caret moves.
- Remove the duplicate
-
- Preserve
editor.read.selection()object identity (deep-frozenRange) across repeated reads, unrelated document, metadata, and state-field commits, and named-root views so React selectors comparing unchanged selections hitObject.iswith zero deep walk.
- Preserve
-
8af14abby @zbeyens – Fix Shift+click selections across nested content roots losing their cross-root selection state when pointer release runs beforeselectionchange. -
21b6496by @zbeyens – Storecollab: 'shared'state fields solely inrecords['shared-state'], isolate non-JSON live state values, add'configuration'toEditorCommitChangeKind, tightenStateFieldDescriptor, and removeinvertEffect,mapEffect,encodeEditorEffect,decodeEditorEffect,state.meta(), and sharedfield.effect- Store
collab: 'shared'state fields only inrecords['shared-state'](migrating legacymetaentries on load) sotx.value.replace, late install, and multi-peer sync converge on one store - Isolate non-JSON live field values (
Date,Map,Set,Uint8Array, andSharedArrayBuffer-backed views) across editor creation, persisted reload, reads, anduseStateFieldValue - Add
'configuration'toEditorCommitChangeKindand remove the'$configuration'sentinel fromcommit.dirtyStateKeys - Split
StateFieldDescriptorintoLocalStateFieldDescriptor | SharedStateFieldDescriptor, model omittedinitialasTValue | undefined, and represent absent transition sides safely - Remove
invertEffect,mapEffect,encodeEditorEffect,decodeEditorEffect, andstate.meta()(editor.read.meta(),tx.meta()), and retirefield.effectoncollab: 'shared'fields (which now sync and undo exclusively throughset_registersteps)
Migration:
- Replace
commit.dirtyStateKeys.includes('$configuration')withcommit.changed.hasAny('configuration'), and add'configuration'todependsOnorcommit.changed.hasAny(...)checks that relied on'state'waking on plugin reconfiguration. - Replace
editor.read.meta()witheditor.read.value().metaoreditor.read.getField(field). - Add
persistand removereduceoncollab: 'shared'fields, update shared fields viatx.setField(field, value)instead oftx.effects.emit(field.effect, ...), handleundefined(or supplyinitial) on fields declared withoutinitial, and type runtime field parameters asEditorStateFieldrather thanStateFieldDescriptor. - Serialize collaborative changes with
commit.changes.toJSON()(set_registercarries shared state fields) and history withHistory.toJSON/History.fromJSONinstead of callingencodeEditorEffectordecodeEditorEffect.
- Store
-
ef419a0by @zbeyens – Addserver.runtocreateSyncServerfor serialized server-side read and write turns with per-actor element ID minting, incremental rollback, andwritePolicy: 'propose-only'confinement on suggest-only non-deciding grants. -
- Type
editor.plugin(P).update.*methods as returningR | undefinedon refusal, keepeditor.plugin(P).update(policy)non-callable, and preserve generic<TValue>inference oneditor.update.setField. - Remove unused one-shot helpers
editor.update.annotations,editor.update.effects.all,editor.update(policy).result(fn), and callableeditor.update(policy)(useeditor.update.result(fn)ortx.annotations/tx.effects.all()insideeditor.update((tx) => ...)). - Harden post-commit notification durability and fix view
lastCommit/maxLengthsharing, getter-defined plugin update methods,tx.blocks.setproperty validation, and unfillable block-replacement defaults.
- Type
-
1cf5f56by @zbeyens – RemoveDOMGeometryRectfromplitejs/domand return frozenViewportRectfromeditor.api.dom.visibleRect, widenuseEditableClipto accept any four-edge viewport rect (DOMRect,DOMRectReadOnly, orViewportRect), and avoid scheduling unused animation-frame flushes when onlyuseEditableClipis mounted.Migration: Replace
DOMGeometryRectimports fromplitejs/domwithViewportRect. -
- Add window-scroll virtualization fallback, ignore unbounded
overflow-y: autowrappers, retain active IME composing blocks during scroll, and mount all blocks in static flow on print inVirtualizedEditorContent
- Add window-scroll virtualization fallback, ignore unbounded
-
- Pass
slots.contentRootinRenderVoidPropsand addautoFocussupport to content-root slots so void elements mount schema-owned child roots throughslots.contentRoot(slot)instead of<EditorContent root> - Throw when
<EditorContent root>mounts a schema-owned child root inside its owning element renderer - Guard live DOM selection reads during active IME composition across
beforeinput, WebKit Shadow DOM probes, and hidden-end settles, and expire stale text-input repair echo records
- Pass
Full changelog: v54.0.0-beta.8...v54.0.0-beta.9
v4.1.2
Fixes
- Selection add and remove copy the selection
Setinstead of mutating the previous one, so an earlierselectedIdssnapshot stays unchanged after the next select or deselect.TreeProvideralso uses each store's own state as its SSR snapshot instead of sharing one module-level state object across tree instances. (#400)
v8.11.0
- docs(agents): name Biome and Vitest as the tooling actually in use by @mathuo in https://github.com/dockview/dockview/pull/1778
- feat(core): tab-group-aware panel placement on a single TabStrip by @mathuo in https://github.com/dockview/dockview/pull/1774
- fix(core): one tab group drop rule for every tab animation by @mathuo in https://github.com/dockview/dockview/pull/1780
- refactor(core): every tab drop resolves its tab group through one rule by @mathuo in https://github.com/dockview/dockview/pull/1781
- refactor(core): one owner for drag state; drops carry their tab group position by @mathuo in https://github.com/dockview/dockview/pull/1783
- feat(core): TabStripTarget, one way to say where a tab goes by @mathuo in https://github.com/dockview/dockview/pull/1784
- fix(core): one owner for pinned state by @mathuo in https://github.com/dockview/dockview/pull/1785
- test: end-to-end and unit coverage for tab strip behaviour by @mathuo in https://github.com/dockview/dockview/pull/1786
- refactor(core): one record of tab group membership, one place type; pin flip waits for onWillDrop by @mathuo in https://github.com/dockview/dockview/pull/1788
- docs: weekly documentation sync (2026-11-20 to 2026-11-27) by @mathuo in https://github.com/dockview/dockview/pull/1787
- fix(core): tab strip follow-ups: chip drops, collapsed tab groups, pins across a reload by @mathuo in https://github.com/dockview/dockview/pull/1790
- docs: cover the tab strip changes ahead of the minor release by @mathuo in https://github.com/dockview/dockview/pull/1791
Full Changelog: https://github.com/dockview/dockview/compare/v8.10.0...v8.11.0
v4.1.1
Fixes
- Keyboard shortcuts no longer corrupt type-to-find: PageDown used to fall through and append the literal string "PageDown" to the search term, and other non-character keys and modifier shortcuts are now ignored as well. AltGr and macOS Option-composed letters still reach the search. Each tree also keeps its own search term instead of sharing one term across every tree on the page.
A without an onCreate handler now runs type-to-find instead of doing nothing, matching what a plain character does.
Backspace now deletes the visible selected rows rather than the focused row when the two differ (arrowing moves focus without selecting, and selected rows hidden by a search filter or collapsed folder are skipped), falling back to the focused row when no visible row is selected. Deleted ids are also cleared from the selection so pressing Backspace again deletes the newly focused row, and focus moves to the nearest visible row that survives the deletion (skipping descendants inside a selected folder, or moving to the previous visible row at the end of root).
Internally, the keyboard commands moved into one table of small handlers, so the tree's keydown branch is no longer 200 lines long, and the duplicated computeDrop branches are merged. (#399)
v2.16.0
This feature release updates Immer to 11.2.14 for major reducer and RTK Query cache update perf improvements, adds an options argument to upsertQueryEntries for safer writes while fetches are in flight, adds a guarded undo for optimistic updates, adds api.util.removeQueryData, lets refetchOnFocus and refetchOnReconnect take a max data age in seconds, makes prefetch return a promise, fixes lost invalidations under invalidationBehavior: 'immediately', adds checkCurrent and better error reporting to the listener middleware, fixes two regressions from 2.15.0 around memory use and retainFor, and includes several smaller fixes plus a new docs page on when queries run and refetch.
This release continues the work from our roadmap to Redux Toolkit 3.0.
We've updated our Immer dependency to 11.2.14, which has another round of significant perf improvements. Since every createSlice reducer and every RTK Query cache update runs through Immer, this should speed up most Redux apps with no code changes.
We expanded Immer's benchmark suite to cover more realistic scenarios: frozen initial state (which is what you have in a real Redux store), chained updates, 10k-item arrays, and storing large API responses the way RTK Query does. Running it showed several places where Immer was doing far more work than it needed to:
- Freezing: Immer used to deep-freeze the entire result after every update, walking every object in the tree even when it hadn't changed and was already frozen. It now freezes each modified copy as it finalizes, and only walks values that are actually new.
- Copying frozen arrays: copying a frozen array with
slice()turned out to be much slower in V8 than spread syntax, so Immer now uses spread. - Iteration: Immer 11.0 made loose iteration (
Object.keys) the default, but a rewrite in the same release accidentally kept the finalize step on the slower strict iteration path. It now follows the setting again, so you get the faster iteration that was intended all along. - Walking new data and proxy traps: finalize skips primitives early and uses index loops when walking newly assigned data, and the proxy
getandsettraps do less work per access.
Comparing Immer 11.2.13 to 11.2.14 with auto-freeze on, from Immer's benchmark suite:
| Scenario | Speedup |
|---|---|
| 10k array: toggle one item | 91x (1.04ms → 11.4µs) |
| 10k array: 10 chained toggles | 89x |
| 10k array: add an item | 33x |
10k array: update via find |
2.7x |
| 100 items: update | 8.9x |
| RTKQ-style action sequence | 4.8x |
| Store a new 1k-item API response | 2.0x |
Immer also has an optional enableArrayMethods plugin, which RTK does not turn on by default. With that plugin enabled, 11.2.14 makes array reordering much faster: removing one item from a 10k-item array is 143x faster, and 10 chained removes are 209x faster. If your app does a lot of array updates in reducers, you can opt in by calling enableArrayMethods() from immer once at startup.
See the Immer 11.2.14 release notes for details, including edge case behaviors.
We've had reports that pushing data into the cache from a websocket or other external source didn't play well with fetches that were already running. upsertQueryEntries wrote the new value, then the older fetch resolved and overwrote it with stale data. The upsert also marked the entry as fulfilled, cleared any error, and restarted the keepUnusedDataFor timer, which isn't always what you want for a background update.
upsertQueryEntries now takes an optional second argument with three boolean options. All default to false, so existing behavior is unchanged:
ignoreEarlierFetches: a fetch that was already running when the upsert happened has its data ignored when it resolves. If that fetch fails, it still sets the entry's status and error. Fetches started after the upsert are not affected. This also covers fetches started byupsertQueryData.keepRequestState: existing entries keep theirstatus,requestId,error, and timestamps. Only the data and provided tags change. Entries that don't exist yet are created as fulfilled.keepUnusedDataTimer: existing entries don't get theirkeepUnusedDataFortimer restarted. New entries with no subscribers get the normal timer.
socket.on('postUpdated', (post) => {
dispatch(
api.util.upsertQueryEntries(
[{ endpointName: 'getPost', arg: { id: post.id }, value: post }],
{ ignoreEarlierFetches: true, keepRequestState: true },
),
)
})
Note that when a fetch's result is ignored, its initiate() promise resolves with the current cache entry, which holds the upserted data. The options type is exported as UpsertEntriesOptions.
The standard optimistic update pattern calls patchResult.undo() when the mutation fails. If a refetch or another cache write replaced the data in the meantime, that undo applied its inverse patches on top of newer data and could corrupt it (#5513).
The undo returned by updateQueryData now accepts { ifUnchanged: true }. It only applies the inverse patches if the cached data is still the same value this update stored. If something else has replaced the data, or the entry was removed, the undo does nothing. Plain undo() keeps the existing unconditional behavior, so queryFulfilled.catch(patchResult.undo) still works as before.
With several overlapping optimistic updates, skipping an older undo can leave a failed mutation's changes in the cache. We recommend pairing the guarded undo with an invalidation on error, so the cache ends up matching the server either way:
async onQueryStarted({ id, ...patch }, { dispatch, queryFulfilled }) {
const patchResult = dispatch(
api.util.updateQueryData('getPost', id, (draft) => {
Object.assign(draft, patch)
}),
)
try {
await queryFulfilled
} catch {
patchResult.undo({ ifUnchanged: true })
dispatch(api.util.invalidateTags(['Post']))
}
}
Thanks to @dagemawinegash for implementing this!
We've had a long-standing request for a way to remove a single cache entry (#2820). api.util.removeQueryData(endpointName, arg, options?) does that:
const removed = dispatch(
api.util.removeQueryData('getPost', 5, { onlyIfUnused: true }),
)
It runs synchronously and returns true if an entry was removed. With onlyIfUnused: true, it skips entries that still have subscribers and returns false. It uses the endpoint's serializeQueryArgs and works for infinite queries.
Removal does the same cleanup as automatic cache expiry: it aborts a running request, clears timers and polling, and resolves cacheEntryRemoved. Mounted useQuery, useQuerySubscription, and useInfiniteQuery hooks go back to isLoading and refetch. Lazy query hooks reset to uninitialized and don't refetch. Subscriptions created with initiate() are dropped.
In most cases you probably want one of the existing tools instead: keepUnusedDataFor, invalidation or refetch, resetApiState, or currentData. The docs list those first. Thanks to @riqts for the earlier proposal in #4216 that this builds on.
refetchOnFocus and refetchOnReconnect now accept a number of seconds as well as a boolean, at the createApi, hook, and initiate() subscription levels (#5585). With a number, the entry only refetches on focus or reconnect if its data is at least that old, or if it has no data. 0 behaves like true. When several subscribers use different values, the entry refetches if any of them would.
// Only refetch on focus if the data is more than 60 seconds old
useGetPostsQuery(undefined, { refetchOnFocus: 60 })
api.util.prefetch and the callback from usePrefetch now return a promise (#5580). It resolves when the request finishes, joins a request that's already running, and resolves right away if no fetch was needed. It never rejects; check the cache entry if you need to know about errors.
await dispatch(api.util.prefetch('getPost', 5, { ifOlderThan: 30 }))
prefetch and usePrefetch also work on infinite query endpoints now. They fetch the first page when there's no cached data, and refetch like a normal infinite query refetch when there is.
With invalidationBehavior: 'immediately', an invalidation that arrived while a query was running could be lost. If that query didn't provide the invalidated tag yet (its first fetch, or a refetch whose result starts providing the tag), nothing refetched it, and the entry kept showing pre-mutation data.
RTKQ now tracks tags invalidated while queries are running. When a request settles, if any tags it now provides were invalidated after the request started, the entry is refetched if it has subscribers, or removed if it doesn't. Several invalidations during one request produce one refetch. This covers infinite queries too.
The default 'delayed' behavior is unchanged. If your app cares about stale data after mutations, we recommend trying invalidationBehavior: 'immediately'. It avoids holding back invalidations while queries are running (#4347, #3979, #4794), and we plan to make it the only behavior in 3.0.
take and condition now accept an options object as their second argument, { timeout?, checkCurrent? }, in addition to a plain timeout number (#5523). With checkCurrent: true, the predicate is first called with the triggering action and the current state. If it matches, condition resolves true immediately and take resolves with [triggeringAction, currentState, currentState]. Otherwise it waits as usual.
await listenerApi.condition((action, current) => current.auth.ready, {
checkCurrent: true,
timeout: 5000,
})
Be careful with predicates that only check the action type: they can match the triggering action itself.
Behavior change: errors thrown by forked tasks with autoJoin: true (including nested forks) are now reported to onError, with a new raisedBy: 'fork' value. Before, they were silently dropped unless you read task.result. The error still doesn't change the task's result or fail the parent listener, and cancellations are not reported. If your onError handler switches on raisedBy, it will now see 'fork' in addition to 'effect' and 'predicate'. Thanks to @wozhenbang2004 for both of these changes!
We also fixed ForkedTask.result rejecting with a listener-completed TaskAbortError after the task had already finished. This happened whenever the listener didn't await the result itself, which was every time with autoJoin: true. A settled task now keeps its { status: 'ok', value } or { status: 'rejected', error } result. It only rejects if the listener is cancelled or completes while the task is still running.
The listener middleware docs now cover checkCurrent, the rules for when ForkedTask.result rejects, and how duplicate listeners are detected.
2.15.0 had two regressions in RTKQ's subscription and request tracking.
initiate() results kept the settled store state alive. Each running request holds a promise that resolves with the root state, and the result's abort function closed over that request. So every initiate() result your code held onto (arrays passed to Promise.all, refs, SSR code awaiting getRunningQueriesThunk()) kept a full state snapshot in memory, and memory use grew quadratically with concurrent requests. In a benchmark with 2000 concurrent fetches, retained memory after GC dropped from 356 MB to 23 MB. abort now looks up the running request when it's called.
retainFor applied on every later unsubscribe instead of once. It stayed on the cache entry, so each later unsubscribe kept the entry for the longer of keepUnusedDataFor and retainFor. Now retainFor sets a deadline once, when the last subscriber leaves (or when the request settles if nothing subscribed). Later unsubscribes keep the entry until the later of that deadline and the normal keepUnusedDataFor timer. We also fixed an unsubscribe during a retainFor fetch removing the entry and aborting the request.
The default retry backoff left an abort listener attached to the request's signal after each delay finished, so they piled up across attempts and stayed attached after the request succeeded or ran out of retries (#5656). The listener is now removed when each delay ends. Thanks @FullStraing!
WritableNonArrayDraft is now exported from the package root. WritableDraft resolves to it for non-array objects, so projects with declaration: true got TS4023/TS4058 errors when exporting an inferred slice or its actions (#5650). Thanks @draarivpatel-ui!
copyWithStructuralSharing reused the old object when the new one had the same number of keys but different key names with undefined values, such as { filterId: '1' } → { address: undefined }. That made useLazyQuery keep the old arg and show the old cache entry's data after trigger() with the new arg, and could keep stale queryFn results (#5271). It now only reuses the old value when the key exists on the old object. Thanks @itisrmk!
upsertQueryData on an infinite query entry with more than one cached page could nest the upserted { pages, pageParams } object as extra pages, because the upsert went through the cached-page refetch loop. Upserts now skip that loop. Thanks @dfedoryshchev!
autoBatchEnhancer tracked subscribers by callback, so subscribing the same callback twice only notified it once per batch, and unsubscribing either registration silenced both (#5659). A listener that subscribed or unsubscribed other callbacks could also change which callbacks ran partway through a notification. Each subscription is now tracked separately, and changes made during a notification take effect on the next one, matching the core Redux store. Thanks @git-abhijeet!
If an infinite query started with an initialPageParam passed at the call site (hook option or initiate() option) and its first page failed, the next refetch(), fetchNextPage(), poll, or invalidation used the endpoint's initialPageParam instead. That value is now stored on the cache entry and reused. Thanks @kkatalz!
There's a new Request Behavior usage page that covers when a call starts a request, joins a running one, or uses cached data; which option wins when several force a refetch; what triggers refetches; and how retry options combine. It includes a comparison table for people coming from TanStack Query. The Cache Behavior page now focuses on how long data is kept, including retainFor and the ways an entry gets removed early, and the Automated Re-fetching page replaces the big tag matching matrix with the two rules behind it.
The useQueryState result type signature in the docs is now correct (thanks @FullStraing!).
- feat(toolkit): add checkCurrent to listener take and condition by @wozhenbang2004 in https://github.com/reduxjs/redux-toolkit/pull/5630
- fix(toolkit): report errors from autoJoined listener tasks by @wozhenbang2004 in https://github.com/reduxjs/redux-toolkit/pull/5631
- Add
api.util.removeQueryDataby @markerikson in https://github.com/reduxjs/redux-toolkit/pull/5632 - Keep a forked task's outcome when its listener finishes after the task settles by @markerikson in https://github.com/reduxjs/redux-toolkit/pull/5639
- Add a seconds value for
refetchOnFocus/refetchOnReconnect, and return a promise fromprefetchby @markerikson in https://github.com/reduxjs/redux-toolkit/pull/5638 - Refetch entries invalidated while their request is running under
invalidationBehavior: 'immediately'by @markerikson in https://github.com/reduxjs/redux-toolkit/pull/5640 - feat(query): add guarded undo for optimistic updates by @dagemawinegash in https://github.com/reduxjs/redux-toolkit/pull/5599
- Add options argument to
upsertQueryEntriesfor in-flight fetches by @markerikson in https://github.com/reduxjs/redux-toolkit/pull/5641 - Stop
initiate()results from keeping the settled store state alive by @markerikson in https://github.com/reduxjs/redux-toolkit/pull/5642 - Count retainFor once instead of on every later unsubscribe by @markerikson in https://github.com/reduxjs/redux-toolkit/pull/5643
- fix(types): export WritableNonArrayDraft by @draarivpatel-ui in https://github.com/reduxjs/redux-toolkit/pull/5651
- fix(query): release abort listeners after retry backoff by @FullStraing in https://github.com/reduxjs/redux-toolkit/pull/5657
- fix(query): don't reuse an object with different keys in copyWithStructuralSharing by @itisrmk in https://github.com/reduxjs/redux-toolkit/pull/5652
- fix(toolkit): keep the hook's
initialPageParamon infinite query refetch andfetchNextPageby @kkatalz in https://github.com/reduxjs/redux-toolkit/pull/5627 - fix(toolkit): don't refetch cached pages when upserting an infinite query by @dfedoryshchev in https://github.com/reduxjs/redux-toolkit/pull/5625
- Preserve independent subscriptions during batched notifications by @git-abhijeet in https://github.com/reduxjs/redux-toolkit/pull/5660
- Bump Immer to 11.2.14 to pick up perf improvements by @markerikson in https://github.com/reduxjs/redux-toolkit/pull/5662
Full Changelog: https://github.com/reduxjs/redux-toolkit/compare/v2.15.0...v2.16.0
v4.1.0
Features
-
tree.scrollTo()no longer swallows errors thrown while scrolling to a node. It still ignores the case where the id never appears, but any other error now rejects the returned promise instead of failing silently. Scrolls that focusing, selecting or editing a node start on their own still never reject. It also always returns a promise now, including when the id is empty. (#407)
Fixes
- A newer
tree.scrollTo()call now replaces an older one that is still waiting for its row, so the list no longer jumps back to the older target when that row appears later. Scrolls that focusing or selecting a node start never replace a pending call. (#407)