build(deps-dev): bump lexical from 0.49.0 to 0.52.0
Type: Pull Request
State: Open
Association: Unknown
Comments: 1
(13 days ago)
(13 days ago)
Bumps lexical from 0.49.0 to 0.52.0.
Release notes
Sourced from lexical's releases.
v0.52.0 is an ad-hoc release targeting a few fixes to mobile text input, but carries a number of other updates accumulated in the past week as we move towards Lexical 1.0. We did a pass to modernize the documentation focusing on the latest features.
@lexical/mdastnow uses one configurableMdastExtensionfor import and export, headless editors can be built entirely from extensions, and selection notifications have a consistent timing contract. There are also fixes for deletion, horizontal caret scrolling, drag-and-drop and mobile input.Breaking Changes
lexical—SELECTION_CHANGE_COMMANDconsistently runs before DOM reconciliation, inside the pending writable update. This includes automaticNodeSelectionandTableSelectionnotifications that previously ran after reconciliation.$getSelection()returns the pending selection;$getPreviousSelection()returns the last committed selection. Eligible programmatic changes now notify without waiting for a nativeselectionchangeevent. Listener edits join the same commit, and handlers that change the selection must converge. A listener that throws can now abort the whole pending update, including the edit that triggered the notification, and listeners inherit that update's tags, so content edits made during aCOLLABORATION_TAGorHISTORIC_TAGupdate are not synced to Yjs peers. Move DOM-dependent work such as element lookup, focus checks and floating UI positioning into$onUpdate(() => editor.read('latest', () => { /* ... */ })), reading selection and nodes inside that callback. UseregisterUpdateListenerfor UI that must respond to every commit, including content-only changes (#9219, selection timing guide)lexical/@lexical/html— Default HTML export now honorsDOMRenderExtension$createDOMoverrides. This affects nodes that inheritLexicalNode.exportDOMor callsuper.exportDOM(editor), including text and paragraphs. If an override was intended only for the live editor, review the HTML it now exports. CustomexportDOMimplementations that create their own elements can still bypass this hook;$updateDOMand$decorateDOMremain reconciliation-only, and$exportDOMhandles export-specific changes (#9231)lexical—LexicalNode.getCommonAncestoris removed. Use$getCommonAncestor(a, b)?.commonAncestor ?? null. This is not quite a direct substitution: the removed method first replaced non-element arguments with their parents, while the function compares the supplied nodes and can return a text node when both arguments are that node. Pass the parents of non-element nodes if you need the old behavior, and use type guards instead of the old unchecked generic type argument (#9238)Deprecations
@lexical/mdast—MdastImportExtensionandMdastExportExtensionare deprecated aliases ofMdastExtension. Move configuration toMdastExtensionand replaceMdastImportExtensionOutput/MdastExportExtensionOutputwithMdastExtensionOutput. The package is experimental, and these aliases are intended to remain for only one release (#9198)New APIs & Features
@lexical/mdast— Unified Markdown configuration and inherited export rules.MdastExtensionowns both import and export, and feature extensions include it automatically. Export rules accept a node class or type string and apply to subclasses, with more specific rules taking precedence. ATextNoderule can therefore handle tabs and custom text subclasses without separate registrations (#9198)@lexical/mdast— Import/export middleware throughcontext.next(). Delegate conversion of the same node to the remaining handlers, then return or modify their output. Export chains try remaining same-type rules before ancestor rules. Usecontext.next()to delegate:nullretains its existing meaning of default export or omitted import, while[]omits content in either direction. Formatted text from middleware participates in text merging; custom structure or metadata is preserved as-is (#9198)@lexical/headless—HeadlessExtensionworks withbuildEditorFromExtensionsfor server-side processing and tests. It marks the editor as headless and prevents attaching a DOM root. UnlikecreateHeadlessEditor, it keeps listener registration methods available, so extensions that register root listeners can still be used (#9249)Notable Fixes
Selection & editing
- Backspace over all text in the first block preserves the empty block and its type (#9236); select-all deletion restores an editable paragraph when the root still contains slots such as footnotes (#9240); line deletion correctly resolves endpoints inside text-bearing inline decorators (#9247)
- Dropping dragged text on the edge of its own selection no longer deletes it (#9241); persistent selection highlights retain coverage across mixed font sizes and partially overlapping rectangles (#9196)
- Lexical-controlled caret moves reveal the caret horizontally in code blocks and other scrolling containers, including table wrappers. Horizontal scrolling respects
scroll-padding, with updated playground styling to keep the caret clear of the code gutter (#9215)- Focus commands triggered during DOM selection synchronization no longer produce spurious read-only warnings; dispatching commands from an explicit read context still warns (#9230)
Mobile input & recovery
- iOS tracks explicit Shift key events so Shift+Enter can insert a line break without treating automatic capitalization as Shift. Ordinary Enter continues to insert paragraphs; when capitalization has already highlighted Shift, it must be toggled off and on to request a line break (#9242)
- The input-suppression workaround after handled Backspace or select-all is limited to macOS Chromium, preventing legitimate text input from being discarded on other platforms (#9251)
setEditorStatewith a childless root warns and recovers to an empty paragraph in production. Development builds still report the invalid state throughonError(#9183)Performance & signals
- Writable nodes are cached during pending updates, reducing repeated node-map lookups (#9169)
@lexical/extensionraises its@preact/signals-coredependency to^1.14.4, fixing stale computed values after a batch changes a signal and restores its original value (#9248)Playground & docs
- Getting-started guides now use module-level root extensions, with five live editors, examples drawn directly from runnable source, and Open in StackBlitz buttons. Custom-feature examples demonstrate
$configschemas, NodeState, and HTML import/export through extensions (#9237)- The introduction, Concepts and Serialization guides have been rewritten around current APIs, with Mermaid diagrams, an interactive update lifecycle explanation and a dedicated comparison with ProseMirror. Older setup and serialization APIs remain documented in Legacy sections (#9249)
- Numerous API names, snippets and lifecycle descriptions have been corrected throughout the docs, most of them by
@potatowagon. API reference links now point to the right GitHub source paths and resolve external types (#9204, #9220)- Playground Find & Replace calculates offsets correctly across decorators and slots (#9186)
What's Changed
- v0.51.0 by
@etrepumin facebook/lexical#9178- [lexical] Refactor: Cache writable nodes during pending updates by
@etrepumin facebook/lexical#9169- [lexical-website] Documentation Update: fix $insertList argument in the commands guide by
@potatowagonin facebook/lexical#9188- [lexical-website] Documentation Update: seed the editor state with setEditorState, not registerRichText by
@potatowagonin facebook/lexical#9189
... (truncated)
Changelog
Sourced from lexical's changelog.
v0.52.0 (2026-09-27)
Breaking changes
lexical,
@lexical/table:SELECTION_CHANGE_COMMANDruns before reconciliation (#9219)The command runs inside the pending update, before DOM reconciliation, including automatic
NodeSelection/TableSelectionnotifications. Listener edits join the same commit and inherit its tags; a throwing listener can abort the update.Detect:
registerCommand(SELECTION_CHANGE_COMMAND, ...)handlers that read the DOM (getElementByKey,getBoundingClientRect, focus checks, floating UI positioning).Migration:
// Before editor.registerCommand(SELECTION_CHANGE_COMMAND, () => { positionToolbar(editor); return false; }, COMMAND_PRIORITY_LOW); // After editor.registerCommand(SELECTION_CHANGE_COMMAND, () => { $onUpdate(() => editor.read('latest', () => positionToolbar(editor))); return false; }, COMMAND_PRIORITY_LOW);Use
registerUpdateListenerfor UI that must react to every commit. See Selection change timing.lexical:
LexicalNode.getCommonAncestorremoved (#9238)The method is removed.
$getCommonAncestoris not a drop-in replacement: the old method first replaced non-element arguments with their parents.Detect:
.getCommonAncestor(calls on nodes.Migration:
// Before const ancestor = a.getCommonAncestor(b); // After (pass parents of non-element nodes to keep the old behavior) const ancestor = $getCommonAncestor(a, b)?.commonAncestor ?? null;
... (truncated)
Commits
b2af316v0.52.078f1891[lexical] Bug Fix: Track explicit Shift state for iOS line breaks (#9242)9aaa7d7[lexical][lexical-headless][lexical-website] Documentation Update: Rewrite th...a4d27c3[lexical] Bug Fix: Limit handled selection input suppression to macOS Chrome ...14050cf[lexical] Bug Fix: resolve line deletion endpoints inside inline decorators (...5601522[lexical] Bug Fix: Handle select-all deletion with root slots (#9240)830821c[lexical] Breaking change: Remove LexicalNode.getCommonAncestor (#9238)c58ded4[lexical-clipboard] Bug Fix: Keep dragged text when it is dropped on the edge...b0f5225[lexical] Bug Fix: Preserve first block after backward range deletion (#9236)bab2560[lexical][lexical-code-core][lexical-playground] Bug Fix: reveal the caret in...- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Package Dependencies
Technical Details
| ID: | 16789944 |
| UUID: | 6198249513 |
| Node ID: | PR_kwDOViRfc88AAAABMv3rPg |
| Host: | GitHub |
| Repository: | qxh1145/codo-harness |