Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lexical] Bug Fix: add missing flow type for getNearestEditorFromDOMNode #7183

Merged
merged 1 commit into from
Feb 16, 2025

Conversation

kirandash
Copy link
Contributor

Description

Current behavior:

  • The getNearestEditorFromDOMNode function is missing Flow type definition in Lexical.js.flow
  • This causes Flow errors when importing and using the function, requiring $FlowFixMe to suppress

Changes being added:

  • Add proper Flow type definition for getNearestEditorFromDOMNode in Lexical.js.flow
  • This allows proper type checking when importing the function
  • Removes the need for $FlowFixMe suppression

Closes #7148

Test plan

Before

// packages/lexical-playground/src/test-flow-issue.js.flow
// @flow strict

import {getNearestEditorFromDOMNode} from 'lexical';
// Flow error: Cannot import getNearestEditorFromDOMNode because there is no getNearestEditorFromDOMNode export in lexical. [missing-export]

function test(node: Node) {
  getNearestEditorFromDOMNode(node);
} 

image

After

// packages/lexical-playground/src/test-flow-issue.js.flow
// @flow strict
import {getNearestEditorFromDOMNode} from 'lexical';
// No Flow errors, proper type checking works

function test(node: Node) {
  getNearestEditorFromDOMNode(node);
} 

image

- Add Flow type definition for getNearestEditorFromDOMNode in Lexical.js.flow
- Fixes facebook#7148
Copy link

vercel bot commented Feb 16, 2025

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 Feb 16, 2025 9:05am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 16, 2025 9:05am

@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 Feb 16, 2025
Copy link
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 good!

@etrepum etrepum added this pull request to the merge queue Feb 16, 2025
Merged via the queue into facebook:main with commit 3b9ec81 Feb 16, 2025
40 checks passed
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: getNearestEditorFromDOMNode is missing in flow
3 participants