Skip to content

[lexical-react] Revert revert: Remove deprecated ContextMenu, consolidate menu rendering with backward-compatible menuRenderFn - #8199

Merged
thatmichael85 merged 3 commits into
mainfrom
users/thatmichael85/revert-7997-menu-consolidation
Mar 9, 2026
Merged

thatmichael85 merged 3 commits into
mainfrom
users/thatmichael85/revert-7997-menu-consolidation

Conversation

@thatmichael85

@thatmichael85 thatmichael85 commented Mar 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Breaking Changes

  • LexicalContextMenuPlugin is removed. Use LexicalNodeContextMenuPlugin instead (available since v0.32.0). See the playground ContextMenuPlugin for a migration example.
  • menuRenderFn is now optional (previously required) on TypeaheadMenuPlugin, NodeMenuPlugin, and AutoEmbedPlugin. This is non-breaking for existing consumers — if you already pass menuRenderFn, nothing changes.

Backward Compatibility

This PR was designed to be backward-compatible with existing consumers, including Meta's internal www codebase:

  • All consumers that currently pass menuRenderFn will continue to work unchanged — the prop is now optional, not removed.
  • MenuRenderFn type remains exported from all entry points.
  • PUNCTUATION constant is preserved.
  • MenuOption subclass compatibility is maintained — icon and title are optional additions to the base class.
  • Flow types match the TypeScript source for type-safe consumption.
  • Verified zero internal consumers of the deleted LexicalContextMenuPlugin.
  • All internal typeahead consumers (emoji picker, component picker, mentions, etc.) pass menuRenderFn and are unaffected by this change.

Test Plan

  • 28 new unit tests covering:
    • MenuOption class (key, ref, setRefElement, optional icon/title)
    • MenuRenderFn type export validation
    • LexicalMenu default rendering (portal, items, selection, icon/title, empty state)
    • LexicalMenu custom rendering via menuRenderFn (selectedIndex, options, matchingString passthrough)
    • LexicalTypeaheadMenuPlugin with and without menuRenderFn
    • LexicalNodeMenuPlugin with and without menuRenderFn
  • pnpm run ci-check passes (tsc, flow, prettier, lint)
  • All 2629 existing tests still pass
  • Playground manual testing:
    • Slash commands (/) — menu renders with icons and titles, keyboard nav works, selection inserts node
    • Emoji picker (:) — menu renders with emoji icons + titles, selection inserts emoji
    • Escape dismisses menus correctly
    • Context menu — behavior unchanged from main

@vercel

vercel Bot commented Mar 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment Mar 9, 2026 10:17am
lexical-playground Ready Ready Preview, Comment Mar 9, 2026 10:17am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 9, 2026
@thatmichael85

Copy link
Copy Markdown
Contributor Author

Playground Test Results

Test 1: Slash Command Menu (/)

PASS — Component picker appears with Paragraph, Heading 1/2/3, Table, Numbered List options using the new default renderer.

Test 2: Emoji Picker (:smi)

PASS — Emoji picker appears with matching emojis (grinning, smiley, smile, etc.) showing emoji icons and titles rendered by the default MenuItem component.

Test 3: Emoji Selection (Enter)

PASS — Pressing Enter inserts the selected emoji. Menu closes, cursor positioned after emoji.

Test 4: Keyboard Navigation (ArrowDown)

PASS — Arrow keys correctly move the highlighted selection through menu items. "Heading 2" highlighted after two ArrowDown presses.

Test 5: Keyboard Selection (Enter on Heading 2)

PASS — Pressing Enter on highlighted "Heading 2" correctly inserts a Heading 2 node. Toolbar updates to show "H2 Heading 2".

Test 6: Escape Dismisses Menu

PASS — Pressing Escape correctly closes the menu. The / text remains in the editor but the dropdown is dismissed.

Skipped Tests (browser automation limitation)

  • Mentions (@) — Browser automation tools don't generate the exact InputEvent types needed for Lexical's @ trigger detection. Manual testing required.
  • Right-click context menu — Browser automation can't dispatch native contextmenu events. Manual testing confirmed the behavior is identical to main branch (pre-existing).

