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

Use broader return types in HorizontalRuleNode #4097

Merged
merged 2 commits into from
Mar 10, 2023

Conversation

montlebalm
Copy link
Contributor

Use broader return types inside HorizontalRuleNode to make extending the node easier. Currently, subclasses cannot override these methods with anything other than what's specified by HorizontalRuleNode.

@vercel
Copy link

vercel bot commented Mar 10, 2023

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

Name Status Preview Comments Updated
lexical ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 10, 2023 at 9:47PM (UTC)
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 10, 2023 at 9:47PM (UTC)

@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 Mar 10, 2023
Copy link
Member

@zurfyx zurfyx left a comment

Choose a reason for hiding this comment

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

Thanks! Q: Why would a horizontal rule not be inline? Same for the updateDOM behavior. It feels to me like if you want to create a HorizontalRule that diverges too much from what we have on the playground you may want to create your own Node.

@montlebalm
Copy link
Contributor Author

Why would a horizontal rule not be inline? Same for the updateDOM behavior

That's a fair point about isInline and I think for all intents and purposes it would be fine to leave it false. As for updateDOM, I don't know all the ways that it's used, but could an extending class want to return true in order to update a DOM attribute?

Mainly, I see the specific return types as an unnecessary limitation. I'd be happy to revert either isInline or updateDOM if you think it's better that way.

@zurfyx
Copy link
Member

zurfyx commented Mar 10, 2023

but could an extending class want to return true in order to update a DOM attribute

You're right! Let's just revert isInline then

@zurfyx
Copy link
Member

zurfyx commented Mar 10, 2023

Thank you!

@zurfyx zurfyx merged commit d5bad41 into facebook:main Mar 10, 2023
@zurfyx zurfyx mentioned this pull request Mar 24, 2023
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.

None yet

3 participants