@@ -58,11 +58,11 @@ import ReactFiberHydrationContext from './ReactFiberHydrationContext';
58
58
import ReactFiberInstrumentation from './ReactFiberInstrumentation' ;
59
59
import ReactDebugCurrentFiber from './ReactDebugCurrentFiber' ;
60
60
import {
61
- addPendingWork ,
62
- flushPendingWork ,
63
- findNextExpirationTimeToWorkOn ,
64
- suspendPendingWork ,
65
- resumePendingWork ,
61
+ addPendingPriorityLevel ,
62
+ flushPendingPriorityLevel ,
63
+ findNextPendingPriorityLevel ,
64
+ suspendPriorityLevel ,
65
+ resumePriorityLevel ,
66
66
} from './ReactFiberPendingPriority' ;
67
67
import {
68
68
recordEffect ,
@@ -260,7 +260,7 @@ export default function<T, P, I, TI, HI, PI, C, CC, CX, PL>(
260
260
let nextRoot : FiberRoot | null = null ;
261
261
// The time at which we're currently rendering work.
262
262
let nextRenderExpirationTime : ExpirationTime = NoWork ;
263
- let nextEarliestTimeoutMs : number = - 1 ;
263
+ let nextLatestTimeoutMs : number = - 1 ;
264
264
let nextRenderIsExpired : boolean = false ;
265
265
266
266
// The next fiber with an effect that we're currently committing.
@@ -358,7 +358,7 @@ export default function<T, P, I, TI, HI, PI, C, CC, CX, PL>(
358
358
359
359
nextRoot = null ;
360
360
nextRenderExpirationTime = NoWork ;
361
- nextEarliestTimeoutMs = - 1 ;
361
+ nextLatestTimeoutMs = - 1 ;
362
362
nextRenderIsExpired = false ;
363
363
nextUnitOfWork = null ;
364
364
@@ -684,8 +684,8 @@ export default function<T, P, I, TI, HI, PI, C, CC, CX, PL>(
684
684
ReactFiberInstrumentation . debugTool . onCommitWork ( finishedWork ) ;
685
685
}
686
686
687
- flushPendingWork ( root , currentTime , root . current . expirationTime ) ;
688
- const remainingTime = findNextExpirationTimeToWorkOn ( root ) ;
687
+ flushPendingPriorityLevel ( root , currentTime , root . current . expirationTime ) ;
688
+ const remainingTime = findNextPendingPriorityLevel ( root ) ;
689
689
if ( remainingTime === NoWork ) {
690
690
// If there's no remaining work, we can clear the set of already failed
691
691
// error boundaries.
@@ -970,7 +970,7 @@ export default function<T, P, I, TI, HI, PI, C, CC, CX, PL>(
970
970
resetStack ( ) ;
971
971
nextRoot = root ;
972
972
nextRenderExpirationTime = expirationTime ;
973
- nextEarliestTimeoutMs = - 1 ;
973
+ nextLatestTimeoutMs = - 1 ;
974
974
nextUnitOfWork = createWorkInProgress (
975
975
nextRoot . current ,
976
976
null ,
@@ -1067,15 +1067,13 @@ export default function<T, P, I, TI, HI, PI, C, CC, CX, PL>(
1067
1067
'Expired work should have completed. This error is likely caused ' +
1068
1068
'by a bug in React. Please file an issue.' ,
1069
1069
) ;
1070
- suspendPendingWork ( root , expirationTime ) ;
1071
- if ( nextEarliestTimeoutMs >= 0 ) {
1070
+ suspendPriorityLevel ( root , expirationTime ) ;
1071
+ if ( nextLatestTimeoutMs >= 0 ) {
1072
1072
setTimeout ( ( ) => {
1073
1073
retrySuspendedRoot ( root , expirationTime ) ;
1074
- } , nextEarliestTimeoutMs ) ;
1074
+ } , nextLatestTimeoutMs ) ;
1075
1075
}
1076
- const firstUnblockedExpirationTime = findNextExpirationTimeToWorkOn (
1077
- root ,
1078
- ) ;
1076
+ const firstUnblockedExpirationTime = findNextPendingPriorityLevel ( root ) ;
1079
1077
onBlock ( firstUnblockedExpirationTime ) ;
1080
1078
return null ;
1081
1079
}
@@ -1254,17 +1252,14 @@ export default function<T, P, I, TI, HI, PI, C, CC, CX, PL>(
1254
1252
suspendedTime : ExpirationTime ,
1255
1253
) {
1256
1254
// Schedule the timeout.
1257
- if (
1258
- timeoutMs >= 0 &&
1259
- ( nextEarliestTimeoutMs === - 1 || timeoutMs < nextEarliestTimeoutMs )
1260
- ) {
1261
- nextEarliestTimeoutMs = timeoutMs ;
1255
+ if ( timeoutMs >= 0 && nextLatestTimeoutMs < timeoutMs ) {
1256
+ nextLatestTimeoutMs = timeoutMs ;
1262
1257
}
1263
1258
}
1264
1259
1265
1260
function retrySuspendedRoot ( root , suspendedTime ) {
1266
- resumePendingWork ( root , suspendedTime ) ;
1267
- const retryTime = findNextExpirationTimeToWorkOn ( root ) ;
1261
+ resumePriorityLevel ( root , suspendedTime ) ;
1262
+ const retryTime = findNextPendingPriorityLevel ( root ) ;
1268
1263
if ( retryTime !== NoWork ) {
1269
1264
requestRetry ( root , retryTime ) ;
1270
1265
}
@@ -1310,10 +1305,8 @@ export default function<T, P, I, TI, HI, PI, C, CC, CX, PL>(
1310
1305
interruptedBy = fiber ;
1311
1306
resetStack ( ) ;
1312
1307
}
1313
- addPendingWork ( root , expirationTime ) ;
1314
- const nextExpirationTimeToWorkOn = findNextExpirationTimeToWorkOn (
1315
- root ,
1316
- ) ;
1308
+ addPendingPriorityLevel ( root , expirationTime ) ;
1309
+ const nextExpirationTimeToWorkOn = findNextPendingPriorityLevel ( root ) ;
1317
1310
if (
1318
1311
// If we're in the render phase, we don't need to schedule this root
1319
1312
// for an update, because we'll do it before we exit...
0 commit comments