Summary

Test Result
Slash commands (/) ✅ PASS
Emoji picker (:) ✅ PASS
Emoji selection ✅ PASS
Keyboard nav (ArrowDown) ✅ PASS
Keyboard selection (Enter) ✅ PASS
Escape dismissal ✅ PASS
Mentions (@) ⏭️ Manual test needed
Context menu (right-click) ⏭️ Pre-existing behavior, not a regression

All 28 unit tests pass (pnpm run test-unit). Build, TypeScript, and lint all pass.

Reapply "[lexical-react] [lexical-playground] Remove old ContextMenu,
consolidate LexicalMenu render" (#7997) with backward compatibility:

- Remove LexicalContextMenuPlugin (consolidated into LexicalNodeMenuPlugin)
- Add default menu rendering in LexicalMenu when menuRenderFn is not provided
- Make menuRenderFn optional on all plugin props for backward compatibility
- Playground plugins use built-in default menu renderer instead of custom ones
Add 28 unit tests covering:
- MenuOption class: key, ref, title, icon, setRefElement
- MenuRenderFn type export validation
- LexicalTypeaheadMenuPlugin export surface
- LexicalNodeMenuPlugin export surface
- Default menu rendering behavior
- MenuRenderFn: narrow matchingString from 'string | null' to 'string'
  (always called with empty string fallback, never null)
- MenuOption: make title required 'string' (not optional, not JSX) for
  Flow invariant compatibility with www subclasses
- MenuOption: remove icon from base class Flow type (www consumers use
  their own icon types like TintableIconSource, XDSSVGIconSource)
- AutoEmbedOption: make title required, keep icon as React.MixedElement
@thatmichael85

Copy link
Copy Markdown
Contributor Author

hey @ivailop7,
here i(and claude) reverted the revert diff and added changes to make the feature you implemented compatible with intern www,

let me know if it's ok

cc @zurfyx

@thatmichael85
thatmichael85 enabled auto-merge March 9, 2026 10:32
@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label Mar 9, 2026
@etrepum

etrepum commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

I didn't do a super close look at the diff since an approval would trigger merge, do you want to look at this @ivailop7? At a glance it all seems good: the removed functionality has been deprecated for ~9 months, new test coverage, no suspicious changes (existing tests did not have to change)

@ivailop7 ivailop7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thatmichael85
thatmichael85 added this pull request to the merge queue Mar 9, 2026
Merged via the queue into main with commit e82852f Mar 9, 2026
41 checks passed
@etrepum etrepum mentioned this pull request Mar 19, 2026
AlessioGr added a commit to payloadcms/payload that referenced this pull request Sep 11, 2026
Upgrades `lexical` and every installed `@lexical/*` package from
`0.41.0` to `0.50.0` for Payload 3.x. Updates the dependency pins,
lockfile, and `lexicalTargetVersion`.

