v0.45.0#8580
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zurfyx
approved these changes
May 28, 2026
228b51c to
34cf7c1
Compare
34cf7c1 to
0cfcc16
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v0.45.0 is a monthly release with several breaking changes around selection and reconcile semantics, a major new experimental
DOMImportExtensionAPI for composable HTML import that replacesimportDOM, a generalizedDOMSlotand DOM render override surface, newHistoryExtensionergonomics (canUndo/canRedosignals,maxDepth), notable reconciler/selection performance work, and a wide range of bug fixes across IME, mobile keyboards, list/code/table editing, and markdown round-tripping.Breaking Changes
lexical— Shadow root inclusion in$getReconciledDirection(#8479)$getReconciledDirectionnow walks through shadow roots when resolving the reconcileddirattribute on a node, so nested ShadowRoot-style elements (e.g. tables) inherit direction consistently with regular elements. Callers that relied on direction inheritance stopping at shadow roots will need to update.lexical/@lexical/rich-text— Backspace at block start preserves the current block (#8493)Pressing Backspace at the start of a non-empty block previously merged the current block into the previous block, which discarded the current block's type/format. The new behavior merges the previous block's children into the current block instead, preserving the current block's type (heading, list item, quote, etc.). A new
$mergeBlockBackwardhelper onRangeSelectionis exposed for custom command handlers that want the same behavior.lexical— Selection adjustment inremoveFromParentcallers (#8501)LexicalNode.replace,insertBefore,insertAfter, and related callers that move a node between parents now correctly adjust the current selection to follow the moved node instead of leaving the selection pointing at the (now empty) original slot. This may change selection state observed by transforms or update listeners that previously relied on the stale offsets.@lexical/markdown— Apply markdown shortcuts on composition-committed triggers (#8503)Markdown shortcuts (e.g.
*,_,~) typed via IME composition now trigger after the composition is committed, not just on rawbeforeinput. This fixes shortcuts being silently dropped during Japanese / Korean / Chinese input but may also fire shortcuts in some flows that previously didn't.@lexical/extension/@lexical/rich-text/@lexical/plain-text—NormalizeInlineElementsExtension(#8497)registerRichTextandregisterPlainTextnow register a transform that removes empty inline elements (e.g.LinkNode, formattedTextNodewrappers with no children) instead of leaving them in the tree. The transform is also exported asNormalizeInlineElementsExtensionfrom@lexical/extensionfor use with extension-based setups. Editors that intentionally kept empty inline wrappers will need to disable the extension or override the transform. See Included Extensions.lexical/@lexical/extension/@lexical/rich-text/@lexical/plain-text—NormalizeTripleClickSelectionExtension(#8520)The "triple-click selects the whole paragraph including the trailing newline" normalization has moved out of
LexicalEventsand into a newNormalizeTripleClickSelectionExtensionregistered by both rich-text and plain-text. The coreLexicalEditorno longer performs this normalization on its own, so editors that bypassregisterRichText/registerPlainText(or the equivalent extensions) need to register the extension explicitly to keep the previous behavior. See Included Extensions.lexical/@lexical/html/@lexical/selection/@lexical/utils/@lexical/playground— GeneralizedDOMSlotand DOMRenderExtension override surface (#8519)DOMSlotis now generalized so child slots can be expressed for arbitrary DOM containers (not just the direct child element), and$createDOM,$updateDOM,$exportDOM,$getDOMSlotetc. all flow through the new override surface. The previously-exportedAutocompleteNodein the playground has been replaced by aVisibleLineBreakExtensionthat demonstrates the new override surface, andmarkSelectionin@lexical/utilshas been rewritten on top of the generalized slot API. Custom nodes that overridegetDOMSlotto return a non-element wrapper now have a real way to express that. See the DOMRenderExtension docs.New APIs
@lexical/html—DOMImportExtension(experimental) (#8528)A new
DOMImportExtensionreplaces the legacy node-classimportDOMstatic method with a composable middleware-style API. Rules declare a CSS-selector-style matcher, an optional schema for child handling, and aDOMImportFnthat builds Lexical nodes from the matching DOM. Many helpers ship alongside it:$distributeInlineWrapper,ImportSession,DOMPreprocessFnfor source-specific cleanup (Word, VS Code, etc.), and full TypeScript types for rules, captures, and contexts. A newdev-examples/dom-importshowcase wires it up to a Word/VS Code paste flow. The legacyimportDOMcontinues to work; new code can opt in toDOMImportExtensionfor richer composition and explicit ordering. The companionClipboardDOMImportExtension(in@lexical/clipboard) routestext/htmlpastes through the new pipeline. See the DOMImportExtension guide and the "Migrating fromimportDOM" section.@lexical/html/@lexical/playground— Conditional DOM render overrides (#8575)domOverridenow supportsdisabledForEditoranddisabledForSessionpredicates so render overrides can be conditionally skipped on a per-editor or per-session basis (e.g. only apply during export, or only when a feature flag is on). Useful when one extension provides multiple overrides whose applicability depends on context that isn't known at registration time. See the DOMRenderExtension docs.lexical—ElementNodeimport/export ofdata-lexical-indent(#8536)ElementNodenow uniformly imports and exports thedata-lexical-indentattribute so any subclass round-trips its indent level through HTML without having to overrideexportDOM/importDOM(fixes the long-standing #7729 regression around indented headings/paragraphs).lexical— Infinite recursion detection in update listeners (#8542)Update listeners and update transforms that re-trigger themselves are now caught by a runtime guard that throws a descriptive error after a configurable number of nested updates, instead of hanging the tab. See Updates and Listeners.
@lexical/history—canUndo/canRedoReadonlySignals (#8465)HistoryExtension's output now exposescanUndoandcanRedoasReadonlySignal<boolean>s so toolbar buttons can subscribe directly without pollinghistoryStateor duplicating the priority/state bookkeeping. See Extension Signals.@lexical/history—maxDepthoption (#8537)HistoryExtensionaccepts a newmaxDepthoption that bounds the undo stack. Older entries are evicted FIFO when the depth is exceeded. See the new "Tuning HistoryExtension for memory and long sessions" docs.@lexical/markdown—$convertSelectionToMarkdownString(#8395)Counterpart to
$convertToMarkdownStringthat serializes only the current selection (or any caller-provided range) to a markdown string, useful for "copy as markdown" toolbar actions and for selection-scoped AI prompts.lexical/@lexical/list—$setFormatFromDOM(#8460)A new
$setFormatFromDOMhelper extractstext-align/dirfrom a DOM element and applies it to anElementNode.ListItemNode.importDOMnow uses it to correctly import alignment for list items pasted from external sources.@lexical/list—ListNode.createListItemNode(#8427)ListNodeexposes acreateListItemNodefactory that is now used by children-normalization, soListNodesubclasses can supply a customListItemNodesubclass without monkey-patching the normalizer.@lexical/rich-text—escapeFormatTriggersonRichTextExtension(#8383)RichTextExtensionnow accepts anescapeFormatTriggersconfig (aReadonlySignal<EscapeFormatTriggerConfig>) that opts text-format escape behavior in/out per trigger (enter,click,arrow,space,tab). With it enabled, typing at the boundary of a formatted text node "escapes" the active format (bold, italic, code, etc.), matching the typing experience in Google Docs / Notion. Disabled by default. See Included Extensions.@lexical/extension/@lexical/playground—ClickAfterLastBlockExtension(#8549)New
ClickAfterLastBlockExtensioninserts a fresh paragraph when the user clicks below the last block (and places the caret in it), so single-block editors and short documents don't strand the user with no easy way to start a new line.@lexical/code-prism/@lexical/code-shiki—nullTokenizer.defaultLanguage(#8553)Tokenizer.defaultLanguagemay now benullto indicate that code blocks without an explicit language should round-trip through markdown without injecting a default language tag (e.g.```javascript). Preserves CommonMark's "no fence info" form on export.@lexical/code-core/@lexical/code-shiki/@lexical/code-prism— Outdent space-indented code lines (#8445)Shift+Tab in a code block now correctly outdents space-indented lines (not just tab-indented), respecting the tokenizer's configured indent width.
@lexical/react— Optional asynconCloseforLexicalTypeaheadMenuPlugin(#8489)LexicalTypeaheadMenuPlugin'sonClosemay now return aPromise, useful for handlers that need to await network or animation work before tearing down the menu.@lexical/clipboard—GetClipboardDataExtensionexport (#8431)GetClipboardDataExtensionis now exported from@lexical/clipboardfor use as a peer dependency from custom clipboard handlers.@lexical/website— Server-rendered "Copy page" Markdown button (#8570)Every docs page now has a server-rendered "Copy page as Markdown" button (and a matching
?rawURL) so AI assistants and humans can grab the raw markdown without scraping the rendered HTML.Highlights
Core:
$getReconciledDirectionLexicalNodecallers move a node out of its parentDOMSlotand add DOMRenderExtension override surface;markSelectionrewritten on topNormalizeTripleClickSelectionExtensionElementNodeimport/export ofdata-lexical-indent$updateDOMSelectionRangeSelection.isBackward()on the instanceNodeMapand reconcilerkeyToDOMMap$reconcileChildren<br>reconciledirattribute inimportDOMdisplaystyle inisBlockDomNode/isInlineDomNode--lexical-indent-base-valuevia CSSvar()instead of pre-computing in JSsetRootElementdeleteContentBackwardwithtargetRange$setBlocksType#8517 Handle triple-click overselection in$setBlocksTypeDecoratorNode$reconcileChildrenfast path during full reconcileMOVE_TO_END/MOVE_TO_STARTcrash on decorator-only elementsMOVE_TO_END/MOVE_TO_STARTHTML / DOM:
DOMImportExtension— composable replacement forimportDOMwith rule-based matchers and DOM preprocessingdisabledForEditor/disabledForSessionpredicates ondomOverrideCode:
nullTokenizer.defaultLanguageto preserve markdown ``` round-trip<br>elements in pasted codeClipboard:
GetClipboardDataExtensionExtension:
NormalizeInlineElementsExtension(also wired into rich/plain text)NormalizeTripleClickSelectionExtensionClickAfterLastBlockExtension$canIndent#8510 Set the correct default$canIndentHistory:
canUndo/canRedoReadonlySignals onHistoryExtensionmaxDepthoption for bounding the undo stackLink / List:
$setFormatFromDOMfunction and use it to import alignment for ListItem #8460$setFormatFromDOM;ListItemNodeimports alignment from DOMcreateListItemNodemethod to the ListNode and use it for children normalization #8427ListNode.createListItemNodefactory for subclassesMarkdown:
*/_/~)$convertSelectionToMarkdownStringAPIReact:
onCloseforLexicalTypeaheadMenuPlugineditorState.read()inmarkSelectionExtensionComponentsupport for output components with required propsonOpenEmbedModalForConfigprop optional in LexicalAutoEmbedPlugin #8485 MakeonOpenEmbedModalForConfigprop optional inLexicalAutoEmbedPluginRich Text / Plain Text:
escapeFormatTriggersonRichTextExtensionDecoratorNodeNodeSelectionTable:
pointerdownhandler when root element is set after registerYjs:
TextNodes in collab v2RenderSnapshotcomment typoPlayground:
FloatingLinkEditorcorrectly for multi-line / decorator-only links and near the editor's bottom edge<details>with loose body contentPagesExtensionto be disabled byActionsPlugin(HTML & markdown mode)font-sizeforh2EquationNodeclick →NodeSelection; empty-input Backspace removesWebsite / Examples:
editorStatenullvsundefinedand empty-state pitfallNodeStatein$configJSON serializationLexicalNodeReplacementandwithKlass@lexical/reactplugin docsdev-node-state-styleintoexamples/node-state-styleskipLibCheckinreact-richfor lib-types regression coverage (Chore: Add integration test for skipLibCheck false + React 19 #7093)update-team-datadocusaurus-plugin-internaldocs-fbpresetembed=1from non-iframe StackBlitz links/docs/errorpage from undefinedprocessInfrastructure:
browserslistArrowDownworkaround inTables.spec.mjswindows-2022playwright install-depsinstead ofapt-get@playwright/testto^1.60.0release.jstorelease.mjsWhat's Changed
Details
with loose body content by @markselby9 in [lexical-playground] Bug Fix: Prevent crash importing <details> with loose body content #8442createListItemNodemethod to the ListNode and use it for children normalization by @levensta in [lexical-list] Feature: Add thecreateListItemNodemethod to the ListNode and use it for children normalization #8427$setFormatFromDOMfunction and use it to import alignment for ListItem by @levensta in [lexical][lexical-list] Feature: Add$setFormatFromDOMfunction and use it to import alignment for ListItem #8460onOpenEmbedModalForConfigprop optional in LexicalAutoEmbedPlugin by @levensta in [lexical-react] Chore: MakeonOpenEmbedModalForConfigprop optional in LexicalAutoEmbedPlugin #8485$canIndentby @levensta in [lexical-extension] Bug Fix: Set the correct default$canIndent#8510$setBlocksTypeby @flavorjones in [lexical] Bug Fix: handle triple-click overselection in$setBlocksType#8517reconcile by @mayrang in [lexical] Bug Fix: Cache last-child kind for trailing-<br> reconcile #8548
New Contributors
$setBlocksType#8517Full Changelog: v0.44.0...v0.45.0