Skip to content

[lexical-react][lexical-playground] Fix: correct imports of horizontal rule#8203

Closed
dabrpio wants to merge 2 commits intofacebook:mainfrom
dabrpio:fix/horizontal-rule-plugin
Closed

[lexical-react][lexical-playground] Fix: correct imports of horizontal rule#8203
dabrpio wants to merge 2 commits intofacebook:mainfrom
dabrpio:fix/horizontal-rule-plugin

Conversation

@dabrpio
Copy link
Contributor

@dabrpio dabrpio commented Mar 10, 2026

Description

After deprecation of HorizontalRuleNode and $createHorizontalRuleNode in @lexical/react/LexicalHorizontalRuleNode (#7706) I changed the imports to @lexical/extension in my project. It seems it works well in build but today I noticed that on local it does not work. I was getting this error:

obraz

I realized that HorizontalRulePlugin from @lexical/react/LexicalHorizontalRulePlugin still uses $createHorizontalRuleNode deprecated import. This PR updates this and other deprecated imports from @lexical/react/LexicalHorizontalRulePlugin.

Additionally, this PR also updates other imports from this file (INSERT_HORIZONTAL_RULE_COMMAND, $isHorizontalRuleNode) so that now they are importing from @lexical/extension.

Suggestion

Apart from deprecated HorizontalRuleNode and $createHorizontalRuleNode, there are still 3 other things - INSERT_HORIZONTAL_RULE_COMMAND, $isHorizontalRuleNode and SerializedHorizontalRuleNode which are exported from @lexical/react/LexicalHorizontalRulePlugin. I suggest to also mark them as deprecated and force everyone to import them from @lexical/extension.

@meta-cla
Copy link

meta-cla bot commented Mar 10, 2026

Hi @dabrpio!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@vercel
Copy link

vercel bot commented Mar 10, 2026

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

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment Mar 10, 2026 3:02pm
lexical-playground Ready Ready Preview, Comment Mar 10, 2026 3:02pm

Request Review

@meta-cla
Copy link

meta-cla bot commented Mar 10, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@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 Mar 10, 2026
@etrepum
Copy link
Collaborator

etrepum commented Mar 10, 2026

This is more or less on purpose, the HorizontalRuleNode from extensions is a different non-react implementation from the one in @lexical/react. The extension and the react plugin are mutually exclusive. The next step is to migrate the playground to use the extension instead of the plugin.

The command is the same either way, it’s just a re-export. The node class and the plugin vs. extension to support it are the difference.

The WIP PR #8202 addresses most of this already

@dabrpio
Copy link
Contributor Author

dabrpio commented Mar 10, 2026

Ok, I'm closing this PR since it's now addressed in #8202.

@dabrpio dabrpio closed this Mar 10, 2026
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.

2 participants