# What changed in @lexical/code

> 20 changes in @lexical/code 0.38 to 0.52 from its official release notes, upgrade guides and advisories: 1 breaking, 1 new APIs and options. Each one cited. Sources checked 2026-10-18. HTML: https://unstale.sh/npm/@lexical/code/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## @lexical/code 0.52

### Fixes and other changes

- Preserve selection coverage across mixed typography. (0.52.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0520-2026-09-27)

## @lexical/code 0.51

### Fixes and other changes

- No longer leaves a childless list or table as the root's only child. (0.51.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0510-2026-09-17)
- Avoids issuing a redundant selection change command. (0.51.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0510-2026-09-17)

## @lexical/code 0.50

### Behavior and default changes

- A function-valued style patch is applied only once to an empty element. (0.50.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0500-2026-09-02)

### Fixes and other changes

- Block converters skip named-slot values; related changes diagnose replace() on a slot value and delete slot-bearing decorator hosts at the selection boundary. (0.50.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0500-2026-09-02)
- Handles bare slot values when setting block types. (0.50.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0500-2026-09-02)
- Reading the parent style of a slot value no longer throws. (0.50.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0500-2026-09-02)

## @lexical/code 0.49

### Performance

- Skips redundant selection restoration in removeTextFromCaretRange. (0.49.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0490-2026-07-29)

## @lexical/code 0.47

### Fixes and other changes

- Re-resolves a detached firstBlock during insert. (0.47.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0470-2026-07-10)
- Properly handles block-end focus in backward selections. (0.47.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0470-2026-07-10)

## @lexical/code 0.46

### Behavior and default changes

- Selection APIs now support DOM shadow roots, allowing developers to work with selections inside shadow DOM. (0.46.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0460-2026-06-25)

## @lexical/code 0.45

### New APIs and options

- Adds an override surface for DOM rendering as part of the generalized DOMSlot feature. (0.45.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0450-2026-05-29)

## @lexical/code 0.43

### Breaking changes

- Makes getSelectionStyleValueForProperty independent of text direction. (0.43.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0430-2026-04-09)

## @lexical/code 0.42

### Fixes and other changes

- Fixes cursor positioning after inline equations and fixes block equations. (0.42.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0420-2026-03-19)
- Fixes selection format being reset when inserting consecutive line breaks. (0.42.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0420-2026-03-19)

## @lexical/code 0.41

### Fixes and other changes

- DOM selection now supports elements with slots. (0.41.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0410-2026-02-25)

## @lexical/code 0.40

### Fixes and other changes

- Fixes formatting being removed from a multi-selection after a replace. (0.40.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0400-2026-02-01)

## @lexical/code 0.39

### Fixes and other changes

- Fixes applying styles to empty table cells. (0.39.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0390-2025-12-11)

## @lexical/code 0.38

### Fixes and other changes

- The block cursor is updated when the selection changes. (0.38.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0380-2025-10-27)
- Selection is retained during updates on an unfocused editor. (0.38.0) — [release notes](https://github.com/facebook/lexical/blob/b8cd393673c9aa4fe97df4658f2667b2b1888aca/CHANGELOG.md#v0380-2025-10-27)
