v0.39.0

facebook/lexicalv0.39.0Dec 10, 2025by etrepum

AI Summary

Monthly release primarily focusing on bug fixes with a breaking change to ElementNode JSON serialization behavior. Includes new commands for input events and table improvements.

Key Highlights

  • Breaking change: ElementNode JSON serialization only includes textFormat/textStyle when necessary
  • New commands for beforeinput, input, compositionstart/end events
  • Table selection fixes for merged cells and partial backwards selection
  • Collab v2 optimization to avoid rewriting unchanged values to yjs
  • Experimental nested tables configuration option
  • Playground improvements: scrollable table shadows, draggable image targets

Breaking Changes

  • JSON serialization for ElementNode only includes textFormat and textStyle when necessary - these are now only reconciled when useful (in ElementNode with no direct TextNode children that is not a root or shadow root)

New Features

  • Add commands for beforeinput, input, compositionstart/end events
  • Scope highlight cache by editor
  • Only serialize ElementNode textFormat and textStyle when necessary
  • $dfsCaretIterator should be able to stop at its last descendant
  • Text styles applied to empty ElementNodes in selection
  • Defer node class references to work around webpack issues
  • Experiment: add config for opting in to nested tables
  • Ensure colWidths has length equal to number of columns
  • Include first cell contents in partial backwards table selection
  • Prevent typeahead menu from closing during IME composition
  • Don't rewrite unchanged non-primitive property/state values to yjs in collab v2
  • Shadows when table is scrollable
  • Show draggable block target line when dragging images

Full Release Notes

v0.39.0 is a monthly release primarily focusing on bug fixes

## Breaking Changes

### JSON serialization for ElementNode only includes textFormat and textStyle when necessary #7971 

Previously the derived properties `textFormat` and `textStyle` would always be serialized to JSON if not set to the default values. These should only be useful when the ElementNode does not currently have any TextNode children, to preserve formatting choices, and will be recomputed when reconciled. Now they are only reconciled when they are determined to be useful (in an ElementNode with no direct TextNode children that is not a root or shadow root).

## Highlights

Code:
- โœ… #7970 Fix: Scope highlight cache by editor

Core:
- โœ… #7971 Fix: Only serialize `ElementNode` `textFormat` and `textStyle` when necessary
- ๐Ÿ†• #7964 Feature: Add commands for beforeinput, input, compositionstart/end events
- โœ… #7978 Fix: `$dfsCaretIterator` should be able to stop at its last descendant

Selection:
- โœ… #8003 Fix: Text styles are now applied to empty ElementNodes in a selection (typically the empty paragraphs contained in empty table cells)

Extension:
- โœ… #7961 Fix: Defer node class references to potentially work around webpack issues

Table:
- ๐Ÿงช  #7983 Experiment: add config for opting in to nested tables (*note that this does not fix their behavior*)
- โœ… #7986 Fix: Ensure colWidths has length equal to number of columns
- โœ… #7998 Fix: Include first cell contents in partial backwards table selection

React:
- โœ… #7987 Prevent typeahead menu from closing during IME composition

Collab:
- โœ… #7990 Fix: Don't rewrite unchanged non-primitive property/state values to yjs in collab v2

Playground:
- ๐Ÿ†• #8002 Feature: Shadows when table is scrollable
- โœ… #8015 Fix: Show draggable block target line when dragging images

## What's Changed
* v0.38.2 by @etrepum in https://github.com/facebook/lexical/pull/7962
* [scripts] Allow export-froms in Flow files to be transformed for www build by @takuyakanbr in https://github.com/facebook/lexical/pull/7967
* [examples] Chore: Update examples for v0.38.2 by @etrepum in https://github.com/facebook/lexical/pull/7963
* [lexical-code] Bug fix: Add editor key in highlighted nodes cache by @takuyakanbr in https://github.com/facebook/lexical/pull/7970
* [lexical] Feature: Only serialize ElementNode textFormat and textStyle when necessary by @etrepum in https://github.com/facebook/lexical/pull/7971
* [lexical-extension][lexical-*] Bug Fix: Defer node class references to potentially work around webpack issues by @etrepum in https://github.com/facebook/lexical/pull/7961
* [lexical] Chore: Update flow-bin (to 0.289.0) and LexicalLink Flow types by @takuyakanbr in https://github.com/facebook/lexical/pull/7973
* [lexical] Feature: add commands for beforeinput, input, compositionstart/end events by @james-atticus in https://github.com/facebook/lexical/pull/7964
* [lexical] Chore: Update flow-bin (to 0.290.0) and fix incompatible-variance issues by @takuyakanbr in https://github.com/facebook/lexical/pull/7975
* [lexical] Bug fix: $dfsCaretIterator should be able to stop at its last descendant by @nigelgutzmann in https://github.com/facebook/lexical/pull/7978
* [lexical-table] Feature: add config for opting in to nested tables by @james-atticus in https://github.com/facebook/lexical/pull/7983
* [lexical-react] [lexical-playground] Bug Fix: Prevent typeahead menu from closing during IME composition (#7985) by @kykim00 in https://github.com/facebook/lexical/pull/7987
* [lexical-table] Bug Fix: ensure colWidths has length equal to number of columns by @james-atticus in https://github.com/facebook/lexical/pull/7986
* [lexical-react] [lexical-playground] Remove old ContextMenu, consolidate LexicalMenu render by @ivailop7 in https://github.com/facebook/lexical/pull/7984
* [lexical-yjs] Bug fix: don't rewrite unchanged non-primitive property/state values to yjs in collab v2 by @james-atticus in https://github.com/facebook/lexical/pull/7990
* [lexical-website] Documentation Update: Add @y/websocket-server package dependency by @mattcline in https://github.com/facebook/lexical/pull/7996
* Revert "[lexical-react] [lexical-playground] Remove old ContextMenu, consolidate LexicalMenu render" by @ivailop7 in https://github.com/facebook/lexical/pull/7997
* [lexical-website] Documentation Update: Add missing getDocFromMap fn to docs by @mattcline in https://github.com/facebook/lexical/pull/8000
* [lexical-table] Bug Fix: include first cell contents in partial backwards table selection by @patrick-atticus in https://github.com/facebook/lexical/pull/7998
* Doc nit by @zurfyx in https://github.com/facebook/lexical/pull/8010
* [lexical-mark][flow][chore] Add flowfix me after flow 0.292.0 was deployed to www. This fixes the  sync between github and www by @thatmichael85 in https://github.com/facebook/lexical/pull/8019
* [lexical-playground]: Shadows when table is scrollable by @ivailop7 in https://github.com/facebook/lexical/pull/8002
* [lexical-selection]: Fix applying styles for empty table cells by @ivailop7 in https://github.com/facebook/lexical/pull/8003
* [lexical-playground] Bug Fix: Show draggable block target line when dragging images by @paigekim29 in https://github.com/facebook/lexical/pull/8015

## New Contributors
* @kykim00 made their first contribution in https://github.com/facebook/lexical/pull/7987
* @mattcline made their first contribution in https://github.com/facebook/lexical/pull/7996
* @thatmichael85 made their first contribution in https://github.com/facebook/lexical/pull/8019

**Full Changelog**: https://github.com/facebook/lexical/compare/v0.38.2...v0.39.0