@@ -323,21 +323,6 @@ let mostRecentlyUpdatedRoot: FiberRoot | null = null;
323323let globalMostRecentFallbackTime: number = 0;
324324const FALLBACK_THROTTLE_MS: number = 500;
325325
326- // The absolute time for when we should start giving up on rendering
327- // more and prefer CPU suspense heuristics instead.
328- let workInProgressRootRenderTargetTime: number = Infinity;
329- // How long a render is supposed to take before we start following CPU
330- // suspense heuristics and opt out of rendering more content.
331- const RENDER_TIMEOUT_MS = 500;
332-
333- function resetRenderTimer() {
334- workInProgressRootRenderTargetTime = now ( ) + RENDER_TIMEOUT_MS ;
335- }
336-
337- export function getRenderTargetTime(): number {
338- return workInProgressRootRenderTargetTime ;
339- }
340-
341326let hasUncaughtError = false;
342327let firstUncaughtError = null;
343328let legacyErrorBoundariesThatAlreadyFailed: Set< mixed > | null = null;
@@ -597,7 +582,6 @@ export function scheduleUpdateOnFiber(
597582 // scheduleCallbackForFiber to preserve the ability to schedule a callback
598583 // without immediately flushing it. We only do this for user-initiated
599584 // updates, to preserve historical behavior of legacy mode.
600- resetRenderTimer ( ) ;
601585 flushSyncCallbackQueue ( ) ;
602586 }
603587 }
@@ -1061,7 +1045,6 @@ export function flushRoot(root: FiberRoot, lanes: Lanes) {
10611045 markRootExpired ( root , lanes ) ;
10621046 ensureRootIsScheduled ( root , now ( ) ) ;
10631047 if ( ( executionContext & ( RenderContext | CommitContext ) ) === NoContext ) {
1064- resetRenderTimer ( ) ;
10651048 flushSyncCallbackQueue ( ) ;
10661049 }
10671050}
@@ -1136,7 +1119,6 @@ export function batchedUpdates<A, R>(fn: A => R, a: A): R {
11361119 executionContext = prevExecutionContext ;
11371120 if ( executionContext === NoContext ) {
11381121 // Flush the immediate callbacks that were scheduled during this batch
1139- resetRenderTimer ( ) ;
11401122 flushSyncCallbackQueue ( ) ;
11411123 }
11421124 }
@@ -1151,7 +1133,6 @@ export function batchedEventUpdates<A, R>(fn: A => R, a: A): R {
11511133 executionContext = prevExecutionContext ;
11521134 if ( executionContext === NoContext ) {
11531135 // Flush the immediate callbacks that were scheduled during this batch
1154- resetRenderTimer ( ) ;
11551136 flushSyncCallbackQueue ( ) ;
11561137 }
11571138 }
@@ -1180,7 +1161,6 @@ export function discreteUpdates<A, B, C, D, R>(
11801161 executionContext = prevExecutionContext ;
11811162 if ( executionContext === NoContext ) {
11821163 // Flush the immediate callbacks that were scheduled during this batch
1183- resetRenderTimer ( ) ;
11841164 flushSyncCallbackQueue ( ) ;
11851165 }
11861166 }
@@ -1194,7 +1174,6 @@ export function discreteUpdates<A, B, C, D, R>(
11941174 executionContext = prevExecutionContext ;
11951175 if ( executionContext === NoContext ) {
11961176 // Flush the immediate callbacks that were scheduled during this batch
1197- resetRenderTimer ( ) ;
11981177 flushSyncCallbackQueue ( ) ;
11991178 }
12001179 }
@@ -1211,7 +1190,6 @@ export function unbatchedUpdates<A, R>(fn: (a: A) => R, a: A): R {
12111190 executionContext = prevExecutionContext ;
12121191 if ( executionContext === NoContext ) {
12131192 // Flush the immediate callbacks that were scheduled during this batch
1214- resetRenderTimer ( ) ;
12151193 flushSyncCallbackQueue ( ) ;
12161194 }
12171195 }
@@ -1279,7 +1257,6 @@ export function flushControlled(fn: () => mixed): void {
12791257 executionContext = prevExecutionContext ;
12801258 if ( executionContext === NoContext ) {
12811259 // Flush the immediate callbacks that were scheduled during this batch
1282- resetRenderTimer ( ) ;
12831260 flushSyncCallbackQueue ( ) ;
12841261 }
12851262 }
@@ -1290,7 +1267,6 @@ export function flushControlled(fn: () => mixed): void {
12901267 executionContext = prevExecutionContext ;
12911268 if ( executionContext === NoContext ) {
12921269 // Flush the immediate callbacks that were scheduled during this batch
1293- resetRenderTimer ( ) ;
12941270 flushSyncCallbackQueue ( ) ;
12951271 }
12961272 }
@@ -1583,7 +1559,6 @@ function renderRootConcurrent(root: FiberRoot, lanes: Lanes) {
15831559 // If the root or lanes have changed, throw out the existing stack
15841560 // and prepare a fresh one. Otherwise we'll continue where we left off.
15851561 if ( workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes ) {
1586- resetRenderTimer ( ) ;
15871562 prepareFreshStack ( root , lanes ) ;
15881563 startWorkOnPendingInteractions ( root , lanes ) ;
15891564 }
0 commit comments