Skip to content

[lexical-react] Chore: Deprecate LexicalComposer in favor of LexicalExtensionComposer - #9168

Merged
etrepum merged 1 commit into
meta:mainfrom
potatowagon:deprecate-lexical-composer
Sep 15, 2026
Merged

etrepum merged 1 commit into
meta:mainfrom
potatowagon:deprecate-lexical-composer

Conversation

@potatowagon

Copy link
Copy Markdown
Contributor

Description

Adds a formal @deprecated tag to LexicalComposer, pointing at LexicalExtensionComposer.

The docstring already tells readers that LexicalComposer "uses the legacy plugin pattern and does not support the extension API" and to use LexicalExtensionComposer instead. This only promotes that prose to the JSDoc tag, so IDEs, TypeScript tooling and generated API docs surface it at the callsite rather than only to people who open the source.

Nothing is removed and there is no behaviour change — this is a marking change.

The motivation is that the two halves of the lifecycle are now out of step. #8354 removed @experimental from the extension and NodeState APIs back in April, so the replacement is no longer labelled experimental, while the thing it replaces still carries no deprecation signal at all. Since LexicalComposer cannot accept extensions, any feature shipped as an extension is simply unreachable from an editor built with it — which makes the absence of a marker misleading for anyone starting new code today.

Open question for maintainers

I have deliberately written "expected to be removed in a future major release" rather than naming 1.0, since the removal timeline is yours to set. If 1.0 is the intended target, happy to say so explicitly — or to drop the removal language entirely and keep the tag purely directional.

Context

Meta's www monorepo is migrating its callsites to the extension composer. ~90% of them go through a single shared wrapper, and migrating that one file moves ~151 production surfaces onto an extension-built editor. Two things worth passing back upstream from that work:

  • The migration is genuinely a two-line change for a wrapper with a stable prop contract, which is a good sign for the API.
  • LexicalExtensionComposer disposes the editor on unmount, where LexicalComposer never did. That is the right behaviour, but it is a semantic difference that the React migration guide does not currently mention, and it fails silently rather than loudly (anything touching the editor after unmount becomes a no-op). Happy to send a docs PR for that separately if useful.

Test plan

Comment-only change to a JSDoc block; no runtime code is touched.

  • Verified no deprecation-style lint rule is configured in eslint.config.mjs, so the ~28 in-repo importers of @lexical/react/LexicalComposer (playground and examples included) will not fail CI on the new tag.
  • Confirmed the tag follows the convention already used in @lexical/react (LexicalHorizontalRuleNode, LexicalHorizontalRulePlugin, LexicalNestedComposer, LexicalTypeaheadMenuPluginUtils).

@vercel

vercel Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
lexical Ready Ready Preview Sep 15, 2026 2:41am UTC
lexical-playground Ready Ready Preview Sep 15, 2026 2:41am UTC

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 Sep 15, 2026
@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label Sep 15, 2026
@darikprescott

This comment was marked as low quality.

@etrepum
etrepum added this pull request to the merge queue Sep 15, 2026
Merged via the queue into meta:main with commit f73868b Sep 15, 2026
50 checks passed
@etrepum etrepum mentioned this pull request Sep 17, 2026

This branch was successfully deployed

2 active deployments
Preview – lexical — eef5f535 Deployed Sep 15, 2026 by vercel[bot]
Preview – lexical-playground — eef5f535 Deployed Sep 15, 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