-
Notifications
You must be signed in to change notification settings - Fork 47.6k
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
Remove flushDiscreteUpdates
from end of event
#21223
Conversation
We don't need this anymore because we flush in a microtask. This should allow us to remove the logic in the event system that tracks nested event dispatches. I added a test to confirm that nested event dispatches don't triggger a synchronous flush, like they would if we wrapped them `flushSync`. It already passed; I added it to prevent a regression.
Comparing: bdc23c3...ceded6a Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
857ba0f
to
15e15aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requesting changes until we confirm if my suspicion is right.
15e15aa
to
5fb01a2
Compare
dispatchClickEvent(child); | ||
|
||
await act(async () => { | ||
dispatchClickEvent(child); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to change these tests because they were previously relying (accidentally) on the click event to flush the pending passive effects. Which after this change, they no longer do.
Fortunately, the fix is pretty easy. Unfortunately, this change affects legacy mode, too. I'm curious how many tests would be affected in normal practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. Yea that might be a big one.
5fb01a2
to
ceded6a
Compare
Summary: This sync includes the following changes: - **[bd7f4a013](facebook/react@bd7f4a013 )**: Fix sloppy factoring in `performSyncWorkOnRoot` ([#21246](facebook/react#21246)) //<Andrew Clark>// - **[78120032d](facebook/react@78120032d )**: Remove `flushDiscreteUpdates` from end of event ([#21223](facebook/react#21223)) //<Andrew Clark>// - **[a3a7adb83](facebook/react@a3a7adb83 )**: Turn off enableSyncDefaultUpdates in test renderer ([#21319](facebook/react#21319)) //<Ricky>// - **[cdb6b4c55](facebook/react@cdb6b4c55 )**: Only hide outermost host nodes when Offscreen is hidden ([#21250](facebook/react#21250)) //<Brian Vaughn>// - **[b9c6a2b30](facebook/react@b9c6a2b30 )**: Remove LayoutStatic check from commit phase ([#21249](facebook/react#21249)) //<Brian Vaughn>// - **[af1a4cbf7](facebook/react@af1a4cbf7 )**: Revert expiration for retry lanes ([#21300](facebook/react#21300)) //<Andrew Clark>// - **[cc4b431da](facebook/react@cc4b431da )**: Mark boundary as client rendered even if aborting fallback ([#21294](facebook/react#21294)) //<Sebastian Markbåge>// Changelog: [General][Changed] - React Native sync for revisions f7cdc89...bd7f4a0 jest_e2e[run_all_tests] Reviewed By: JoshuaGross Differential Revision: D27909257 fbshipit-source-id: 36ec4cf1de9df109f1fe1542031df10a693baae0
We don't need this anymore because we flush in a microtask. This should allow us to remove the logic in the event system that tracks nested event dispatches. I added a test to confirm that nested event dispatches don't triggger a synchronous flush, like they would if we wrapped them `flushSync`. It already passed; I added it to prevent a regression.
We don't need this anymore because we flush in a microtask.
This should allow us to remove the logic in the event system that tracks nested event dispatches.
I added a test to confirm that nested event dispatches don't trigger a synchronous flush, like they would if we wrapped them
flushSync
. It already passed; I added it to prevent a regression.