Repository navigation
[lexical-react] Chore: Deprecate LexicalComposer in favor of LexicalExtensionComposer - #9168
Merged
Merged
Conversation
potatowagon
requested review from
acywatson,
etrepum,
fantactuka,
ivailop7 and
zurfyx
as code owners
September 15, 2026 02:40
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
approved these changes
Sep 15, 2026
This comment was marked as low quality.
This comment was marked as low quality.
Merged
This was referenced Sep 20, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a formal
@deprecatedtag toLexicalComposer, pointing atLexicalExtensionComposer.The docstring already tells readers that
LexicalComposer"uses the legacy plugin pattern and does not support the extension API" and to useLexicalExtensionComposerinstead. 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
@experimentalfrom 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. SinceLexicalComposercannot 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:
LexicalExtensionComposerdisposes the editor on unmount, whereLexicalComposernever 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.
deprecation-style lint rule is configured ineslint.config.mjs, so the ~28 in-repo importers of@lexical/react/LexicalComposer(playground and examples included) will not fail CI on the new tag.@lexical/react(LexicalHorizontalRuleNode,LexicalHorizontalRulePlugin,LexicalNestedComposer,LexicalTypeaheadMenuPluginUtils).