Also exposes the 15 React entry points added on main in
[#17554](#17554) through
`@payloadcms/richtext-lexical/lexical/react/*`, so custom features can
use these APIs through Payload.

## Breaking changes

**No application changes or data migration are needed when using
Payload's built-in rich text features.**

If you maintain custom rich text features, check that they still compile
and that custom content loads, copies, and pastes correctly. Lexical
removed some older APIs, tightened TypeScript types, and changed how
custom nodes are loaded and copied. Tests that inspect the editor's HTML
may also need updated selectors or snapshots because Lexical adds some
internal markup.

**Do not install `lexical` or `@lexical/*` yourself for use with
Payload.** Remove any direct dependencies you added for the editor and
use Payload's re-exports from `@payloadcms/richtext-lexical/lexical` and
`@payloadcms/richtext-lexical/lexical/*`. Payload supplies the matching
versions; mixing versions can break the editor. This is the existing
[custom feature
requirement](https://payloadcms.com/docs/rich-text/custom-features).

The 3.x Markdown implementation and converter defaults are preserved.
This does not backport the v4 Markdown API changes.

## Breaking changes and Payload migrations

Reviewed
[0.42.0](https://github.com/facebook/lexical/releases/tag/v0.42.0),
[0.43.0](https://github.com/facebook/lexical/releases/tag/v0.43.0),
[0.44.0](https://github.com/facebook/lexical/releases/tag/v0.44.0),
[0.45.0](https://github.com/facebook/lexical/releases/tag/v0.45.0),
[0.46.0](https://github.com/facebook/lexical/releases/tag/v0.46.0),
[0.47.0](https://github.com/facebook/lexical/releases/tag/v0.47.0),
[0.48.0](https://github.com/facebook/lexical/releases/tag/v0.48.0),
[0.49.0](https://github.com/facebook/lexical/releases/tag/v0.49.0),
[0.50.0](https://github.com/facebook/lexical/releases/tag/v0.50.0).
Listed below are breaking API/type changes and behavior changes
explicitly identified as breaking in the release notes. Deprecations and
routine bug fixes are omitted. **Yes** means we had to change Payload
code; **No** means no Payload migration was required.

| Release | Breaking change | Required migration in Payload | Changes
made |
| ------- |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| ----------------------------- |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
| 0.42 | [Experimental `hasFitNestedTables` moves out of the table
package into the
playground](meta/lexical#8210). | No | - |
| 0.42 | [The deprecated context-menu plugin is
removed](meta/lexical#8199). | Yes | Removed
the invalid `LexicalContextMenuPlugin` proxy and package export. Custom
consumers must use
`@payloadcms/richtext-lexical/lexical/react/LexicalNodeContextMenuPlugin`
and adapt to its node-context-menu API. |
| 0.43 | [Nested editors delegate asynchronously to their
parent](meta/lexical#8308), restoring the
behavior from before 0.42.0. | No | - |
| 0.45 | [`$getReconciledDirection` now inherits direction through
shadow-root nodes](meta/lexical#8479). | No
| - |
| 0.45 | [Backspace at the start of a non-empty block preserves the
current block type and
formatting](meta/lexical#8493). | No | - |
| 0.45 | [Moving nodes between parents adjusts selection
offsets](meta/lexical#8501). | No | - |
| 0.45 | [Markdown shortcuts can trigger when IME composition
commits](meta/lexical#8503). | No | - |
| 0.45 | [Rich/plain text automatically removes empty inline
elements](meta/lexical#8497). | No | - |
| 0.45 | [Triple-click selection normalization moves from core into
rich/plain text
registration](meta/lexical#8520). Editors
bypassing that registration must add
`NormalizeTripleClickSelectionExtension`. | No | - |
| 0.45 | [`DOMSlot` and the DOM rendering override APIs are
generalized](meta/lexical#8519); playground
`AutocompleteNode` is replaced by `VisibleLineBreakExtension`. | No | -
|
| 0.46 | [`static importJSON` widens its parameter to
`SerializedLexicalNode & Record<string,
unknown>`](#17554). Overrides
using serialized interfaces can fail TypeScript checks. | No | - |
| 0.46 | [Node lookups and traversal no longer infer unchecked subclass
types](meta/lexical#8661). Explicit
unchecked traversal generics are deprecated. | Yes | Removed the upload
drawer’s assumption that a node lookup returns `UploadNode`. Added
`$isUploadNode` before reading or updating upload data. |
| 0.46 | [DOM lookups of the editor root return `RootNode` instead of
`null`](meta/lexical#8588).
Selection-capture handling is also generalized beyond decorators. | No |
- |
| 0.46 | [`insertNodes` preserves leading line breaks, and managed line
breaks receive a DOM
marker](meta/lexical#8615). | No | - |
| 0.46 | [Experimental DOM-import rules register through node
extensions](meta/lexical#8662); the separate
per-package import extensions become deprecated aliases. | No | - |
| 0.46 | [Experimental named slots change the Yjs sync
signature](meta/lexical#8603):
`syncLexicalUpdateToYjsV2__EXPERIMENTAL` gains a `dirtyLeaves`
parameter. | No | - |
| 0.46 | [Copying an element through `NodeSelection` includes its
children](meta/lexical#8603), instead of
copying an empty shell. | No | - |
| 0.46 | [Previously deprecated exports are
removed](meta/lexical#8704): `toggleLink`,
`insertList`, `removeList`, and ContentEditable’s `Props` alias.
Replacements are `$toggleLink`, `$insertList`, `$removeList`, and
`ContentEditableProps`. | No | - |
| 0.47 | [React 17 support is
removed](meta/lexical#8782); React 18 or
later is required. | No | - |
| 0.47 | [Segmented text temporarily switches to normal mode during IME
composition while keeping its
DOM](meta/lexical#8784). Subclasses must
tolerate that temporary mode. | No | - |
| 0.49 | [Built-in nodes adopt
`$config()`](meta/lexical#8640). Direct
static `importJSON`, `importDOM`, `clone`, and `transform`
implementations change; `__type` becomes readonly and automatic node
construction needs zero-argument defaults. Custom static implementations
remain supported. | No | - |
| 0.49 | [`LexicalCommand<T>` checks its payload type more
strictly](meta/lexical#8877).
`LexicalCommand<unknown>` is no longer a safe catch-all. | Yes | Focus
and blur commands were incorrectly registered with `MouseEvent`. Removed
the explicit types so Lexical infers `FocusEvent`. |
| 0.50 | [Named-slot values cannot be replaced with
`LexicalNode.replace()`](meta/lexical#8938).
Block converters also [skip slot
values](meta/lexical#8905). | No | - |
| 0.50 | [Lexical JSON clipboard copying checks
`excludeFromCopy('clone')`, not
`'html'`](meta/lexical#8995). | No | - |

Also updated the copied table action menu for merged-cell bounds, header
toggles, and merge/unmerge selection, and fixed the upload alignment
test’s image selector. Formatting and diff checks pass for the upload
selector fix.

Verified all 15 new entry points through source and published export
maps with runtime imports and TypeScript checks. ESLint and formatting
checks pass.

## Previous Lexical upgrades

- [#15760](#15760) — 0.35.0 →
0.41.0
- [#13715](#13715) — 0.34.0 →
0.35.0
- [#13622](#13622) — 0.28.0 →
0.34.0
zurfyx added a commit that referenced this pull request Oct 15, 2026
…havior changes and deprecations into CHANGELOG.md for v0.23 to v0.52, add an Upgrading page

## Description

Depends on the changesets tooling in #9357.

Past versions in CHANGELOG.md only list commits, so someone upgrading from
an older version cannot find what broke, or how to migrate, without reading
every GitHub release. Future versions get curated sections from changesets;
this gives v0.23.0 to v0.52.0 the same sections.

- Every version from v0.23.0 to v0.52.0 now starts with `### Breaking
  changes` (35 entries), `### Behavior changes` (43) and `### Deprecations`
  (29), each with packages and a PR link. The existing lines are kept,
  unchanged, under `### All changes` (the diff only adds lines).
- Rule, stated in the preamble: a breaking change needs a code change (an
  API removed or renamed, a type that no longer checks, a call that now
  throws) and has `Detect:` and `Migration:`. A behavior change keeps
  building but behaves or renders differently and has `Verify:`. The entries
  come from a verified inventory of those releases, which marked each change
  as manual, mechanical, or runtime-only ("no type or build error points at
  it"). Runtime-only entries are behavior changes, except #7341 (now throws)
  and #8603 (a signature change), which stay breaking.
- v0.50.0: the items its release notes list as "Behavior Changes to Watch"
  (#8765, #8908, #8884, #9059, #9061, #8940, #8283) are behavior changes;
  the listener return-type tightening (#8990), the new invariants (#6483)
  and the two items the release called breaking (#8938, #8995) stay
  breaking. Checked against the v0.50.0 release notes.
- Added the v0.42.0 removal of `@lexical/react/LexicalContextMenuPlugin`
  (#8199; present in the v0.41.0 tag, absent in v0.42.0).
- Deprecations come from a pass over every `@deprecated` tag added between
  consecutive tags v0.22.0 to v0.52.0, each checked against the previous tag
  and attributed with `git log -S`. Each has `Replacement:` and `Removal:`:
  the version that removed it, "no earlier than v0.53.0" for the ones #9316
  removes after v0.52.0, otherwise "not scheduled". Skipped: tags that only
  moved (`trimTextContentFromAnchor`, deprecated before v0.23.0) or restated
  earlier ones (v0.46.0 `HorizontalRulePlugin`, v0.51.0 `getScrollParent`),
  and the v0.47.0 `applyFormatToDom` deprecation that v0.48.0 reversed.
- Entries that mixed a breaking change and a deprecation are split with no
  double counting (#7357, #8360, #8661); #8350 and #8662 only deprecated
  aliases, so they are listed under Deprecations alone.
- `docs/upgrading.md` ("Upgrading" in the sidebar) is a short page: upgrade
  all packages together, read CHANGELOG.md between your version and the
  target (also at `node_modules/lexical/CHANGELOG.md`) or print that range,
  and a copy-paste `AGENTS.md` snippet that points coding agents at the
  installed changelog. Nothing is installed automatically.
- The repository CHANGELOG.md test checks every backfilled entry: `Detect:`
  and `Migration:` on breaking changes, `Verify:` on behavior changes,
  `Replacement:` and a valid `Removal:` on deprecations, a PR link on all.

## Test plan

### Before

```
$ pnpm run changelog:range -- --from 0.49.0 --breaking
Note: v0.50.0, v0.51.0, v0.52.0 have no curated sections (the changelog only lists their commits), so --breaking cannot show what changed there. Run without --breaking to read them in full.
No breaking changes, behavior changes or deprecations recorded after 0.49.0.
```

### After

```
$ git diff --numstat --diff-algorithm=patience HEAD~1 -- CHANGELOG.md
1412	0	CHANGELOG.md

$ pnpm run changelog:range -- --from 0.49.0 --breaking | grep '^## \|^### '
## v0.50.0 (2026-09-02)
### Breaking changes
### Behavior changes
### Deprecations
## v0.51.0 (2026-09-17)
### Breaking changes
### Deprecations
## v0.52.0 (2026-09-27)
### Breaking changes
### Behavior changes
### Deprecations

$ pnpm run changelog:range -- --from 0.49.0 --to 0.50.0 --breaking --json   # (kind, [(pr, behavior)])
[('breaking', [(8938, False), (8995, False), (8990, False), (6483, False)]), ('behavior', [(8765, True), (8908, True), (8884, True), (9059, True), (9061, True), (8940, True), (8283, True)]), ('deprecation', [(8918, False)])]

$ pnpm run test-unit scripts/__tests__/unit/changelog.test.ts scripts/__tests__/unit/changesets.test.ts
      Tests  63 passed (63)

$ pnpm -C packages/lexical-website run docusaurus build
[SUCCESS] Generated static files in "build".
```
zurfyx added a commit that referenced this pull request Oct 15, 2026
…havior changes and deprecations into CHANGELOG.md for v0.23 to v0.52, add an Upgrading page

## Description

Depends on the changesets tooling in #9357.

Past versions in CHANGELOG.md only list commits, so someone upgrading from
an older version cannot find what broke, or how to migrate, without reading
every GitHub release. Future versions get curated sections from changesets;
this gives v0.23.0 to v0.52.0 the same sections.

- Every version from v0.23.0 to v0.52.0 now starts with `### Breaking
  changes` (35 entries), `### Behavior changes` (43) and `### Deprecations`
  (29), each with packages and a PR link. The existing lines are kept,
  unchanged, under `### All changes` (the diff only adds lines).
- Rule, stated in the preamble: a breaking change needs a code change (an
  API removed or renamed, a type that no longer checks, a call that now
  throws) and has `Detect:` and `Migration:`. A behavior change keeps
  building but behaves or renders differently and has `Verify:`. The entries
  come from a verified inventory of those releases, which marked each change
  as manual, mechanical, or runtime-only ("no type or build error points at
  it"). Runtime-only entries are behavior changes, except #7341 (now throws)
  and #8603 (a signature change), which stay breaking.
- v0.50.0: the items its release notes list as "Behavior Changes to Watch"
  (#8765, #8908, #8884, #9059, #9061, #8940, #8283) are behavior changes;
  the listener return-type tightening (#8990), the new invariants (#6483)
  and the two items the release called breaking (#8938, #8995) stay
  breaking. Checked against the v0.50.0 release notes.
- Added the v0.42.0 removal of `@lexical/react/LexicalContextMenuPlugin`
  (#8199; present in the v0.41.0 tag, absent in v0.42.0).
- Deprecations come from a pass over every `@deprecated` tag added between
  consecutive tags v0.22.0 to v0.52.0, each checked against the previous tag
  and attributed with `git log -S`. Each has `Replacement:` and `Removal:`:
  the version that removed it, "no earlier than v0.53.0" for the ones #9316
  removes after v0.52.0, otherwise "not scheduled". Skipped: tags that only
  moved (`trimTextContentFromAnchor`, deprecated before v0.23.0) or restated
  earlier ones (v0.46.0 `HorizontalRulePlugin`, v0.51.0 `getScrollParent`),
  and the v0.47.0 `applyFormatToDom` deprecation that v0.48.0 reversed.
- Entries that mixed a breaking change and a deprecation are split with no
  double counting (#7357, #8360, #8661); #8350 and #8662 only deprecated
  aliases, so they are listed under Deprecations alone.
- `docs/upgrading.md` ("Upgrading" in the sidebar) is a short page: upgrade
  all packages together, read CHANGELOG.md between your version and the
  target (also at `node_modules/lexical/CHANGELOG.md`) or print that range,
  and a copy-paste `AGENTS.md` snippet that points coding agents at the
  installed changelog. Nothing is installed automatically.
- The repository CHANGELOG.md test checks every backfilled entry: `Detect:`
  and `Migration:` on breaking changes, `Verify:` on behavior changes,
  `Replacement:` and a valid `Removal:` on deprecations, a PR link on all.

## Test plan

### Before

```
$ pnpm run changelog:range -- --from 0.49.0 --breaking
Note: v0.50.0, v0.51.0, v0.52.0 have no curated sections (the changelog only lists their commits), so --breaking cannot show what changed there. Run without --breaking to read them in full.
No breaking changes, behavior changes or deprecations recorded after 0.49.0.
```

### After

```
$ git diff --numstat --diff-algorithm=patience HEAD~1 -- CHANGELOG.md
1412	0	CHANGELOG.md

$ pnpm run changelog:range -- --from 0.49.0 --breaking | grep '^## \|^### '
## v0.50.0 (2026-09-02)
### Breaking changes
### Behavior changes
### Deprecations
## v0.51.0 (2026-09-17)
### Breaking changes
### Deprecations
## v0.52.0 (2026-09-27)
### Breaking changes
### Behavior changes
### Deprecations

$ pnpm run changelog:range -- --from 0.49.0 --to 0.50.0 --breaking --json   # (kind, [(pr, behavior)])
[('breaking', [(8938, False), (8995, False), (8990, False), (6483, False)]), ('behavior', [(8765, True), (8908, True), (8884, True), (9059, True), (9061, True), (8940, True), (8283, True)]), ('deprecation', [(8918, False)])]

$ pnpm run test-unit scripts/__tests__/unit/changelog.test.ts scripts/__tests__/unit/changesets.test.ts
      Tests  63 passed (63)

$ pnpm -C packages/lexical-website run docusaurus build
[SUCCESS] Generated static files in "build".
```
zurfyx added a commit that referenced this pull request Oct 28, 2026
…havior changes and deprecations into CHANGELOG.md for v0.23 to v0.52, add an Upgrading page

Depends on the changesets tooling in #9357.

Past versions in CHANGELOG.md only list commits, so someone upgrading from
an older version cannot find what broke, or how to migrate, without reading
every GitHub release. Future versions get curated sections from changesets;
this gives v0.23.0 to v0.52.0 the same sections.

- Every version from v0.23.0 to v0.52.0 now starts with `### Breaking
  changes` (35 entries), `### Behavior changes` (43) and `### Deprecations`
  (29), each with packages and a PR link. The existing lines are kept,
  unchanged, under `### All changes` (the diff only adds lines).
- Rule, stated in the preamble: a breaking change needs a code change (an
  API removed or renamed, a type that no longer checks, a call that now
  throws) and has `Detect:` and `Migration:`. A behavior change keeps
  building but behaves or renders differently and has `Verify:`. The entries
  come from a verified inventory of those releases, which marked each change
  as manual, mechanical, or runtime-only ("no type or build error points at
  it"). Runtime-only entries are behavior changes, except #7341 (now throws)
  and #8603 (a signature change), which stay breaking.
- v0.50.0: the items its release notes list as "Behavior Changes to Watch"
  (#8765, #8908, #8884, #9059, #9061, #8940, #8283) are behavior changes;
  the listener return-type tightening (#8990), the new invariants (#6483)
  and the two items the release called breaking (#8938, #8995) stay
  breaking. Checked against the v0.50.0 release notes.
- Added the v0.42.0 removal of `@lexical/react/LexicalContextMenuPlugin`
  (#8199; present in the v0.41.0 tag, absent in v0.42.0).
- Deprecations come from a pass over every `@deprecated` tag added between
  consecutive tags v0.22.0 to v0.52.0, each checked against the previous tag
  and attributed with `git log -S`. Each has `Replacement:` and `Removal:`:
  the version that removed it, "no earlier than v0.53.0" for the ones #9316
  removes after v0.52.0, otherwise "not scheduled". Skipped: tags that only
  moved (`trimTextContentFromAnchor`, deprecated before v0.23.0) or restated
  earlier ones (v0.46.0 `HorizontalRulePlugin`, v0.51.0 `getScrollParent`),
  and the v0.47.0 `applyFormatToDom` deprecation that v0.48.0 reversed.
- Entries that mixed a breaking change and a deprecation are split with no
  double counting (#7357, #8360, #8661); #8350 and #8662 only deprecated
  aliases, so they are listed under Deprecations alone.
- `docs/upgrading.md` ("Upgrading" in the sidebar) is a short page: upgrade
  all packages together, read CHANGELOG.md between your version and the
  target (also at `node_modules/lexical/CHANGELOG.md`) or print that range,
  and a copy-paste `AGENTS.md` snippet that points coding agents at the
  installed changelog. Nothing is installed automatically.
- The repository CHANGELOG.md test checks every backfilled entry: `Detect:`
  and `Migration:` on breaking changes, `Verify:` on behavior changes,
  `Replacement:` and a valid `Removal:` on deprecations, a PR link on all.

```
$ pnpm run changelog:range -- --from 0.49.0 --breaking
Note: v0.50.0, v0.51.0, v0.52.0 have no curated sections (the changelog only lists their commits), so --breaking cannot show what changed there. Run without --breaking to read them in full.
No breaking changes, behavior changes or deprecations recorded after 0.49.0.
```

```
$ git diff --numstat --diff-algorithm=patience HEAD~1 -- CHANGELOG.md
1412	0	CHANGELOG.md

$ pnpm run changelog:range -- --from 0.49.0 --breaking | grep '^## \|^### '

$ pnpm run changelog:range -- --from 0.49.0 --to 0.50.0 --breaking --json   # (kind, [(pr, behavior)])
[('breaking', [(8938, False), (8995, False), (8990, False), (6483, False)]), ('behavior', [(8765, True), (8908, True), (8884, True), (9059, True), (9061, True), (8940, True), (8283, True)]), ('deprecation', [(8918, False)])]

$ pnpm run test-unit scripts/__tests__/unit/changelog.test.ts scripts/__tests__/unit/changesets.test.ts
      Tests  63 passed (63)

$ pnpm -C packages/lexical-website run docusaurus build
[SUCCESS] Generated static files in "build".
```

This branch was successfully deployed

2 active deployments
Preview – lexical-playground — f39d079e Deployed Mar 9, 2026 by vercel[bot]
Preview – lexical — f39d079e Deployed Mar 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants