Skip to content

[lexical-react] [lexical-playground] Remove old ContextMenu, consolidate LexicalMenu render#7984

Merged
ivailop7 merged 3 commits intofacebook:mainfrom
ivailop7:reusable_menu
Nov 13, 2025
Merged

[lexical-react] [lexical-playground] Remove old ContextMenu, consolidate LexicalMenu render#7984
ivailop7 merged 3 commits intofacebook:mainfrom
ivailop7:reusable_menu

Conversation

@ivailop7
Copy link
Copy Markdown
Collaborator

@ivailop7 ivailop7 commented Nov 13, 2025

Breaking Changes

Removes deprecated LexicalContextMenu API from @lexical/react for the LexicalNodeContextMenu API introduced in v0.32.0 (#7509)

Before

 <LexicalContextMenuPlugin
      options={options}
      onSelectOption={onSelectOption}
      onWillOpen={onWillOpen}
      menuRenderFn={menuRenderFn}
 />

Now

<NodeContextMenuPlugin
      className="PlaygroundEditorTheme__contextMenu"
      itemClassName="PlaygroundEditorTheme__contextMenuItem"
      separatorClassName="PlaygroundEditorTheme__contextMenuSeparator"
      items={items}
/>

A complete usage example is available here

Description

  • Remove deprecated LexicalContextMenu, LexicalNodeContextMenu should be used. The example in the playground has been using it for quite some time now.
  • Consolidate rendering of all inline popovers using 'menuRenderFn' and remove all associated instances of the custom rendering to use the same styles as the typeahead one.
  • Remove unused PUNCTUATION variable

@vercel
Copy link
Copy Markdown

vercel bot commented Nov 13, 2025

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

Project Deployment Preview Comments Updated (UTC)
lexical Ready Ready Preview Comment Nov 13, 2025 0:51am
lexical-playground Ready Ready Preview Comment Nov 13, 2025 0:51am

@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 Nov 13, 2025
@ivailop7 ivailop7 added the extended-tests Run extended e2e tests on a PR label Nov 13, 2025
@ivailop7 ivailop7 marked this pull request as ready for review November 13, 2025 00:55
@ivailop7 ivailop7 changed the title Remove old ContextMenu, consolidate LexicalMenu render [lexical-react] Remove old ContextMenu, consolidate LexicalMenu render Nov 13, 2025
@ivailop7 ivailop7 changed the title [lexical-react] Remove old ContextMenu, consolidate LexicalMenu render [lexical-react] [lexical-playground] Remove old ContextMenu, consolidate LexicalMenu render Nov 13, 2025
Copy link
Copy Markdown
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

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

Looks like mostly just code deletion, doesn't seem to affect any tests. I didn't try and interact with any of the playground related to these features.

I think the missing thing here is to mostly clearly document this as a breaking change so it doesn't get missed in the release notes

@etrepum
Copy link
Copy Markdown
Collaborator

etrepum commented Nov 13, 2025

I fixed up the description but it might be a good idea to write up a quick example of what migration looks like in case anyone is depending on the deprecated API. We also don't have API docs for the old or new APIs.

@ivailop7 ivailop7 added this pull request to the merge queue Nov 13, 2025
Merged via the queue into facebook:main with commit d1a8e84 Nov 13, 2025
39 checks passed
embedFn: () => void,
dismissFn: () => void,
) => Array<AutoEmbedOption>,
menuRenderFn: MenuRenderFn<AutoEmbedOption>,
Copy link
Copy Markdown
Member

@zurfyx zurfyx Nov 17, 2025

Choose a reason for hiding this comment

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

This is a breaking change (React package), was this intentional? Do we still have an option to customize the menu now? @ivailop7

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

it's using the typeahead menu styles for all LexicalMenu-based menus, excluding the ContextMenu-one those are definable in the theme object.

@etrepum etrepum mentioned this pull request Dec 10, 2025
thatmichael85 added a commit that referenced this pull request Mar 9, 2026
Re-applies PR #7984's menu consolidation while keeping menuRenderFn
as an optional prop for backward compatibility. Old consumers that
pass menuRenderFn still work; new consumers get the default
className-based rendering. Also removes deprecated
LexicalContextMenuPlugin (zero consumers).
thatmichael85 added a commit that referenced this pull request Mar 9, 2026
Re-applies PR #7984's menu consolidation while keeping menuRenderFn
as an optional prop for backward compatibility. Old consumers that
pass menuRenderFn still work; new consumers get the default
className-based rendering. Also removes deprecated
LexicalContextMenuPlugin (zero consumers).
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