Repository navigation
v0.54.0 - #10023
v0.54.0#10023
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
lexical
@lexical/a11y
@lexical/clipboard
@lexical/code
@lexical/code-core
@lexical/code-prism
@lexical/code-shiki
@lexical/compiler
@lexical/devtools-core
@lexical/dragon
@lexical/eslint-plugin
@lexical/extension
@lexical/fast-check
@lexical/file
@lexical/hashtag
@lexical/headless
@lexical/history
@lexical/html
@lexical/internal
@lexical/link
@lexical/list
@lexical/mark
@lexical/markdown
@lexical/mdast
@lexical/offset
@lexical/overflow
@lexical/plain-text
@lexical/react
@lexical/rich-text
@lexical/selection
@lexical/table
@lexical/tailwind
@lexical/text
@lexical/utils
@lexical/y
@lexical/yjs
commit: |
There was a problem hiding this comment.
This release PR looks good to me. The version bump, the consumed changesets and the generated v0.54.0 block all check out. The block matches what scripts/changesets/release.mjs renders from the 207 changesets (I reproduced it from the base commit), every PR link points at the pull request that added its changeset, and ### All changes matches git log v0.53.0.. on the base. The suggestions below are optional, non-blocking edits to CHANGELOG.md:
- Say that
@lexical/yis new in this release (CHANGELOG.md:28). npm has only nightly versions of@lexical/y, so v0.54.0 is its first stable release. Even so, 10 of the 11 entries under### Breaking changesare@lexical/ychanges relative to nightlies, and they come before the one break to a stable API (@lexical/markdown/@lexical/mdast, line 92). The preamble ofCHANGELOG.mddefines breaking changes as ones that "need a code change", and for someone upgrading from 0.53.0 none of these do. They also print withpnpm run changelog:range -- --breaking. One sentence under the heading would save readers some time, for example: "@lexical/yis published for the first time in this release; its [breaking] entries apply to nightly builds only." - Duplicate line (
CHANGELOG.md:1351-1352): #9778 is listed twice in### All changesbecausemainholds a second, empty commit with the same subject. You can delete one of the two lines.
| @@ -25,6 +25,1458 @@ This file also ships in the `lexical` package as | |||
| `node_modules/lexical/CHANGELOG.md`. See | |||
| [Upgrading Lexical](https://lexical.dev/docs/upgrading). | |||
|
|
|||
| ## v0.54.0 (2026-12-02) | |||
There was a problem hiding this comment.
Optional: npm has only nightly versions of @lexical/y, so this is its first stable release, yet 10 of the 11 ### Breaking changes entries below are @lexical/y changes relative to nightlies. One sentence here would tell readers upgrading from 0.53.0 that those entries don't apply to them, for example: "@lexical/y is published for the first time in this release; its [breaking] entries apply to nightly builds only."
| - [lexical-website] Documentation Update: Describe type-signature breaks in CHANGELOG.md by the call shapes they break, and add the missing v0.48 list Backspace behavior change ([#9728](https://github.com/meta/lexical/pull/9728)) Gerard Rovira | ||
| - [lexical-table] Bug Fix: A table selection on a cell whose row span reaches past the last row no longer throws ([#9781](https://github.com/meta/lexical/pull/9781)) Gerard Rovira | ||
| - [lexical] Bug Fix: A named slot's value moved out of its slot no longer makes the reconciler remove the DOM of the element it moved into ([#9778](https://github.com/meta/lexical/pull/9778)) Gerard Rovira | ||
| - [lexical] Bug Fix: A named slot's value moved out of its slot no longer makes the reconciler remove the DOM of the element it moved into ([#9778](https://github.com/meta/lexical/pull/9778)) Gerard Rovira |
There was a problem hiding this comment.
Optional: this line repeats the one above it. main has a second, empty commit with the #9778 subject, so one of the two lines can go.
v0.54.0 is the monthly release and collects the work since v0.53.0. Its headline is
@lexical/y, an experimental collaboration binding for Yjs 14 (@y/y) that ships to npm for the first time in this release, with headless, migration, offline and server entry points beside it. Around that, the release is a large correctness pass over Markdown export escaping, HTML import, text entities, tables and the reconciler; it adds block handles for showing a document to a model, mark flavors,QuoteContainerNodeand$deepCopy; and it drops@experimentalfrom the DOM import pipeline, named slots, compact JSON export and the$configserialization schema.Upgrading from v0.53.0: one breaking change can affect you. The CJK-friendly Markdown punctuation default (#9735) is the only breaking entry outside
@lexical/y. Every other one below is in@lexical/y, which did not exist in v0.53.0, so those apply only to apps that tracked it through nightly or pkg.pr.new builds.Breaking Changes
Markdown — affects every app that imports or exports Markdown
@lexical/markdown,@lexical/mdast: emphasis beside CJK punctuation now reads as CJK writers mean it, following the CommonMark CJK-friendly amendment (#9735).**你好。**世界imports as bold where CommonMark reads literal asterisks. Export still writes strict-CommonMark-safe Markdown by default.@lexical/markdownentry points take an options object in the position that tookshouldPreserveNewLines:punctuationis'cjk-friendly'(import default) or'strict-commonmark'(export default).MdastExtensiontakesimportPunctuationandexportPunctuation.@lexical/mdastonly) or a text variation selector at the inner edge of a run beside a letter —Hello**🎉 launch**,**©︎**2024— now imports with literal markers. Import it withpunctuation: 'strict-commonmark'to keep the old reading.$convertFromMarkdownString/$generateNodesFromMarkdownStringthat read stored Markdown; in types, that parameter is nowboolean | MarkdownImportOptions(TS2345/TS2322 on mocks and pass-throughs).@lexical/mdastnow needsmicromark-core-commonmark2.0.4 andmdast-util-to-markdown2.2.1.@lexical/y— new package; these apply only to nightly/preview usersThe binding's stored layout moved twice in this release and the floor moved with it, so a room stored by an earlier preview opens read-only until its server migrates it.
MIN_LAYOUT,LAYOUT_VERSIONandSEED_LAYOUTare 3 (#9777).prepareYRoom(@lexical/y/server) ormigrateYState(@lexical/y/migrate); the default steps now include2to3and3to4, and a step list of your own must add them in that order (after1to2for a layout 1 room). Keep the generation fence (checkYSession) on every relay, and replace the incarnation of rooms not yet seeded (needsNewIncarnation(room, SEED_LAYOUT)): the seed layout changed. Clear an appUndoManagerat the migration withonYMigrationEpoch(doc, fn, root?).lexical-y:1/:2/:3but not:4;UNSUPPORTED_LAYOUT_WARNINGwithreason: 'older'.clientIDRangeandClientIDRangeare gone (#9884). Every client id is a 53-bit Yjs 14 id, so a server on yrs (y-crdt) needs yrs 0.28 or later — earlier versions truncate 53-bit ids and an author's content comes back duplicated on reconnect. Delete the option from every config and the'range'case from writer-warning handlers.YWarningCodeis any string,YWarning<C>is generic, andYWarningData<C>gains a permanent{reason: 'other'}fallback. Narrow withisYWarning(value, CODE)before readingdata; comparing.codeafterisYWarning(value)leavesdataunknown.LAYOUT_VERSIONis typednumber. Flow dropsYWarningOf. Direct Yjs writes below the binding root are unsupported (RAW_YJS_WRITE_WARNINGin development builds).YBindingOptions.onStatus,YCollabInput.onYStatusandYCollabInput.synced(a handler, ornull);HeadlessYConfig.onWarn;migrateYState'soptions.pending('return'or'discard', and the result is a union onsplit);prepareYRoom's result is a union onchangedwith everything to store underwrite.configExtension(YCollabExtension, ...)withoutonYStatuscompiles but throws at build — the new@lexical/y-collab-statusESLint rule, in the recommended config, catches it.@lexical/y/offlinereshaped (#9925, #9924):markSynced()moves ontoserverEpoch()'s'same'verdict;attachYOfflineSessionrequiresloaded,stopSyncand oneofflinevalue in place ofstage/store/persistEdits/keep;replayUnsyncedEditsandrecoverYOfflineEditsrequireleftoversandautoReplay, withwrapLeftoversAsQuote(label)as a ready wrapper;YOfflineErroris a union bycode;store.clearrequiresslotsandcaptures.New APIs & Features
@lexical/y— the experimental Yjs 14 binding itself (#9400), keeping concurrent typing through block splits, joins, retypes and link changes. Entry points:@lexical/y(binding and extension),/headless(seed, edit and read without an editor, #9437),/migrate(frozen layout steps, #9766),/offline(IndexedDB persistence and offline replay, #9899),/server(prepareYRoom,checkYSession, quarantine records). Also from it:LexicalWarningandDEFER_COMPOSITION_MERGE_TAGinlexical, andBlockIdExtension'srepairTransformsoption.$getBlockHandle(node)gives a block the shortest unambiguous prefix of a hash of its id — about 3–4 o200k tokens against 14 for a 21-character id — with$getBlockHandles()and$resolveBlockHandle(handle, {read}), which returnsfound/not-found/ambiguous/invalidrather than throwing.BlockIdHTMLExtensiongains ahandlesoption.lexical:editorState.toJSON({compact, editor})exports with the editor active, so a node whoseexportJSONcalls$getEditor()needs no wrapping read (#9941);@lexical/file'sserializedDocumentFromEditorStatetakes the sameeditoroption.lexical:$deepCopy(node)copies a node with its whole subtree, named slots and NodeState, for features such as "Duplicate block" (#9936).@lexical/mark: mark flavors —defineMarkExtensionmakes one extension per kind of annotation (comments, suggestions, highlights), each on its own NodeState key, withregisterMarkIDsListenerandMarkBaseExtension(#9496);isMarkIDShownchooses which ids render, for hiding resolved threads while their ids stay in the document (#9489).@lexical/rich-text(experimental):QuoteContainerNode, a<blockquote>that holds blocks and declares it, withQuoteContainerReplacementExtension,QUOTE_CONTAINERfor Markdown andMdastQuoteContainerExtension(#9913).No longer experimental
#9980 drops
@experimentalfrom APIs that have shipped unchanged for several releases: the DOM import pipeline (DOMImportExtension,defineImportRule,CoreImportExtension, the node packages' import rules and schemas,ClipboardImportExtension),DOMRenderExtension, the shadow DOM helpers,setDOMUnmanaged/isDOMUnmanaged, keyboard shortcuts, named slots ($setSlot,$getSlot,$dfsWithSlots,DOMSlot/$getDOMSlot), compact JSON export ($withCompactExport,$exportNodeJSON) and the$configserialization schema.Behavior changes to check before upgrading
Markdown export escaping, reversing v0.53.0's over-escaping
[1],done [x]andarray[0]export as typed again (#9600);<and&likewise, so<3,1<2andTom &survive (#9770). Markdown written by v0.53.0 still imports unchanged.**“bar”**bazimports with literal asterisks andSee –**[here](url)**imports as a bold link. Export writes character references where a round trip needs them. Check Markdown export snapshots.@lexical/mdastwrites the references cmark-gfm needs (#9983) and only links a bare URL where micromark finds one, as GitHub does (#9990).LineBreakNodeper line and aTabNodeper tab instead of oneTextNodewith\n(#9911). ReadcodeNode.getTextContent(), notcodeNode.getFirstChild().getTextContent(). States serialized by earlier versions load unchanged.textFormat/textStyle(#9601).DOM and CSS
@lexical/listno longer writesvalueon every live list item, which made Enter near the top of a long list quadratic in Chromium (#9958).li[value]andattr(value)CSS no longer match, andli.valuereads0— readListItemNode.getValue()or export the DOM. Copied and exported HTML still writesvalue.<strike>,<font>,<small>,<big>,<nobr>,<dfn>,<bdi>,<bdo>and<data>, so pastedis <strike>old</strike> nowno longer becomesisoldnow(#9744);isInlineDomNodereturnstruefor them.$generateNodesFromDOMkeeps the formatting of a<span>around another<span>, as Word for the web writes every run (#9919). Every tag'sforChildnow runs for same-tag nesting, so check anyimportDOMconversion whoseforChildis not idempotent.getTextDirectionnow returns what the browser givesdir="auto"(#9942); text starting with an emoji followed by Hebrew or Arabic is'rtl', not'ltr'.Editor semantics
$getEditor()works in text-content listeners, undo merging, markdown shortcuts, collaboration, HMR andtoJSON()(#9941).editor.read(editorState, fn)is a new overload.onErrorrethrows, so the next update no longer commits its changes and tags (#9509).RangeSelection.insertTextkeeps text inside an inline element that accepts it at its edge, as before v0.49.0 (#9863); returnfalsefromcanInsertTextBefore/Afterto keep it outside.NodeStructureExtension, a class declaringchildren: 'block'is a block container:$insertList,$wrapNodes,insertNodes,insertParagraph,$insertNodeToNearestRootand the Markdown block shortcuts stop at it instead of replacing or splitting it (#9590).registerLexicalTextEntitykeeps the NodeState of an entity that stops matching, and no longer loops forever when typing splits text between two differently formatted nodes (#9713).Notable fixes
Tables — a ragged table no longer throws on selection, delete, copy or paste (#9749); a cell whose row span reaches past the last row is selectable (#9781); deleting a row keeps a merged cell changed earlier in the same update (#9851); plain text pasted into a right-to-left or upward selection starts at its top-left cell (#9774); a cell styled bold no longer strips the bold of
<strong>inside it (#9916).Large documents —
$generateNodesFromDOM(#9957), Enter and$splitNodein a block of 130,000 children (#9883) andmigrateYState(#9880) no longer throwRangeError: Maximum call stack size exceeded.Reconciler — no
DOMSlot.insertChild: before is not in elementwhen a new element takes in the node it was created in front of (#9757); a node removed while its parent's DOM is rebuilt leaves the DOM map and getsdestroyed(#9773); a slot value moved out of its slot no longer strips the DOM of the element it moved into (#9778).Links, marks, code, input —
$toggleLink(url)inside an autolink makes it a real link instead of losing the URL on the next edit (#9822);MarkStateExtensionkeeps comment ids across block-type and list changes (#9503) and through IME composition over a selection (#9540); the code highlighter keeps NodeState on re-tokenization (#9832, #9855, #9862); Enter in a code block keeps a plain line's indentation (#9923); on iOS, Return after a#+=symbol starts a paragraph (#9745); typing after a selected block decorator works in Firefox and WebKit (#9845).@lexical/yjs— collaboration v2 no longer misplaces content or fails with "Lexical node does not exist" when a block or text equals another (#9584); theyjspeer dependency is optional, so@lexical/reactwithoutLexicalCollaborationPluginno longer pulls it in (#9931).Performance
A commit no longer computes the whole document's text with no text-content listener registered (#9548); reconciling a decorator host with named slots no longer forces a synchronous style recalculation in Chrome (#9743); strict Markdown export is much faster on long paragraphs (#9988); bundles drop unused mark flavors (#9496).