[Breaking Change][lexical] Bug Fix: Use asynchronous parent editor delegation when needed#8308
Merged
etrepum merged 1 commit intofacebook:mainfrom Apr 7, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zurfyx
approved these changes
Apr 7, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking Changes
Unhandled dispatched commands are now asynchronously bubbled to parent editors if the parent editor is currently in an update, where in the previous version these commands would not be propagated (and in the version before that, they were propagated synchronously in a broken way).
Description
Delegating commands to parent editors is rarely used, error-prone, and has confusing semantics. However, it is useful particularly with
SELECTION_CHANGE_COMMANDand the legacy behavior should be preserved until commands are overhauled (probably to also fix the priority inversion, and add more metadata/schema to them).A small step towards cleaning this up was added in #8202, but it caused a regression because in this particular scenario asynchronous delegation is needed, but we had no e2e or unit test coverage of any situation where it should happen. This PR works around it in a different way by explicitly re-triggering command listeners asynchronously in the first updating ancestor editor (this will also propagate to its parents in the same way).
Closes #8306
Test plan
New unit tests to cover both synchronous and asynchronous parent editor delegation