3 hours ago
react-arborist

v5.0.0

Breaking Changes

  • Replace react-dnd and react-dnd-html5-backend with @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 using ref={dragHandle} keep working unchanged while custom renderRow components receive drag listeners on attrs (and must spread {...attrs} while composing pointer/mouse/touch handlers); <DragOverlay> now renders drag previews so DragPreviewProps drops offset and mouse and the preview mounts only during an active drag with isDragging always true (so previews that animated out on isDragging === false will not get that render); XYCoord is defined locally; pointer-only sensors (no KeyboardSensor) and accessibility props are added; dndBackend, dndManager, dndRootElement, and dragType are removed rather than deprecated; and capabilities tied to react-dnd or native HTML5 drag and drop (external react-dnd targets, OS/cross-app drops, iframe dndRootElement, and shared multi-tree <DndContext> tracked in #396) are dropped (see "Migrating from v4" in the README). (#391)
4 hours ago
next.js

v16.5.0-canary.73

Core Changes

  • turbopack: document chunking defaults as minified sizes: #102540
  • Add statically analyzed Go route and proxy configuration: #101551

Misc Changes

  • test: mock the canary lookup in the agent upgrade reuse test: #102553

Credits

Huge thanks to @sokra, @lukesandberg, and @timneutkens for helping!

5 hours ago
plate

v54.0.0-beta.9 (2026-11-29)

@platejs/cli

Patch Changes

  • 84e1614 by @zbeyens –

    • Narrow plate generate to emit exact Value, Document, named-root value types, and static schema handles without unreachable Editor / Mutations types or hardcoded platejs/react imports.
    • Fix JSON property type printing across Readonly / utility aliases, node_modules declarations, set-of-json properties (authored), and application schema.properties handles while rejecting host/callable/deep types.
    • Derive narrowed per-element text interfaces from textAllowedByParentType (for contentMarks: false blocks), emit prefix + remainder child 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 trim plate migrate new to three files (from.ts, to.ts, migration.ts).
  • 8ae1716 by @zbeyens –

    • Import isNominalPluginDescriptor from platejs/compiler when bundling editor entries in plate generate
  • 8bcb16c by @zbeyens –

    • Add --export <name> to plate migrate run (default EditorMigrations) while keeping static single-export bundling.
    • Allow mixed raw and persisted envelope files in one plate migrate run --from <version> run, matching migrateDocument raw-fallback behavior.
    • Include legacy and mapRanges guidance in the plate migrate new migration template.
  • f41097b by @zbeyens – Update plate codemod plite-to-plate diagnostics for removed plitejs/history internal type re-exports (CarriedRun, HistoryBatchJSON, HistoryControlTx, SerializedEditorSelection)

  • bf9b87c by @zbeyens – Update plate codemod plite-to-plate diagnostics for renamed plitejs/react usePath and removed useElementPath, useOptionalElement, useContentRoot, and renderer capability exports

  • 29bcbd6 by @zbeyens – Update the plite-to-plate codemod to handle definePluginCompartment alongside legacy definePluginSlot.

  • 3c2d532 by @zbeyens – Drop removed Yjs codemod mappings and keep plitejs/sync sync and SyncPlugin imports on plitejs/sync with a manual diagnostic in plate codemod plite-to-plate

  • 4d4154c by @zbeyens – Update the plite-to-plate codemod classification for the native-DOM pagination surface (PaginationSurface, PaginationSurfaceProps, useTableRowPageBreak) and remove retired PagedEditorContent and Pretext pagination symbols.

@platejs/test

Published @platejs/test@54.0.0-beta.9.

platejs

Minor Changes

  • 6d42192 by @zbeyens – Add BaseLockPlugin.read.containsLocked covering self, ancestors, descendants, and owned content roots, cache per-table span indices for O(1) row-drag hover vetoes, and migrate UploadPlugin to editor.api.dom.drag.resolveTarget.

Patch Changes

  • 4d4154c by @zbeyens – Replace <PagedEditorContent />, Pretext pagination exports (measurePages, createPretextPageLayoutEngine, createEstimatedPageLayoutEngine, usePageLayoutFragments), and the @chenglou/pretext peer dependency with PaginationPlugin, PaginationContent, usePageLayout(editableRef?), and useTableRowPageBreak(element) for zero-remount Pageless and Paged editing on standard <EditorContent />.

  • ef4c7e5 by @zbeyens – Collapse RenderTextProps back to a single host type by removing RenderTextHostProps, RenderTextPieceProps, and piece from platejs/react, and drop obsolete data-editor-inset and data-editor-text-piece projection markers.

  • 5c8641d by @zbeyens – Set a fallback aria-label="Autocomplete" on the editor root while an autocomplete occurrence is active and the editor has no aria-label or aria-labelledby, restoring the root when the popup closes

  • d85b122 by @zbeyens – Move combobox trigger policy (trigger, triggerPreviousCharPattern, triggerQuery, maxQueryLength, queryPattern, label) and syncPopup onto useCombobox in platejs/combobox/react, export ComboboxCompletion and ComboboxPopupState, and remove the headless platejs/combobox entrypoint (ComboboxState, ComboboxEditor, filterWords, FilterWordsOptions, FootnotePluginState).

  • ebf1ecb by @zbeyens –

    • Add optional continuation callback (({ ...context, block, properties })) on HtmlElementPropertyCreateRule (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>, and white-space: pre spacing 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 a createsElement HTML mapping replaces or unwraps an unsupported leading block, matching Markdown list loss reporting; parse board clipboard HTML with lossPolicy: 'allow'
    • Reuse compiled plain-text mappings across repeated serializePlainText(editor) calls and align projection JSDoc with runtime behavior
    • Narrow DocxExportResult to warnings-only on success and an error-first tuple on failure, export DocxErrorDiagnostic and DocxWarningDiagnostic from platejs/docx/export, add impact to lossy-content and resource-omitted DOCX diagnostics, and classify unwrapped script-capable links and alt- or caption-preserving script-URL images as impact: 'lossless' on DOCX export

    Migration:

    • Strict editor.api.html.parse(...) and importDocx(...) callers (lossPolicy: 'reject', the default) that parse HTML or Word lists containing unsupported leading headings, code blocks, blockquotes, or un-listable blocks now receive ok: false with html-unsupported-content; pass { lossPolicy: 'allow' } when lossy fallback is desired.
    • DocxExportResult now narrows ok: true to readonly DocxWarningDiagnostic[] and ok: false to readonly [DocxErrorDiagnostic, ...DocxDiagnostic[]], and lossy-content and resource-omitted DOCX diagnostics now require impact.
  • 2647b18 by @zbeyens –

    • Remove skipInitialization, shouldNormalizeEditor, useCreateEditor({ enabled }), and unused PLUGINS.navigationFeedback. Omit initialValue for default or min: 0 empty-root initialization, call editor.update.value.repair() after creation when repair is needed, and conditionally mount the component that calls useCreateEditor.
    • Unify CreateEditorOptions defaults and maker overloads across platejs and platejs/react, fixing headless initialValue callback typing and lifecycleErrorSink typing. Conditional plugin tuples (such as flag ? [Plugin] : [] or [flag ? A : B]) and statically disabled plugins (Plugin.configure({ enabled: false })) no longer expose absent plugin entries on typed editor.api, editor.read, or editor.update.
  • f8484dc by @zbeyens –

    • Collapse BaseLinkPlugin updates to upsert and unwrap, removing insert, wrap, upsertText, and exitEnd, plus rangeBeforeOptions, 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 target on link.upsert unless explicitly passed, and preserve live selection when at is passed
    • Strip leading wrappers and trailing sentence punctuation in typed autolinks, recognize www. domains in defaultParseUrl, and fix balanced parentheses, UTF-16 emoji offsets, formatted labels, and inline-void safety in LinkRules.markdown
    • Fix multi-block URL paste when keepSelectedTextOnPaste is false and align Markdown bare-URL detection across link and table serialization

    Migration: Replace editor.update.link.insert(...), editor.update.link.wrap(...), and editor.update.link.upsertText(...) with editor.update.link.upsert(...) (pass at directly instead of insertNodesOptions.at, and pass target: null or target: undefined to unset target). Remove rangeBeforeOptions from LinkPlugin.configure({ initialState }), and use inferred types or LinkElement instead of the removed type aliases.

  • e7c50c9 by @zbeyens – Export linkUrlValidation for stored navigation URL schema properties and strip floor-refused optional url values during v53-to-v54 migrations.

  • 3bc1dd7 by @zbeyens –

    • Remove the legacy scope string option from useElementSelector and throw when called outside a matching ElementProvider (pass a plugin descriptor as the first argument to scope to an ancestor element).
    • Add explicit editor, field-key, and { equalityFn } support to useViewStore, matching usePluginStore, and stop explicit-editor usePluginStore and useViewStore calls from subscribing to editor context changes.
    • Remove zustand from platejs runtime dependencies.
  • 382339f by @zbeyens –

    • Fix usePlateModelRevision to subscribe only to $configuration publication commits instead of every editor commit, preventing unnecessary re-renders during typing, selection, focus, and blur.
    • Fix useRootEditor to resolve under EditorController and EditorProvider while preserving editing-area lock isolation inside EditorContent.
    • Fix EditorProvider useEditorContainerRef and useEditableRef to read live mounted refs, stabilize EditorContainer container ref attachment across active view switches, and fix EditorContentView nested lock detection and scrollSelectionIntoView handler freshness.
  • 518dcba by @zbeyens – Unify list and block indentation under BaseIndentPlugin.update.increase/decrease with flat IndentChangeOptions (at, match, mode) and boolean return values, and remove BaseListPlugin.update.outdent and OutdentListOptions. Add BaseListPlugin.update.set for idempotent list kind, style (null resets), and task checked updates, narrow toggle to { type, at? }, and return boolean from clear. Convert ListType and ListStyle to type-only unions, rename BaseListDefinition to ListDefinition, export ListLevel/ListLevels, and remove isOrderedList and BULLETED_LIST_STYLES. Add Mod+Enter task toggling and create unchecked tasks on Enter at the end of a checked task.

  • 86110b8 by @zbeyens – Replace AIChatPlugin, useAIChat, AIChatRequestContext, and findQuotedSpan with a zero-AI-SDK platejs/ai core (getEditorTools, createEditorAgent, registerEditorTools, createAIDraftSession, AIPlugin, useEditorAgent, useWebMCP) and remove ai, @ai-sdk/react, and fastest-levenshtein peer dependencies from platejs.

    • Add framework-agnostic document tools (editor_read, editor_find, editor_suggest_edit, editor_list_suggestions, editor_withdraw_suggestion, opt-in editor_list_comments and editor_comment, and opt-in editor_debug_inspect) backed by writePolicy: 'propose-only', required recursive visibility filtering, default-deny remote media guards, and revision checks.
    • Add registerEditorTools and useWebMCP to expose multiplexed WebMCP tools per (modelContext, prefix) with allow gating, origin-grant matching, and abort teardown.
    • Add createAIDraftSession and AIPlugin (PLUGINS.ai) for detached streaming generation, provisional selection rewrites that land one minimal-diff suggestion on finish or stop, <Locked> placeholder rewrites via editor.api.markdown.parsePlaceholders, pinned table-cell rewrites, and cross-block comment range matching without fastest-levenshtein.
    • Require filter on serializeAIEditContext and serializeAISelectionMarkdown, and pass projection: 'proposed' conditionally when AuthoredPlugin is installed.
    • Retarget CopilotPlugin suppression to AIPlugin store state (status === 'streaming', status === 'reviewing', or open).

    Migration: Replace AIChatPlugin and useAIChat with AIPlugin, createEditorAgent, and your own AI SDK useChat transport, remove ai / @ai-sdk/react / fastest-levenshtein peer expectations on platejs, and pass filter to serializeAIEditContext and serializeAISelectionMarkdown:

    import { AIPlugin, useEditorAgent, useWebMCP } from 'platejs/ai/react';
    
    const plugins = [AIPlugin];
  • 8ae1716 by @zbeyens –

    • Remove ElementStatePlugin, ElementStateApi, ElementStateDefinition, PLUGINS.elementState, AffinityPluginUpdate, AffinityEdgeNodes, editor.update.affinity.setSelection, DomPluginState['clipboardFormatKey'], DebugPluginState['isProduction'], stale v1 DebugErrorType tags, AnyObject, createHotkey, and six unused root helper/type exports (isPluginNodeClass, isPluginElementClass, WithRequiredName, PluginOwnUpdate, InferPluginReadGroups, InferPluginUpdateGroups)
    • Move isNominalPluginDescriptor from platejs and platejs/react to platejs/compiler
    • Remove process.env.NODE_ENV checks from DebugPlugin, defaulting logLevel to 'error' (dropping api.debug.warn, info, and log calls in development unless logLevel is raised) and throwErrors to true across all runtimes
    • Refuse disabling required core plugins (debug, html, override, inputRules) at createEditor time, 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 expecting history now reject history-disabled concrete editors, while renderStaticHtml accepts any EditorReference
    • Project default element updates method-by-method under application schema policies (remove and set stay available across policies, insert and upsert stay available under root-only schemas, and toggle stays omitted)
    • Tighten widened tx.plugin(string) to return unknown, restore boolean return types on editor.update.nodes.unwrap and wrap, specialize React plugin portal APIs, and narrow .configure({ enabled: true })
    • Reject unknown fields and array inputs with a TypeError in definePlugin, .extend(), .configure(), and toReactPlugin(), and refresh derived toggle eligibility across live Plite schema swaps
  • 273b78e by @zbeyens – Replace platejs/suggestion and platejs/suggestion/react with platejs/authored (AuthoredPlugin, suggestionColorOf, AUTHORED_COLOR_COUNT) and platejs/authored/react (AuthoredReactPlugin, useAuthoredGroups, useActiveAuthored), remove PLUGINS.suggestion and useSuggestionChanges, add useCommentThreadIndex to platejs/comments/react, remove users and CommentUser from BaseCommentsPlugin, replace subscribePending, subscribeVisibleThreadIds, and subscribeDraftThreadIds with subscribeSnapshot, and scope comment activeIds per presentation via api.activeIds(), api.setActive(), and api.subscribeActive().

    Migration: Import AuthoredPlugin from platejs/authored and AuthoredReactPlugin, useAuthoredGroups, and useActiveAuthored from platejs/authored/react. Move comment author profiles into a React context (such as copied UserDirectoryProvider), replace subscribePending/subscribeVisibleThreadIds/subscribeDraftThreadIds with api.subscribeSnapshot, and replace store.get('activeIds') with api.activeIds() and api.subscribeActive() (call api.setActive() on the mounted editor view rather than an unmounted model editor handle).

  • 8c3001b by @zbeyens – Expose data-editor-authored-url-before, data-editor-authored-url-after, and title attributes on authored link URL edits.

  • e016be1 by @zbeyens –

    • Remove unused BoardDefinition type export from platejs/board; use typeof BaseBoardPlugin or DefinitionOf<typeof BaseBoardPlugin>.
    • Make BoardShape resize 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: Custom BoardShape consumers should style [data-board-handle] in CSS (for example [&_[data-board-handle]]:border [&_[data-board-handle]]:border-ring [&_[data-board-handle]]:bg-background).
    • Respect BaseLockPlugin locks 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.override for boardFrame and boardArrow (including swapped element type names) and export custom defineBoardShape text on text/markdown clipboard copy without conflicting with explicit shape Markdown encoders.
  • b95a34e by @zbeyens – Fix board keyboard shortcuts and clipboard inside open shadow roots, under Caps Lock and non-Latin keyboard layouts, on Mod+A from a focused board with no shapes selected, and on extreme coordinates in copy placement and fit

  • 049c432 by @zbeyens – Disallow formatting marks inside codeBlock elements via contentMarks: false while keeping review metadata (authored) allowed, extend CodeBlockRules.markdown with on: 'space' and language-capturing 'space'/'break' fences plus normalizeLanguage, align cross-block HTML/slice paste on the landing start block, check lowlight.registered(language) on highlight errors, strip disallowed formatting marks from single-text code blocks in migratePlateV54CodeBlocks, and remove BaseCodeBlockPlugin's read.entry, read.indentDepth, read.isEmpty, and update.resetBlock.

    Migration:

    • Replace editor.plugin(CodeBlockPlugin).read.entry() with editor.read.nodes.above({ type: CodeBlockPlugin }).
    • Replace read.isEmpty() with !NodeApi.string(block) on the containing code block.
    • Replace update.resetBlock() with if (editor.read.nodes.block({ type: CodeBlockPlugin })) editor.plugin(CodeBlockPlugin).update.toggle().
    • Apps that persisted unreleased v54 beta envelopes or Yjs rooms with the pre-cut code-block schema fingerprint must strip formatting marks from codeBlock leaves or migrate from the prior beta fingerprint before reopening.
  • 11b3a12 by @felixfeng33 – Allow code block text edits, indentation, language changes, and structural conversions to record as proposals in Suggesting mode. BaseCodeBlockPlugin now uses schema.content.text({ default: 'text', min: 1 }) without max: 1 and removes its authoredVeto, while plain code blocks still canonicalize to a single text leaf and BaseCodeHighlightPlugin splits syntax decorations across multi-leaf code blocks.

  • 69a42cb by @zbeyens –

    • Remove the ExternalTextDispatchResult re-export from platejs/react and remove duplicate local rollback from createCodeMirrorAdapter.
    • Preserve decorations across canonical CodeMirror resets and accept typing after unlocking a read-only code block whose composition ended without compositionend.
    • Add slots.externalText support to EditorStatic (RenderElementSlots and PlateStatic) so components using slots.externalText render cleanly in static output.
    • Implement ExternalTextView.scrollIntoView on createCodeMirrorAdapter so FindBar and api.dom.scrollIntoView reveal matches inside scrollable and tall CodeMirror blocks below sticky headers.
    • Fix EditorView.lineWrapping vertical boundary navigation and pure-DOM wrapped visual-row column entry (with wrap-point assoc) in createCodeMirrorAdapter.
    • Cache CSSOM decoration style serialization by object identity in a WeakMap and center wrapped or tall range targets inside .cm-scroller's visible box during scrollIntoView.
  • c847832 by @zbeyens – Rename platejs/layout and platejs/layout/react to platejs/column and platejs/column/react, replace string percentage column.width with positive finite numeric flex weights (default 1, omitted at default), add resizeColumns, unwrap, removeColumn, insertColumn, empty-column Backspace, symmetric HTML codecs, subtree/paste non-nesting, DOCX sibling percentage normalization, and v54 migration support

  • 97deee1 by @zbeyens –

    • Remove editor.anchor.save, editor.anchor.restore, and EditorDocumentRange re-exports from platejs and platejs/react
    • Rebase comments.creation history redo across history-skip edits and read stored comment anchor coordinates explicitly independent of Authored preview mode
  • 12abcd6 by @zbeyens – Upgrade platejs/comments and platejs/comments/react to quote-verified CommentAnchor persistence and incremental versioned remote sync:

    • Replace CommentRanges, api.ranges(), api.subscribeRanges(), api.replace(), and SavedComments.ranges with CommentAnchors (CommentAnchor with block IDs, quote context, and document revision), api.anchors(), api.encodeAnchor(), api.subscribeAnchors(), api.applyRemote({ upserts, deletes }) with monotonic versions, tombstones, mutationId echo reconciliation, and unresolved anchor hydration.
    • Remove createDraft, discardDraft, publishDraft, draftThreadIds, and CommentThread.status; add signal?: AbortSignal, history?: 'record' | 'skip', withHistory, and { type: 'element' } targets to createThread, add { status: 'aborted' } to CommentMutationResult, pass actorId, anchor, and signal in CommentMutationRequest, and allow begin() on read-only and preview views.
    • Add incarnation and members to change targets, elementId and quote to attached range attachments, and resolveCommentChangeTarget to platejs/comments/react.
    • Update migrateDocument in platejs/migrations to accept anchors or legacy ranges, mint permanent element IDs, and return anchors, and fix DOCX import comment range remapping across inline links and coalesced text.

    Migration: Save api.anchors() instead of api.ranges() and pass initialComments: { anchors, threads }. Replace subscribeRanges with subscribeAnchors, replace() with applyRemote({ upserts, deletes }), and createDraft/publishDraft/discardDraft with abortable createThread({ ..., signal }). Update mutate handlers to read request.anchor and request.actorId, and update migrateDocument callers to read result.anchors.

  • 84e1614 by @zbeyens –

    • Move readEditorSchemaContract, diffEditorSchemaContracts, and the EditorSchemaContract* types from platejs and platejs/react onto platejs/compiler.
    • Remove restoreEditorSchemaContract, compileEditorSchemaContract, GeneratedEditorTypeProvider, and EditorCompilation.bindings[].authoredToggle.
    • Extend EditorPropertyTypes<TPlugins, TSchema = undefined> with an optional TSchema parameter that projects application schema.properties types, and widen SchemaElementSupportsToggle to accept text-allowing content expressions and schemaContribution.
  • b94933c by @zbeyens – Rewrite CopilotPlugin for streaming inline Markdown completions, parsed-node word acceptance, mark-aware type-ahead, filtered FIM context, and abort-on-accept.

    • Store parsed inline suggestionNodes via tx.setField (history: 'skip'), streaming through editor.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 acceptNextWord with 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: EditorVisibilityFilter and build bounded <prefix>/<suffix> FIM context skipping hidden blocks, locked blocks, and code blocks; remove unused CopilotPlugin.update.setSuggestion.
    • Abort in-flight completion requests on full accept as well as dismiss, cursor movement, readonly transitions, and view unmount.
  • 73276ef by @zbeyens –

    • Compile Plate documents directly to OOXML in exportDocx via plugin formats.docx mappings without React static HTML rendering or a browser DOM, removing the html-entities dependency and the color-name, html-to-vdom, juice, mime-types, virtual-dom, and xmlbuilder2 optional peer dependencies, and loading katex lazily only when exporting equations
    • Replace mammoth and browser DOMParser usage in importDocx with a direct OPC/WordprocessingML reader that runs on the server without DOM globals, removing the mammoth optional peer dependency and converter-message from DocxDiagnostic
    • Extend formats.docx mappings (DocxNodeMapping) with symmetric { encode, decode } for element, mark, and element-property plugins, opaque encodeBlocks/encodeInlines fragments, and contentRoot(slot) for named-root export
    • Round-trip Word footnotes through word/footnotes.xml when footnote plugins are installed
    • Replace DocxExportOptions.{component,presentation,stylesheet} with optional typed styles?: DocxExportStyles (DocxExportStyles, DocxParagraphStyle, DocxRunStyle), remove missing-static-presentation from DocxDiagnostic, and omit linkTarget custom 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 lossy unsupported-content, unwrap w:customXml while 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, and component options on exportDocx(...) with optional typed styles: DOCX_EXPORT_STYLES (or omit styles for neutral Word defaults).
    • Custom element and mark plugins exported or imported through exportDocx(...) and importDocx(...) now declare formats.docx ({ encode }, { decode }, or { dropped }) instead of relying on static React components or HTML intermediaries; unmapped elements and marks emit unsupported-content (impact: 'lossy').
    • Remove color-name, html-to-vdom, juice, mammoth, mime-types, virtual-dom, and xmlbuilder2 from app dependencies if they were only installed for platejs/docx/export or platejs/docx/import.
    • Remove any switch branch handling diagnostic.code === 'converter-message' or diagnostic.code === 'missing-static-presentation'.
  • 8c37372 by @zbeyens – Remove DataTransferFormatPhase from platejs/dom and narrow DomPluginUpdate to AutoScrollPluginUpdate.

  • 7ae7805 by @zbeyens –

    • Remove DOMResolutionError from platejs/dom and adopt the single nullable editor.api.dom lookup contract (resolve* and resolveWindow(): Window | null).

    Migration: Replace editor.api.dom.assert* with nullable editor.api.dom.resolve*, replace editor.api.dom.getWindow() with editor.api.dom.resolveWindow(), and replace editor.api.dom.findKey(node) / resolvePath(node) / isReadOnly() with editor.key(node), editor.read.nodes.path(node), and editor.api.react.isReadOnly().

  • bfd708c by @zbeyens –

    • Re-export ScrollMargin from platejs/dom alongside ScrollIntoViewOptions.scrollMargin
  • 0de8480 by @zbeyens –

    • Remove ExitBreakPlugin and PLUGINS.exitBreak; bind read-only-safe tx.break.exit directly in ExitBreakKit.
    • Consult shouldMergeNodesRemovePrevNode for empty-block Backspace merges, guard unselectable block voids with state.nodes.isSelectable and facing-edge structural sibling lookups, and fix cross-block break.splitReset while preserving required title joins in one Backspace.
  • 18ff3ad by @zbeyens – Fix EditorRoot commit observers for named roots, frozen document views, and lazy callbacks

    • Deliver root-scoped onSelectionChange on named-root EditorRoot views
    • Skip live owner commit callbacks on frozen document views and avoid replaying prior commits when attaching callbacks after mount
  • 9e41cf5 by @zbeyens – Deliver updated elements synchronously from ElementProvider to useElement consumers without a one-frame stale render, while preserving nested-provider isolation and commit-only store updates for useElementSelector.

  • ba572f2 by @zbeyens – Fix BaseFindPlugin cross-root replacement targeting, composed same-transaction replace advancement, rolled-back replace cleanup, identical-text no-op skipping, whole-word lookaround boundaries, and drifted store scalar self-healing.

  • 5999853 by @zbeyens –

    • Add FindOptions (caseSensitive, wholeWord, regexp) to BaseFindPlugin's api.search(query, options?)
    • Add update.replace(replacement) and single-undo update.replaceAll(replacement) on BaseFindPlugin, skipping locked, void, and non-content ranges
    • Replace FindPluginState.matches and direct store.set({ activeIndex }) writes with read-only selectors (count, activeMatch), api.matches(options?), api.matchAt(point), api.setActiveIndex(index), and scalar version

    Migration: Read matches via find.api.matches() (or find.store.get('activeMatch') / find.store.get('count')) and change the active match with find.api.setActiveIndex(index) or find.api.move(delta).

  • 1cfe8ca by @zbeyens –

    • Accept a single map or a non-empty tuple of defineFormats(...) calls (PluginFormatMapInput) on formats in plugin constructors and .extend(), evaluate callback formats in .extend(), and remove formats: null from plugin types.
    • Support priority-ordered Markdown element encoders, mark decoders, and mark wrap writers (priority?: number) with undefined decline fallthrough, operation-scoped leaf wrapping, and equal-priority conflict errors for duplicate element encoders and cross-owner overlapping mark writers.
    • Compose element plainText encoders with multi-property element-property wrappers so BaseListPlugin preserves list markers on headings, blockquotes, code blocks, and other configured targets.
    • Add DocxNodeMappingInput tuples 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, and PluginForeignHtmlMappingMap.
  • f41097b by @zbeyens –

    • Re-export the trimmed platejs/history surface (Batch, History, HistoryJSON, HistoryStateApi, HistoryTxApi) with tx.history.isolate(), history: 'isolate', and History.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
  • 2d8fe82 by @zbeyens –

    • Prefix all Plate-serialized HTML data attributes with data-editor-html- and report any unclaimed data-editor-html-* attribute during HTML parsing.
    • Overload HtmlDecodeContext.preserve to accept a descendant Element target (preserve(element, ...attributes)), scoping attribute claims to each claimed element instead of inheriting across descendants.
    • Add unwrap to HtmlElementPropertyCreateRule so createsElement rules control which sibling properties survive unwrapping a non-text leading block.
    • Add HTML serialization and parsing rules for BaseCalloutPlugin, BaseDatePlugin, BaseFilePlugin, and BaseTocPlugin.
    • Re-export serializeHtml, HtmlSerializeOptions, and HtmlSerializeResult from platejs/html/server.
  • a82e1da by @zbeyens –

    • Bound prepared text/html clipboard payloads exceeding 5 MiB by raw transfer bytes in decodeHtmlDataTransfer while keeping parser node and depth limits on the prepared HTML
    • Add impact ('lossless' | 'lossy') to html-parser-recovery, html-unsupported-metadata, html-unsupported-root, markdown-tag-repair, markdown-property-omitted, markdown-unsupported-metadata, and markdown-unsupported-root diagnostics
    • Include model.property on HTML continuation property omissions and report that property name in importDocx property-dropped diagnostics
  • 14fbdbf by @zbeyens – Unify BaseIndentPlugin update options and remove BaseTextIndentPlugin.

    • Flatten IndentChangeOptions on BaseIndentPlugin.update.increase and decrease, and add list-family-safe set and clear commands.
    • Require positive safe integer indent values (validationVersion: 2), clamp or unset indentMax safely, compose caller match with targetPlugins, and skip locked blocks in indent, line-height, and alignment updates.
    • Remove BaseTextIndentPlugin, TextIndentPlugin, PLUGINS.textIndent, data-text-indent, and Word paste textIndent emission, stripping legacy indent: 0 and undeclared textIndent during v54 migration.
  • 8f9b467 by @zbeyens –

    • Extend inputRuleVeto to a discriminated union ({ element: string } | { mark: string }), contribute { mark: context.schema.key } from BaseCodePlugin, 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 InputRulesPlugin immediate Backspace revert to the exact committed transaction, view, and root, fixing named-root revert misses, cross-view Backspace corruption, and multi-edit editor.update batch corruption.
    • Accept NBSP (\u00A0) alongside ASCII space on all space-triggered block shorthand rules (HeadingRules, BlockquoteRules, HorizontalRuleRules, CodeBlockRules, and list rules).
    • Fix matchDelimitedInline across multi-leaf text spans and requireClosingDelimiter: 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, and TrailingBlockPluginState.level; require a PluginReference descriptor for TrailingBlockPluginState.type (default BaseParagraphPlugin).

    Migration:

    • Update inputRuleVeto.of(context.schema.type) to inputRuleVeto.of({ element: context.schema.type }) (or { mark: context.schema.key } for literal marks).
    • Replace createBlockStartInputRule(...) with defineInputRule(...) + matchBlockStart(...), and context.getBlockTextBeforeSelection() with context.getBlockStartText() ?? ''.
    • Replace TrailingBlockPlugin.configure({ initialState: { type: 'paragraph' } }) with TrailingBlockPlugin.configure({ initialState: { type: BaseParagraphPlugin } }) (or omit type to use the default).
  • d6215c2 by @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, and MarkdownEditor. Use decode, encodeFlow, PluginFormatRegistry, and editor.plugin(MarkdownPlugin).api instead.
    • 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 (&#xD;), split CRLF across link boundaries, double <br/> between table-cell media blocks, literal U+200B-only paragraphs, leading BOM diagnostic offsets, CR-only block tags, remarkStringifyOptions preserving plugin join/unsafe settings, <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 under remark-cjk-friendly; pass remarkStringifyOptions: { emphasis: '_' } to keep underscores.
  • f38fe35 by @zbeyens – Replace stateless partial and previous streaming options on editor.api.markdown.parse* with stateful editor.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, revisioned MarkdownStreamDelta patches, and strict finish() parity with parseSlice / parseInline.

    Migration:

    • Replace parseSlice(accumulated, { lossPolicy: 'allow', partial: true, previous }) with const stream = editor.api.markdown.stream() followed by stream.append(chunk) (or stream.set(accumulated)) and stream.finish().
    • Remove partial from parse, parseSlice, and parseInline option objects, and remove previous from parseSlice option objects.
  • 23c21ba by @zbeyens –

    • Remove SchemaElementShapeFor, BaseElement, BaseNode, BaseText, BasePoint, and BaseRange re-exports; use SchemaElementFor, Element, Node, Text, Point, and Range instead.
    • Export SchemaPropertySource, SchemaPropertyDescriptorMap, EditorRuntimeCarrier, and EditorRuntimeOwnerOf.
    • Add an optional second contributor type parameter to EditorElementProps<TPlugin, TContributors> in platejs/react and platejs/static.
  • 8bcb16c by @zbeyens –

    • Re-export PersistedDocument, PersistedSelection, and editor.read.persisted(options?) from platejs, move SerializedEditorSelection to platejs/history, replace EditorValueInput with InitialValue, and remove readEditorSelection and PlateV54Migration.
    • Treat source in migrateDocument as 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 listId assignment into migrateV54 and remove the standalone migrateListIdentity export from platejs/migrations.
  • 29bcbd6 by @zbeyens – Rename the definePluginSlot re-export to definePluginCompartment.

    Migration: Replace definePluginSlot imports from platejs with definePluginCompartment.

  • bf9b87c by @zbeyens – Remove useContentRoot, ContentRootController, and UseContentRootOptions from platejs/react

    Migration: Use slots.contentRoot, useChildRoot, and useRootChrome for element-owned child roots.

  • 3c20b81 by @zbeyens – Consolidate Plate React read hooks and selection reads:

    • Add editor.read.selection.value() and remove readEditorSelection
    • Merge useEditorPluginStore into usePluginStore(editor, plugin, ...)
    • Remove useElementPath, useEditorId, useEditorMounted, useEditorHasSelection, useEditorValue, useEditorSelection, and createZustandStore from platejs/react

    Migration: Replace readEditorSelection(editor) with editor.read.selection.value(), useEditorPluginStore(editor, ...) with usePluginStore(editor, ...), useElementPath() with usePath(), useEditorId() with useEditor().id, useEditorMounted() with useEditorRootElement(useEditor()) !== null, useEditorHasSelection() with useEditorSelector((editor) => editor.read.selection() !== null, { dependsOn: 'selection' }), useEditorSelection() with useEditorSelector((editor) => editor.read.selection(), { dependsOn: ['selection', 'document'] }), and useEditorValue() with useEditorSelector((editor) => editor.read.children(), { dependsOn: 'document', equalityFn: Object.is }).

  • 3c2d532 by @zbeyens – Remove platejs/yjs (BaseYjsPlugin, YjsPlugin, KEYS.yjs) and its Yjs/Hocuspocus dependencies; migrate collaboration setups to platejs/sync, platejs/sync/react, platejs/sync/server, and platejs/sync/cloudflare

  • b68c1f4 by @zbeyens –

    • Remove the re-exported SelectionValue, SpanApi, SpanInterface, and EditorSelectionTargetOptions aliases from platejs to match plitejs (use EditorSelection and LocationApi.isSpan).
    • Guard NodeSelection pointer capture and post-drag finishFrame focus restoration against synthetic/released pointers, disconnected editables, and focus drift.
  • 21b6496 by @zbeyens – Align Plate root exports and useStateFieldValue with single-store shared state fields, 'configuration' commits, and StateFieldDescriptor cuts

    • Share default useStateFieldValue equality for cloned non-JSON field values (Date, Map, Set, Uint8Array) while preserving custom field.compare
    • Re-export LocalStateFieldDescriptor and SharedStateFieldDescriptor, remove invertEffect, mapEffect, encodeEditorEffect, and decodeEditorEffect from platejs, and retire field.effect on collab: 'shared' fields

    Migration:

    • Replace commit.dirtyStateKeys.includes('$configuration') with commit.changed.hasAny('configuration'), and add 'configuration' to dependsOn or commit.changed.hasAny(...) checks that relied on 'state' waking on plugin reconfiguration.
    • Replace editor.read.meta() with editor.read.value().meta or editor.read.getField(field).
    • Update shared fields via tx.setField(field, value) instead of tx.effects.emit(field.effect, ...), and serialize collaborative changes with commit.changes.toJSON() instead of encodeEditorEffect / decodeEditorEffect.
  • 5b6b606 by @zbeyens – Isolate static rendering from editing-only plugin behavior and fix static equation round-tripping:

    • Add decorate.static?: boolean (default true) on plugin definitions and set static: false on BaseFindPlugin, BaseLintPlugin, YjsPlugin, and SyncReactPlugin so editing overlays never render in <EditorStatic> or renderStaticHtml.
    • Filter static decoration sources by plugin name when renderStaticHtml receives presentation.
    • Suppress editOnly components, render.attributes, inject.nodeProps, leafAttributes, textAttributes, and wrapper slots across all static renders, with or without presentation.
    • Support unbound component-object afterNodeChildren slots (such as React.memo) in <EditorStatic>.
    • Preserve attributes.ref (composing with ref when both exist) and make path optional on EditorElement from platejs/static.
    • Keep surrounding spaces when parseHtml collapses whitespace around static zero-width \uFEFF placeholders inside data-editor-string elements.
  • ef419a0 by @zbeyens – Add createSyncServerAgent to platejs/ai and re-export SyncServerRunResult from platejs/sync/server for 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.

  • 36056dc by @zbeyens –

    • Unify table column and row sizing onto flat logical update.resize, api.createResize, and TableResizeHandle, and remove update.setColumnWidth, update.setRowHeight, TableColumnWidthOptions, TableRowHeightOptions, edge: 'left', TableDefinition, describeTableSuggestion, and describeTableSuggestionGroup from platejs/table.
    • Add update.select, update.moveColumn, and read.canMoveColumn on BaseTablePlugin for programmatic canonical cell selection and atomic column reordering.
    • Remove clampTableSelection so programmatic selection and pointer drags keep exact cross-edge ranges, resolve explicit table targets directly in update.remove for nested tables, negate RTL column resize deltas in useTableResize, localize RTL cell arrow navigation, collapse Safari IME composition without cancelling which === 229, and land Shift+Tab at the end of the previous cell.
  • 16215df by @zbeyens –

    • Add headless table symmetry commands (read.canMoveRow, read.header, update.moveRow, update.toggleHeader, update.clearCells, update.duplicateRow, update.duplicateColumn, update.distributeColumns), rename TableMoveColumnOptions to TableAxisMoveOptions, export named table option types, preserve custom border color/style in toggleBorders, and inherit per-column header flags on insertRow.
    • 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-cell Tab, 3-stage Cmd+A, and DOM-rect horizontal-X vertical exit).
    • Export UI-neutral useTableControls from platejs/table/react for table edge hit-testing, touch/keyboard resizing, NodeKey-anchored column drag, and single-transaction + extend bars.
  • b92cb81 by @zbeyens –

    • Preserve the calling view on ctx.update.* plugin portals, reject root-transaction fallbacks when a plugin defines no update group, and reflect R | undefined refusal return types.
    • Exclude txOnly methods and txOnly update groups from plugin shortcuts at both compile time and runtime.
  • ac8c7cb by @zbeyens –

    • Add typed editor.update.result(policy?, fn) overloads on Plate editors with full plugin transaction inference.
    • Export isAuthoredRefusal from platejs/authored, isLockRefusal and LockRefusal from platejs/lock, and EditorJsonObject from platejs.
  • 164c49d by @zbeyens – Key UploadRules by UploadKind with standard HTML accept patterns, replace client + getUrl with a single SDK-neutral upload handler, add key-local update.retry(key) and api.accept(kind), and fix post-completion caption undo and secondary-root pasted picture uploads.

    Migration:

    • Key rules by 'audio' | 'file' | 'image' | 'video' with optional accept?: readonly string[], maxBytes, and maxFiles (removing UPLOAD_FILE_TYPES, UploadFileType, UploadRule.kind, UploadRule.minFiles, too-few-files, and allowedTypes).
    • Replace client and getUrl with upload: (file, { onProgress, signal }) => Promise<string> (removing UploadClient, missing-client, missing-url-resolver, resolver-error, UploadFailure.result, and files-sdk from platejs optional peer dependencies). invalid-url and completion-error now carry url, and missing-upload replaces missing-client.
  • 1cf5f56 by @zbeyens – Remove DOMGeometryRect from platejs/dom and export ViewportRect for editor.api.dom.visibleRect.

    Migration: Replace DOMGeometryRect imports from platejs/dom with ViewportRect.

  • 4e2c7f5 by @zbeyens –

    • Add fingerprint-neutral slice: { plainText?: boolean } on block text element schemas, flattening semantic pastes at the top of planPaste (dropping slice.roots) and skipping rich clipboard formats only when text/plain differs from text/html.
    • Make external drops atomic on refused, no-op, and non-writable targets, and fix eventCarriesBlockFragment to unwrap shared open block ancestors before checking for block payloads.
    • Replace BaseCodeBlockPlugin's three paste-flattening hooks with slice: { plainText: true } and guard InputRulesPlugin insertData rules against exact Plite clipboard slices.

plitejs

Minor Changes

  • 6d42192 by @zbeyens – Move editor.api.dom.resolveDropTarget to editor.api.dom.drag.resolveTarget, add lossless anchor-preserving editor.api.dom.clipboard.cut, fold DOMEditorClipboardCapability into DOMClipboardApi, strip embeds from handle drag previews, populate DataTransfer for read-only drags, scale paddingSide on zoomed roots, and guard drag scroll repaints by session and owner.

  • 4e2c7f5 by @zbeyens –

    • Add fingerprint-neutral slice: { plainText?: boolean } on block text element schemas, flattening semantic pastes at the top of planPaste (dropping slice.roots) and skipping rich clipboard formats only when text/plain differs from text/html.
    • Make external drops atomic on refused, no-op, and non-writable targets, and fix eventCarriesBlockFragment to unwrap shared open block ancestors before checking for block payloads.
    • Replace BaseCodeBlockPlugin's three paste-flattening hooks with slice: { plainText: true } and guard InputRulesPlugin insertData rules against exact Plite clipboard slices.
  • ea41af5 by @zbeyens – Add { intent?: TransferIntent } to editor.read.transfer.check, refuse non-writable text transfer sources and targets before commit, and verify owned content-root integrity on range transfers.

Patch Changes

  • 4d4154c by @zbeyens – Replace <PagedEditorContent />, Pretext off-DOM layout engines (measurePages, createPretextPageLayoutEngine, createEstimatedPageLayoutEngine, usePageLayoutFragments), live 2-up spread mode, and the @chenglou/pretext peer dependency with a zero-remount native-DOM PaginationSurface wrapper, usePageLayout(editableRef), and useTableRowPageBreak(element) over standard <EditorContent />.

  • ef4c7e5 by @zbeyens – Collapse RenderTextProps back to a single host type by removing RenderTextHostProps, RenderTextPieceProps, and piece, and delete legacy paged-projection, soft-line-end, view-line, and placed-drag internals from plitejs/dom and plitejs/react.

  • d6fc49f by @zbeyens –

    • Fix Android insertReplacementText over 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 beforeinput routing to redirect sibling-root selections to the target root editor and skip duplicate desktop insertText probing when no onDOMBeforeInput handler is attached.
    • Fix Android line rebuild resolution for nested blocks and inline elements so rebuildLine remounts the lowest enclosing block(s).
  • 15809ad by @zbeyens –

    • Add replace option to tx.nodes.wrap to replace existing inline wrappers per block atomically without unwrapping refused blocks
    • Add editor.read.schema.canWrap to check whether an element can wrap or land at a target location
  • 2647b18 by @zbeyens – Stop narrowing createEditor and useCreateEditor document types from initialValue, remove EditorValueFromOptions and PluginsFromOptions from public root exports, and fix useCreateEditor inherited option handling

    Migration: Seeded editors without a schema plugin now infer broad Value (assignable to Editor). Pass an explicit value type parameter (createEditor<MyValue>() or createEditor<MyValue, typeof plugins>({ plugins, initialValue })) or install a schema plugin when you need a narrower document type.

  • cd3128c by @zbeyens – Avoid whole-block stringification on plain typing in subscribeTypedText and reject non-collapsed selection replacements in Suggesting mode

  • 97deee1 by @zbeyens –

    • Remove editor.anchor.save, editor.anchor.restore, and EditorDocumentRange (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 so anchor.resolve() matches anchor.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 DecorationSource refresh 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 when observe() only refreshes partially or throws synchronously
  • 273b78e by @zbeyens – Preserve authorId in <EditorRoot> and createPliteRootEditor, isolate <EditorStatic> foreign-document authored reads, move projectAuthoredRange to plitejs/internal, and move createAuthoredPlugin and AuthoredTestOptions to plitejs/testing.

  • 8c37372 by @zbeyens – Remove unused insertFragmentData, insertTextData, dom({ clipboard: false }), tx.dom.insertData, DOMClipboardInsertDataHandler, DataTransferFormatPhase, six internal plitejs/dom clipboard helpers, and five dead plitejs/internal slice exports.

  • 12abcd6 by @zbeyens – Add AuthoredChange.incarnations, authored.read.groupMembers(groupId), and optional incarnation filtering on authored.read.outcome(id, incarnation?), plus internal element-ID minting admission and authored projection helpers used by Plate comments, migrations, and DOCX import.

  • 4202bdd by @zbeyens –

    • Fix re-entrant commits delivering a later commit's snapshot to outer subscribeCommit and afterCommit listeners or rolling editor.read.lastCommit() backward.
    • Fix named-root selections leaking onto main-root snapshots built by selection-only commits or cold snapshot reads.
    • Type BaseEditor.subscribeCommit with EditorCommitListener<V> instead of EditorCommitListener<any>.
  • c276846 by @zbeyens –

    • Fix projectAuthoredDocument without { editor } keeping split paragraphs and links apart in the accepted projection
    • Fix proposeComparison blocking when plugin corrections append blocks or when a comparison merges table cells
  • 84e1614 by @zbeyens –

    • Move readEditorSchemaContract, diffEditorSchemaContracts, and the EditorSchemaContract* types off plitejs onto the new public headless subpath plitejs/compiler.
    • Remove restoreEditorSchemaContract, compileEditorSchemaContract, and unused compiler exports from plitejs and plitejs/internal.
    • Slim serialized EditorSchemaContract output to formatVersion: 2 by dropping restoration-only derived tables while keeping a formatVersion: 1 compatibility reader in readEditorSchemaContract.
    • Fix COMPILED_SCHEMA_CACHE so recordSets callbacks (namedBy.names, keep) are stripped on cache storage and rebound per editor, and include contentRoots[slot].structure in the compiled schema fingerprint (storageRevision: 4) and EditorSchemaDelta while keeping storageRevision: 3 contracts readable.
  • 36056dc by @zbeyens –

    • Fix cross-grid range deletion starting inside a read-only grid and ending inside a writable grid so writable grid cells are preserved cleanly.
  • d83d8a1 by @zbeyens – Harden editor.api.dom.clipboard.cut against locked owned roots, active reads/updates, authored preview, and focus/selection-only commits during await, and report a lossy diagnostic when all paste formats are refused.

  • aee2a86 by @zbeyens – Remove tx.fragment.replace and editor.update.fragment.replace in favor of slice.replace(ContentSlice.closed(...)), and expose slice on EditorCorrectionTransaction.

  • 7c83372 by @zbeyens – Remove 22 internal DOM marker, Android text-diff, hotkey compiler, and engine-detection helpers from public plitejs/dom, and fix DOMEditor.hasEditableTarget for interactive controls inside read-only and writable editors.

    Migration: Inspect data-editor-* DOM attributes directly when checking rendered DOM elements (or use NodeApi, ElementApi, and TextApi from plitejs when checking model nodes), use isHotkey from plitejs/dom instead of createCompiledHotkeyMatcher, and check event.detail === 3 instead of TRIPLE_CLICK.

  • d75f0fb by @zbeyens – Remove DocumentChange.transform, DocumentChange.prototype.correct, DocumentChange.primaryClassification, DocumentChange.rootClassifications, and the isSetValued option from DocumentChange.between.

  • 7ae7805 by @zbeyens –

    • Unify editor.api.dom on one nullable lookup contract by removing assertDOMNode, assertDOMPoint, assertDOMRange, assertDocumentOrShadowRoot, assertEventRange, assertNode, assertPath, assertPoint, assertRange, findKey, hasRange, isReadOnly, and resolvePath, and replacing getWindow() with resolveWindow(): Window | null.
    • Remove DOMResolutionError, Key, DOMCoverage, DOMCoverageSession, DOMCoverageBoundaryEdge, DOMCoveragePointResult, DOMCoverageMaterializeHandler, DOMCoverageMaterializeResult, isTrackedMutation, and getEditorDOMRoot from plitejs/dom.
    • Isolate editor.api.dom.resolveNode, resolvePoint, and resolveRange per owning view and enforce painted-text freshness on editor.api.dom.resolveRangeRect.

    Migration: Replace editor.api.dom.assert* with nullable editor.api.dom.resolve*, replace editor.api.dom.getWindow() with editor.api.dom.resolveWindow(), replace editor.api.dom.findKey(node) with editor.key(node), replace editor.api.dom.resolvePath(node) with editor.read.nodes.path(node), replace editor.api.dom.isReadOnly() with editor.api.react.isReadOnly() (or editor.read.view.isReadOnly() for document view policy without the <EditorContent readOnly /> prop), and replace detached DOMCoverage.create calls with slots.contentBoundary or slots.externalText passed to element renderers (RenderElementProps.slots).

  • 164c49d by @zbeyens – Allow DOMDropTargetOptions['files'] to accept a readonly array of EditorElement blocks so file drops can validate multi-kind drafts at drop time.

  • 0de8480 by @zbeyens –

    • Move slice deletion from tx.fragment.delete, editor.update.fragment, editorCommands.deleteFragment, EditorFragmentDeletionOptions, EditorTransactionFragmentApi, and DeleteFragmentCommand onto tx.slice.delete, editor.update.slice.delete, editorCommands.deleteSlice, EditorSliceDeletionOptions, and DeleteSliceCommand.
    • Support single-block NodeSelection in tx.break.exit and 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.*, NodeSelection deletion, and hanging slice replacements.
    • Unify whole-block landing between commands and raw tx.text.insert, tx.slice.delete, tx.break.insert, and tx.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: 2 forced-layout joins when a default remainder can build.
  • e490ae5 by @zbeyens – Add contentMarks?: boolean on SchemaElementInput (default true) so text-admitting elements can reject role: 'content' text properties (formatting marks) while keeping role: 'metadata' text properties (such as authored) legal across schema compilation, contract/fingerprint serialization, addMark, mixed-range toggleMark, getProperty, tracksPlaces, and AuthoredPlugin.

  • dca98ac by @zbeyens – Enforce root-only transfer admission for slice: { endMatter: true } elements across block drops, side wraps, and text-range point drops, and let plugins adjust colliding end-matter slices during paste landing.

  • 11b3a12 by @felixfeng33 – Allow slots.externalText on non-void text-only blocks whose schema declares min: 1 without requiring max: 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 native slots.children() rendering and remount externalText once back to one leaf.

  • 69a42cb by @zbeyens –

    • Remove ExternalTextDispatchResult; external-text dispatch, select, navigateOut, and deleteOut now return void and 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 refused deleteOut without moving focus.
    • Add ExternalTextOptions.fallback so slots.externalText falls 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.scrollIntoView and 'scrollIntoView' on EditorLifecycleError, and route DOMEditor.scrollIntoView for ranges, points, and paths targeting external-text views through internal reveal plus outer scrollMargin scrolling.
    • Replace whole-root external-text querySelectorAll preflight 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.
  • ba572f2 by @zbeyens – Fix Unicode case-folding in literal case-insensitive NodeApi.findTextRanges, keep two-axis registered scrollElement horizontal scrolling active with scrollMargin, and avoid marking failed or deferred decoration refreshes as fresh.

  • 5999853 by @zbeyens –

    • Split inline text runs around inline void elements in NodeApi.findTextRanges so matches cannot bridge inline voids
    • Fix case-insensitive literal match offsets in NodeApi.findTextRanges when text contains characters whose lowercase form changes UTF-16 length (such as 'İ')
  • 8c3001b by @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.

  • f41097b by @zbeyens –

    • Add history: 'isolate', tx.history.isolate(), and canonical tag 'history-isolate' for standalone undo steps that block both automatic and explicit merges, and keep history: 'new-batch' / tx.history.newBatch() open for compatible follow-up edits within newBatchDelay
    • Add History.fromJSON(editor, json, { value }) to validate saved history against a replacement document for atomic tx.value.replace + tx.history.restore, and report an explicit mismatch error when restored history does not match the committed document
    • Remove internal unsettle, rest, and carried fields from public Batch, cut CarriedRun, HistoryBatchJSON, HistoryControlTx, and SerializedEditorSelection re-exports from plitejs/history, and narrow HistoryJSON.undos/redos to readonly 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
  • 11a24eb by @zbeyens –

    • Prevent focus settling and selection guards from reclaiming focus from external iframes
  • 23c21ba by @zbeyens –

    • Remove SchemaElementShapeFor, BaseElement, BaseNode, BaseText, BasePoint, and BaseRange; use SchemaElementFor, Element, Node, Text, Point, and Range instead.
    • Add an optional second element-type parameter to ElementOf<N, TType> and export EditorRuntimeCarrier and EditorRuntimeOwnerOf<TEditor> so getEditorRuntimeOwner preserves editor types while stripping view-only root.
    • Enforce own-key document root lookups and reject Object.prototype root 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}, and tx.schema.canWrap, prevent prepared-key residue from discarded specs and rolled-back updates, and deduplicate repeated node references in standalone document views.
  • 8bcb16c by @zbeyens –

    • Add editor.read.persisted(options?) to read canonical { document, schema, selection? } envelopes across named roots, NodeSelection, authored preview lenses, and captured-document views.
    • Rename PersistedDocumentInput to PersistedDocument, export PersistedSelection, widen InitialValue<V> to accept PersistedDocument<V>, widen CreateEditorOptions.initialSelection to PersistedSelection, and accept PersistedDocument in createEditor({ initialValue }).
    • Remove readEditorSelection from plitejs (use editor.read.persisted({ selection: true }) to persist selections) and move SerializedEditorSelection to plitejs/history.
    • Unify envelope detection to require both document and schema without children, reject meta.__proto__ on persisted document ingress, normalize -0 in valueCodecs.number, and remove unused persistence exports from plitejs/internal.
  • 9e41cf5 by @zbeyens – Size the empty-block placeholder inside a dedicated [data-editor-placeholder-container] wrapper instead of writing an inline min-height style onto the editable host element, so CSS min-height classes work without !important.

  • 1cfe8ca by @zbeyens –

    • 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.
  • 8ae1716 by @zbeyens –

    • Reject unknown fields in definePlugin with a TypeError naming the unknown key
    • Preserve validated compiled schema identity through plugin publication so live compartment swaps match validated schema state
  • 29bcbd6 by @zbeyens – Rename definePluginSlot and PluginSlot* to definePluginCompartment and PluginCompartment*, remove PluginSlotLike, enforce nominal compartment identity and sound replaceable capability typing, enforce the 3-law migrate / 'history-skip' / Suggesting-mode contract, and tighten view plugin write authority and lifecycle re-entry guards.

    Migration: Replace definePluginSlot with definePluginCompartment, replace PluginSlot / PluginSlotValue with PluginCompartment / PluginCompartmentValue, remove PluginSlotLike, and read replaceable compartment plugin APIs through editor.plugin(MyPlugin) after checking installed.

    // 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();
    }
  • ac8c7cb by @zbeyens –

    • Add headless writePolicy: 'propose-only' view confinement on createEditorView, keeping writes in propose mode out of human undo history and refusing direct mutations, setView, decide, and React mounting.
    • Propagate setEditorReadOnly(editor, true) reactively to derived views and proposeComparison, and return { status: 'blocked' } from history.undo, history.redo, and history.record on read-only or propose-only views.
    • Add editor.update.result(policy?, fn) for structured committed | unchanged | refused outcomes without triggering UI refusal listeners, and export isAuthoredRefusal from plitejs/authored.
    • Add reload-stable editor.read.revision() and editor.read.nodes.revision(id) (tx.nodes.revision(id) inside updates), and restrict named-root nodes.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?: EditorJsonObject metadata (authored-meta) on tx.authored.propose, proposeComparison, and AuthoredChange, bulk decide({ action, all: true, authorId? }), narrowed AuthoredView union arms, stored-author ownership enforcement on tx.authored.propose({ changeId }), and uniform authoredVeto enforcement on forced proposals.
  • e62fe85 by @zbeyens – Reposition range geometry overlays and inactive selection carets when preceding sibling elements mount, unmount, or resize above an editable surface.

  • bf9b87c by @zbeyens – Clean up plitejs/react hook exports and drop caller generics from useElement

    • Rename useElementPath to usePath (keeps returning null outside an element renderer)
    • Remove caller type parameter on useElement(): Element
    • Remove useOptionalElement, useContentRoot, ContentRootController, and UseContentRootOptions
    • Remove setDOMTextSyncRendererCapability, setRetainedTextFlowRendererCapability, and DOMTextSyncRendererCapabilityContext from public plitejs/react
    • Remove any from useEditorContext and useOptionalEditorContext return types

    Migration: Import usePath instead of useElementPath, remove <T> type arguments on useElement(), and replace useContentRoot with slots.contentRoot, useChildRoot, and useRootChrome.

  • 18ff3ad by @zbeyens – Fix derived view follow state and unmounted useEditorRootElement scoping

    • Preserve live focus, composing, and DOM reach on same-root views derived from useRootEditor while keeping source readOnly locks
    • Return null from useEditorRootElement for unmounted non-following views instead of another view's DOM root
  • 3c20b81 by @zbeyens – Add editor.read.selection.value() for whole-document semantic selection reads (preserving named roots and NodeSelection), add optional (selector?, options?) to useElementPath, and remove readEditorSelection, useEditorSelection, useNodeSelector, and useTextSelector from public plitejs and plitejs/react exports.

    Migration: Replace readEditorSelection(editor) with editor.read.selection.value(). Replace useEditorSelection() with useEditorSelector((editor) => editor.read.selection(), { dependsOn: ['selection', 'document'] }). Replace useNodeSelector and useTextSelector with useEditorSelector (using { nodeKey } in dependsOn) or useElementPath.

  • 3c2d532 by @zbeyens – Remove plitejs/yjs and defineEffect shared-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, and plitejs/sync/react)

  • bfd708c by @zbeyens –

    • Add ScrollMargin and ScrollIntoViewOptions.scrollMargin to clear overlays with scrollMode: 'if-needed' and merge with CSS scroll-margin via Math.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
  • b68c1f4 by @zbeyens –

    • Remove the duplicate SelectionValue alias (use EditorSelection), the one-method SpanApi and SpanInterface exports (use LocationApi.isSpan), and EditorSelectionTargetOptions; tighten LocationApi.isSpan to reject non-2-length path arrays.
    • Promote persistent editor.anchor handles created during a committing editor.update into live commit tracking so they map across subsequent commits, while keeping tx.anchor and 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/react and 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.
  • 12f7696 by @zbeyens –

    • Preserve editor.read.selection() object identity (deep-frozen Range) across repeated reads, unrelated document, metadata, and state-field commits, and named-root views so React selectors comparing unchanged selections hit Object.is with zero deep walk.
  • 8af14ab by @zbeyens – Fix Shift+click selections across nested content roots losing their cross-root selection state when pointer release runs before selectionchange.

  • 21b6496 by @zbeyens – Store collab: 'shared' state fields solely in records['shared-state'], isolate non-JSON live state values, add 'configuration' to EditorCommitChangeKind, tighten StateFieldDescriptor, and remove invertEffect, mapEffect, encodeEditorEffect, decodeEditorEffect, state.meta(), and shared field.effect

    • Store collab: 'shared' state fields only in records['shared-state'] (migrating legacy meta entries on load) so tx.value.replace, late install, and multi-peer sync converge on one store
    • Isolate non-JSON live field values (Date, Map, Set, Uint8Array, and SharedArrayBuffer-backed views) across editor creation, persisted reload, reads, and useStateFieldValue
    • Add 'configuration' to EditorCommitChangeKind and remove the '$configuration' sentinel from commit.dirtyStateKeys
    • Split StateFieldDescriptor into LocalStateFieldDescriptor | SharedStateFieldDescriptor, model omitted initial as TValue | undefined, and represent absent transition sides safely
    • Remove invertEffect, mapEffect, encodeEditorEffect, decodeEditorEffect, and state.meta() (editor.read.meta(), tx.meta()), and retire field.effect on collab: 'shared' fields (which now sync and undo exclusively through set_register steps)

    Migration:

    • Replace commit.dirtyStateKeys.includes('$configuration') with commit.changed.hasAny('configuration'), and add 'configuration' to dependsOn or commit.changed.hasAny(...) checks that relied on 'state' waking on plugin reconfiguration.
    • Replace editor.read.meta() with editor.read.value().meta or editor.read.getField(field).
    • Add persist and remove reduce on collab: 'shared' fields, update shared fields via tx.setField(field, value) instead of tx.effects.emit(field.effect, ...), handle undefined (or supply initial) on fields declared without initial, and type runtime field parameters as EditorStateField rather than StateFieldDescriptor.
    • Serialize collaborative changes with commit.changes.toJSON() (set_register carries shared state fields) and history with History.toJSON / History.fromJSON instead of calling encodeEditorEffect or decodeEditorEffect.
  • ef419a0 by @zbeyens – Add server.run to createSyncServer for serialized server-side read and write turns with per-actor element ID minting, incremental rollback, and writePolicy: 'propose-only' confinement on suggest-only non-deciding grants.

  • b92cb81 by @zbeyens –

    • Type editor.plugin(P).update.* methods as returning R | undefined on refusal, keep editor.plugin(P).update(policy) non-callable, and preserve generic <TValue> inference on editor.update.setField.
    • Remove unused one-shot helpers editor.update.annotations, editor.update.effects.all, editor.update(policy).result(fn), and callable editor.update(policy) (use editor.update.result(fn) or tx.annotations / tx.effects.all() inside editor.update((tx) => ...)).
    • Harden post-commit notification durability and fix view lastCommit / maxLength sharing, getter-defined plugin update methods, tx.blocks.set property validation, and unfillable block-replacement defaults.
  • 1cf5f56 by @zbeyens – Remove DOMGeometryRect from plitejs/dom and return frozen ViewportRect from editor.api.dom.visibleRect, widen useEditableClip to accept any four-edge viewport rect (DOMRect, DOMRectReadOnly, or ViewportRect), and avoid scheduling unused animation-frame flushes when only useEditableClip is mounted.

    Migration: Replace DOMGeometryRect imports from plitejs/dom with ViewportRect.

  • 30d3c2e by @zbeyens –

    • Add window-scroll virtualization fallback, ignore unbounded overflow-y: auto wrappers, retain active IME composing blocks during scroll, and mount all blocks in static flow on print in VirtualizedEditorContent
  • 98e19a7 by @zbeyens –

    • Pass slots.contentRoot in RenderVoidProps and add autoFocus support to content-root slots so void elements mount schema-owned child roots through slots.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

