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

Revert [Breaking Change][lexical] Bug Fix: Commit updates on editorSetRootElement(null) (#7023) #7052

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

potatowagon
Copy link
Contributor

@potatowagon potatowagon commented Jan 15, 2025

S482409: Editors on Meta's www were crashing with error: Got unexpected null or undefined on reloading the editor.

the root cause is a nullthrows at

  const parentElementDOM = nullthrows(
    editor.getElementByKey(parentElementNode.getKey()),
  );

MLCFloatingParagraphStylesPlugin.react.js in the www integration layer. More investigation needed to determine whats the best approach to handle null being returned to parentElementDOM.

PR7023 is suspected to cause the change, and carries more risk then expected. Reverting the sync diff with PR7023 mitigates the issue. sorry @etrepum to unblock the syncs, may we revert this PR first?

Copy link

vercel bot commented Jan 15, 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 Jan 15, 2025 8:48am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 15, 2025 8:48am

@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 Jan 15, 2025
Copy link

size-limit report 📦

Path Size
lexical - cjs 28.99 KB (-0.12% 🔽)
lexical - esm 28.81 KB (-0.1% 🔽)
@lexical/rich-text - cjs 37.96 KB (-0.01% 🔽)
@lexical/rich-text - esm 30.93 KB (+0.1% 🔺)
@lexical/plain-text - cjs 36.51 KB (-0.07% 🔽)
@lexical/plain-text - esm 28.15 KB (-0.03% 🔽)
@lexical/react - cjs 39.77 KB (+0.01% 🔺)
@lexical/react - esm 32.26 KB (+0.01% 🔺)

@zurfyx zurfyx added this pull request to the merge queue Jan 15, 2025
Merged via the queue into main with commit 29d733c Jan 15, 2025
41 checks passed
@etrepum
Copy link
Collaborator

etrepum commented Jan 15, 2025

I think the real question here is why is an editor setting the root element to null and also expecting the associated DOM to be non-null? I don't have a strong opinion on whether the reconciliation here should be immediate or not but having setRootElement(nonNull) work significantly differently than setRootElement(null) is confusing behavior and should at least be documented and tested as the expected semantics if we are to leave this in place.

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.

4 participants