npm @lexical/react 0.38.1
v0.38.1

latest release: 0.38.2-nightly.20251028.0
one day ago

v0.38.1 is an monthly release with a lot of fixes and a few potentially breaking changes (this is a re-publish of v0.38.0, which had problems during initial npm publish).

Breaking Changes

#7926 Static transforms from superclasses are always applied

Before $config there was a limited amount of "automatic" re-use of the static transform by subclasses, because class inheritance also inherits static methods, so you get the implementation of whatever static transform method was in the superclass if it wasn't overridden.

Now the application of these static transforms (whether by method or $config) is implicit. There is no need to call super if adding an additional transform. The implementation walks up the inheritance tree by $config extends or Object.getPrototypeOf and will register all transforms it finds.

#7936 Extension configuration for CodeHighlighterShikiExtension has been flattened

If you are using CodeHighlighterShikiExtension the configuration has changed.

Before:

configExtension(CodeHighlighterShikiExtension, {tokenizer: {...ShikiTokenizer, defaultTheme: })

After:

configExtension(CodeHighlighterShikiExtension, {defaultTheme: })

#7933 LexicalTableSelectionHelpers listener priorities lowered to HIGH from CRITICAL

This is unlikely to break most applications but the priority of these command listeners has been lowered to allow them to be overridden.

Highlights

Core:

  • #7926 Apply static transform and $config $transform from all superclasses (fixes ListNode/ListItemNode subclassing)
  • #7941 Retain lexical selection during updates on unfocused editors
  • #7947 Update block cursor if selection has changed

Extension:

  • 🆕 #7930 Allow nodes config to be deferred for circular dependency reasons
  • ⚠️ #7936 Implement mergeConfig for LinkExtension and flatten config for CodeHighlighterShikiExtension

List:

  • 🆕 #7946 importDOM support for joplin checklists

Table:

  • ⚠️ #7933 Lower table handler command priority

Clipboard:

  • #7942 Log exceptions in clipboard paste handlers

Link:

  • 🆕 #7944 Enable Selective Removal Within Linked Text

React:

  • #7935 Add getServerSnapshot for improved RSC compatibility

Collab v2:

  • #7922 Skip elements that were added and removed between snapshots

Code:

  • #7921 Respect RTL when moving to line start/end in code blocks

Markdown:

  • #7812 Fix bugs in normalizeMarkdown when using shouldMergeAdjacentLines
  • #7923 Prevent markdown links with empty strings from being automatically removed
  • #7928 Fix implicit checklist marker export regression

Playground:

  • #7920 Fix image caption overflow

Examples:

  • 🧹 #7939 Remove workaround from svelte example

Documentation:

  • 🧹 #7931 Update docusaurus and contributing docs

What's Changed

  • v0.37.0 by @etrepum in #7910
  • Update examples for v0.37.0 by @etrepum in #7911
  • [Documentation] Chore: Update bounty program link in CONTRIBUTING.md by @mustkem in #7915
  • [lexical-yjs] Fix: skip elements that were added and removed between snapshots by @james-atticus in #7922
  • [lexical-code] Bug Fix: Respect RTL when moving to line start/end in code blocks by @ashmod in #7921
  • [lexical-markdown] Fix: bugs in normalizeMarkdown by @GermanJablo in #7812
  • [lexical-playground] Bug Fix: Fix image caption overflow issue by @ritoban23 in #7920
  • [lexical-markdown] Bug Fix: Prevent Markdown links with empty string link text from being automatically removed by @adambolcsfoldi in #7923
  • [lexical-website] Chore: Update docusuarus and add contributing docs by @etrepum in #7931
  • [lexical-markdown] Bug Fix: Fix implicit checklist marker export regression by @etrepum in #7928
  • [lexical][lexical-list] Bug Fix: Apply static transform and $config $transform from all superclasses by @etrepum in #7926
  • [lexical-extension] Feature: Allow nodes config to be deferred for circular dependency reasons by @etrepum in #7930
  • [lexical-website] Documentation Update: change setText to setTextContent by @bbertold in #7932
  • [lexical-react] Bug Fix: Add getServerSnapshot for RSC compatibility by @nestarz in #7935
  • [lexical-link][lexical-code-shiki][examples] Feature: Implement mergeConfig for LinkExtension and flatten config for CodeHighlighterShikiExtension by @etrepum in #7936
  • [lexical-table] Chore: Lower table handler command priority by @patrick-atticus in #7933
  • [lexical] Bug Fix: retain selection during updates on unfocused editor by @fantactuka in #7941
  • [lexical-clipboard] Bug Fix: Log exceptions in clipboard paste handler by @niikkhilsharma in #7942
  • [lexical-link] Feature: Enable Selective Removal Within Linked Text by @normtronics in #7944
  • [lexical] Bug Fix: update block cursor if selection has changed by @fantactuka in #7947
  • [lexical-list] Bug Fix: fix pasting checklist from joplin by @antsgar in #7946
  • [examples] Chore: Remove #7859 workaround from svelte example by @etrepum in #7939

New Contributors

Full Changelog: v0.37.0...v0.38.1

Don't miss a new react release

NewReleases is sending notifications on new releases.