-
Notifications
You must be signed in to change notification settings - Fork 48.8k
[Fiber] Mark cascading updates #31866
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -235,6 +235,7 @@ import { | |
blockingEventTime, | ||
blockingEventType, | ||
blockingEventIsRepeat, | ||
blockingSpawnedUpdate, | ||
blockingSuspendedTime, | ||
transitionClampTime, | ||
transitionStartTime, | ||
|
@@ -1663,11 +1664,8 @@ export function flushSyncWork(): boolean { | |
|
||
export function isAlreadyRendering(): boolean { | ||
// Used by the renderer to print a warning if certain APIs are called from | ||
// the wrong context. | ||
return ( | ||
__DEV__ && | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is removing the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe instead it should add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's intentional. There's nothing about this check that's really DEV only and we actually have this same check in a lot of prod cases within this same file which could really just use this same helper. The reason I needed to relax it now is that I needed in it in a different file. |
||
(executionContext & (RenderContext | CommitContext)) !== NoContext | ||
); | ||
// the wrong context, and for profiling warnings. | ||
return (executionContext & (RenderContext | CommitContext)) !== NoContext; | ||
} | ||
|
||
export function isInvalidExecutionContextForEventFunction(): boolean { | ||
|
@@ -1796,6 +1794,7 @@ function prepareFreshStack(root: FiberRoot, lanes: Lanes): Fiber { | |
clampedEventTime, | ||
blockingEventType, | ||
blockingEventIsRepeat, | ||
blockingSpawnedUpdate, | ||
renderStartTime, | ||
lanes, | ||
); | ||
|
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 restructure this a bit so that we have two separate callbacks depending on if we do the
Scheduler_scheduleCallback
pass or the microtask pass. Because we shouldn't calltrackSchedulerEvent()
if we're inside a microtask callback because that could mark a real event as if it was a scheduler event (and therefore hidden).