Full changelog: v54.0.0-beta.8...v54.0.0-beta.9

5 hours ago
react-arborist

v4.1.2

Fixes

  • Selection add and remove copy the selection Set instead of mutating the previous one, so an earlier selectedIds snapshot stays unchanged after the next select or deselect. TreeProvider also uses each store's own state as its SSR snapshot instead of sharing one module-level state object across tree instances. (#400)
5 hours ago
dockview

v8.11.0

What's Changed

Full Changelog: https://github.com/dockview/dockview/compare/v8.10.0...v8.11.0

6 hours ago
react-arborist

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)

6 hours ago
redux-toolkit

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.

Changelog

Immer 11.2.14 Perf Improvements

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 get and set traps 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.

upsertQueryEntries Options for In-Flight Fetches

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 by upsertQueryData.
  • keepRequestState: existing entries keep their status, 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 their keepUnusedDataFor timer 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.

Guarded undo for Optimistic Updates

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!

api.util.removeQueryData

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 / refetchOnReconnect Max Age, and prefetch Returns a Promise

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.

invalidationBehavior: 'immediately' Catches Invalidations During a Running Request

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.

Listener Middleware Updates

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 Regression Fixes

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.

Other Fixes

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!

Docs Updates

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!).

What's Changed

Full Changelog: https://github.com/reduxjs/redux-toolkit/compare/v2.15.0...v2.16.0

8 hours ago
react-arborist

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)
16 hours ago
virtual

@tanstack/vue-virtual@3.13.55

Patch Changes

16 hours ago
virtual

@tanstack/solid-virtual@3.13.56

Patch Changes