Skip to content

[lexical] Bug Fix: LexicalNode.getType() fallback to $config protocol - #7671

Merged
zurfyx merged 1 commit into
facebook:mainfrom
etrepum:hasNode-config-protocol
Jul 3, 2025
Merged

zurfyx merged 1 commit into
facebook:mainfrom
etrepum:hasNode-config-protocol

Conversation

@etrepum

@etrepum etrepum commented Jul 3, 2025

Copy link
Copy Markdown
Collaborator

Description

Follow-up to #7258

The $config protocol initially assumed that no code was calling Node.getType() before the Node was used in an editor, but there is a use case with plug-ins. This changes the stub implementation of LexicalNode.getType() to support the $config protocol directly.

Test plan

Before

Calling Node.getType() on a node using the $config protocol will throw if it has not first been registered with an editor

After

Calling Node.getType() is safe at all times

@vercel

vercel Bot commented Jul 3, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 3, 2025 8:46pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 3, 2025 8:46pm

@facebook-github-bot facebook-github-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 Jul 3, 2025
@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label Jul 3, 2025
@zurfyx
zurfyx added this pull request to the merge queue Jul 3, 2025
Merged via the queue into facebook:main with commit b282ceb Jul 3, 2025
@etrepum etrepum mentioned this pull request Jul 3, 2025
@etrepum
etrepum deleted the hasNode-config-protocol branch September 29, 2025 15:34

This branch was successfully deployed

2 active deployments
Preview – lexical-playground — 3da0a56b Deployed Jul 3, 2025 by vercel[bot]
Preview – lexical — 3da0a56b Deployed Jul 3, 2025 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