v0.36.1

facebook/lexicalv0.36.1Sep 25, 2025by etrepum

AI Summary

Major feature release with new Lexical Extension API, breaking changes to @lexical/yjs collaboration, moved to React 19, and @lexical/headless/dom module for SSR.

Key Highlights

  • New Lexical Extension API - the modern replacement for plugins
  • Breaking changes to collaboration context (requires provider, removed clientID)
  • Updated to React 19 (compatible with React 18)
  • @lexical/headless/dom module with withDOM function for SSR

Breaking Changes

  • DecoratorNode decorate() return type widened to null | T
  • useCollaborationContext now requires LexicalCollaboration context provider
  • useCollaborationContext no longer has clientID property

New Features

  • Lexical Extension API with signal-based configuration
  • @lexical/headless/dom module with withDOM function
  • LexicalExtensionEditorComposer, NestedEditorExtension
  • CodePrismExtension and CodeShikiExtension
  • PagesExtension for paginated documents

Full Release Notes

v0.36.1 is a major feature release with a new [Lexical Extension](https://lexical.dev/docs/extensions/intro) API (#7706), some needed breaking changes to `@lexical/yjs` (#7816, #7818) and a bunch of bug fixes. We've also moved to React 19 (#7802) for all examples, tests, etc. although it should all still remain compatible with React 18 for now.

## Breaking Changes

### #7706 `DecoratorNode`
* Removed type requirement & warning for `DecoratorNode` to implement `decorate()`
* Widens type for `decorate(): T` to be `decorate(): null | T` as that's always how it worked in practice - the generic type here is unsafe and wrong anyway (e.g. `$isDecoratorNode` is a cast to any type `T`)

### #7818 `useCollaborationContext` now requires that a context provider is used

Users of the `CollaborationPlugin` or `useCollaborationContext` must wrap the top-level `LexicalComposer` with a `LexicalCollaboration` component. For example:

```typescript
<LexicalCollaboration>
  <LexicalComposer initialConfig={initialConfig}>
    <RichTextPlugin ... />
    <CollaborationPlugin id="lexical-editor" ... />
  </LexicalComposer>
<LexicalCollaboration>
```

The collaboration context is shared for nested editors, so the provider must only be used on the top-level editor.

### #7818 `useCollaborationContext` no longer has `clientID`

`clientID` has been removed from the collaboration context. This ID was unreliable as it could be updated by nested collab editors. Consumers should retrieve the client ID by looking up the correct document in the context's `yjsDocMap`, or switch to using a different ID.

## Highlights

Extension:

- 🧪  #7706 New [Lexical Extension](https://lexical.dev/docs/extensions/intro) API - what plugins should've been

Core:

- ✅ #7836 Fix cache coherency issue with `RangeSelection#extract`
- ✅ #7854 Account for Apple WebView in `setManagedLineBreak`
- 🧹 #7855 `TabNode.setTextContent` uses `devInvariant` instead of `invariant` for a warning in prod
- 🧹 #7821 Improve error message when a node is registered from a foreign lexical module
- 🧹 #7814 Consolidate ancestor lookup via findMatchingParent

Clipboard:

- ✅ #7835 Update Lexical Clipboard with Empty Selection
- ✅ #7822 Copy correct selection when editor in different window/document

List:
- ✅ #7805 Clear li checklist attributes when inserting nested list 

Markdown:

- 🧹 #7832 Remove `MarkdownShortcuts.ts` dependency on `index.ts`

React:

- ⚠️ #7816 Breaking change: remove clientID from collab context
- ⚠️ #7818 Breaking change: enforce use of collab context provider
- ✅ #7844 Add visibility margin to isTriggerVisibleInNearestScrollContainer to prevent popover from wrongfully closing
- 🧹 #7802 #7803 Update from React 18 to React 19

Headless:

- 🧪 #7833 `@lexical/headless/dom` module featuring `withDOM` function to make SSR easier

Playground:

- ✅ #7786 DatetimeNode DOM updates 
- 🗑️ #7839 Remove mostly redundant `InlineImageNode` and `InlineImageNodePlugin`

Internal:

- 🧹 #7766 #7810 Updated docusaurus and added local search index
- 🧹 #7834 Relocate internal eslint plugin to packages/lexical-eslint-plugin-internal
- 🧹 #7807 Port scripts unit tests to vitest and fix test include match pattern

## What's Changed
* v0.35.0 by @etrepum in https://github.com/facebook/lexical/pull/7797
* [lexical-website] Chore: Update docusaurus-plugin-typedoc by @etrepum in https://github.com/facebook/lexical/pull/7766
* [examples] Chore: Update examples for v0.35.0 by @etrepum in https://github.com/facebook/lexical/pull/7799
* [lexical-playground] DatetimeNode DOM updates by @ivailop7 in https://github.com/facebook/lexical/pull/7786
* [lexical-list] Fix: updating list type to/from check type updates child DOM elements by @james-atticus in https://github.com/facebook/lexical/pull/7800
* [lexical-react] Fix: Use explicit key attr in NodeContextMenuPlugin by @etrepum in https://github.com/facebook/lexical/pull/7803
* [lexical-list] Fix: clear li checklist attributes when inserting nested list by @james-atticus in https://github.com/facebook/lexical/pull/7805
* [*] Chore: Port scripts unit tests to vitest and fix test include match pattern by @etrepum in https://github.com/facebook/lexical/pull/7807
* [lexical-website] Bug Fix: Replace broken algolia search with @easyops-cn/docusaurus-search-local by @etrepum in https://github.com/facebook/lexical/pull/7810
* [lexical-markdown] Update Flow types to match TypeScript by @takuyakanbr in https://github.com/facebook/lexical/pull/7813
* [lexical][lexical-selection][lexical-utils] Refactor: Consolidate ancestor lookup via findMatchingParent by @cnaples79 in https://github.com/facebook/lexical/pull/7814
* [lexical] Chore: Improve error message when a node is registered from a foreign lexical module by @etrepum in https://github.com/facebook/lexical/pull/7821
* [lexical-clipboard] Fix: copy correct selection when editor in different window/document by @james-atticus in https://github.com/facebook/lexical/pull/7822
* [lexical-yjs][lexical-playground] Breaking change: remove clientID from collab context by @james-atticus in https://github.com/facebook/lexical/pull/7816
* [lexical-react] Breaking change: enforce use of collab context provider by @james-atticus in https://github.com/facebook/lexical/pull/7818
* [lexical-markdown] Refactor: Remove MarkdownShortcuts.ts Dependency on index.ts by @jkjk822 in https://github.com/facebook/lexical/pull/7832
* [lexical-clipboard] Bug Fix: Update Lexical Clipboard with Empty Selection by @jkjk822 in https://github.com/facebook/lexical/pull/7835
* [*] Bug Fix: Relocate internal eslint plugin to packages/lexical-eslint-plugin-internal by @etrepum in https://github.com/facebook/lexical/pull/7834
* [lexical] Bug Fix: Fix cache coherency issue with `RangeSelection#extract` by @jkjk822 in https://github.com/facebook/lexical/pull/7836
* [lexical-playground] Chore: remove InlineImageNode and InlineImagePlugun by @etrepum in https://github.com/facebook/lexical/pull/7839
* [lexical][lexical-react][lexical-playground] Chore: Update from React 18 to React 19 by @etrepum in https://github.com/facebook/lexical/pull/7802
* [lexical-react] Bug Fix: Add visibility margin to `isTriggerVisibleInNearestScrollContainer` to prevent popover from wrongfully closing by @dwrth in https://github.com/facebook/lexical/pull/7844
* [lexical-react] Bug Fix: Include react-error-boundary and @floating-ui/react in WWW bundle by @etrepum in https://github.com/facebook/lexical/pull/7852
* [lexical][lexical-extension][*] Feature: Lexical Extension by @etrepum in https://github.com/facebook/lexical/pull/7706
* [lexical-extension][docs] Chore: Add @experimental to extension functions by @etrepum in https://github.com/facebook/lexical/pull/7853
* [lexical] Chore: Change TabNode.setTextContent invariant to devInvariant by @amanharwara in https://github.com/facebook/lexical/pull/7855
* [lexical-headless] Feature: @lexical/headless/dom module for easier SSR by @etrepum in https://github.com/facebook/lexical/pull/7833
* [*] Bug Fix: npmToWwwName ensures lexical prefix by @etrepum in https://github.com/facebook/lexical/pull/7857
* [lexical-headless] Bug Fix: Replace happy-dom with jsdom in www and map react-dom/client by @etrepum in https://github.com/facebook/lexical/pull/7858
* [lexical] Bug Fix: account for Apple WebView in `setManagedLineBreak` by @elpnt in https://github.com/facebook/lexical/pull/7854
* v0.36.0 by @etrepum in https://github.com/facebook/lexical/pull/7861
* Make ref optional in ContentEditable flow by @zurfyx in https://github.com/facebook/lexical/pull/7866
* [*] Bug Fix: Update examples and fix package.json for v0.36.0 (will need a patch release) by @etrepum in https://github.com/facebook/lexical/pull/7867
* Expose LexicalCollaboration Context to flow by @zurfyx in https://github.com/facebook/lexical/pull/7868

## New Contributors
* @cnaples79 made their first contribution in https://github.com/facebook/lexical/pull/7814
* @dwrth made their first contribution in https://github.com/facebook/lexical/pull/7844
* @elpnt made their first contribution in https://github.com/facebook/lexical/pull/7854

**Full Changelog**: https://github.com/facebook/lexical/compare/v0.35.0...v0.36.1