GeezerVison is showing github.com — Remove unused arguments in the reconciler (#18092) · react/react@8b596e0
File treeExpand file treeCollapse file tree Open diff view settings packages/react-reconciler/src
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactChildFiber.js +13-30Lines changed: 13 additions & 30 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -325,14 +325,10 @@ function ChildReconciler(shouldTrackSideEffects) { | 325 | 325 | return existingChildren; | 326 | 326 | } | 327 | 327 |
| 328 | | - function useFiber( | 329 | | - fiber: Fiber, | 330 | | - pendingProps: mixed, | 331 | | - expirationTime: ExpirationTime, | 332 | | - ): Fiber { | | 328 | + function useFiber(fiber: Fiber, pendingProps: mixed): Fiber { | 333 | 329 | // We currently set sibling to null and index to 0 here because it is easy | 334 | 330 | // to forget to do before returning it. E.g. for the single child case. | 335 | | - const clone = createWorkInProgress(fiber, pendingProps, expirationTime); | | 331 | + const clone = createWorkInProgress(fiber, pendingProps); | 336 | 332 | clone.index = 0; | 337 | 333 | clone.sibling = null; | 338 | 334 | return clone; | @@ -392,7 +388,7 @@ function ChildReconciler(shouldTrackSideEffects) { | 392 | 388 | return created; | 393 | 389 | } else { | 394 | 390 | // Update | 395 | | - const existing = useFiber(current, textContent, expirationTime); | | 391 | + const existing = useFiber(current, textContent); | 396 | 392 | existing.return = returnFiber; | 397 | 393 | return existing; | 398 | 394 | } | @@ -411,7 +407,7 @@ function ChildReconciler(shouldTrackSideEffects) { | 411 | 407 | (__DEV__ ? isCompatibleFamilyForHotReloading(current, element) : false) | 412 | 408 | ) { | 413 | 409 | // Move based on index | 414 | | - const existing = useFiber(current, element.props, expirationTime); | | 410 | + const existing = useFiber(current, element.props); | 415 | 411 | existing.ref = coerceRef(returnFiber, current, element); | 416 | 412 | existing.return = returnFiber; | 417 | 413 | if (__DEV__) { | @@ -426,7 +422,7 @@ function ChildReconciler(shouldTrackSideEffects) { | 426 | 422 | element.type.render === current.type.render | 427 | 423 | ) { | 428 | 424 | // Same as above but also update the .type field. | 429 | | - const existing = useFiber(current, element.props, expirationTime); | | 425 | + const existing = useFiber(current, element.props); | 430 | 426 | existing.return = returnFiber; | 431 | 427 | existing.type = element.type; | 432 | 428 | if (__DEV__) { | @@ -469,7 +465,7 @@ function ChildReconciler(shouldTrackSideEffects) { | 469 | 465 | return created; | 470 | 466 | } else { | 471 | 467 | // Update | 472 | | - const existing = useFiber(current, portal.children || [], expirationTime); | | 468 | + const existing = useFiber(current, portal.children || []); | 473 | 469 | existing.return = returnFiber; | 474 | 470 | return existing; | 475 | 471 | } | @@ -494,7 +490,7 @@ function ChildReconciler(shouldTrackSideEffects) { | 494 | 490 | return created; | 495 | 491 | } else { | 496 | 492 | // Update | 497 | | - const existing = useFiber(current, fragment, expirationTime); | | 493 | + const existing = useFiber(current, fragment); | 498 | 494 | existing.return = returnFiber; | 499 | 495 | return existing; | 500 | 496 | } | @@ -1137,7 +1133,7 @@ function ChildReconciler(shouldTrackSideEffects) { | 1137 | 1133 | // We already have an existing node so let's just update it and delete | 1138 | 1134 | // the rest. | 1139 | 1135 | deleteRemainingChildren(returnFiber, currentFirstChild.sibling); | 1140 | | - const existing = useFiber(currentFirstChild, textContent, expirationTime); | | 1136 | + const existing = useFiber(currentFirstChild, textContent); | 1141 | 1137 | existing.return = returnFiber; | 1142 | 1138 | return existing; | 1143 | 1139 | } | @@ -1169,11 +1165,7 @@ function ChildReconciler(shouldTrackSideEffects) { | 1169 | 1165 | case Fragment: { | 1170 | 1166 | if (element.type === REACT_FRAGMENT_TYPE) { | 1171 | 1167 | deleteRemainingChildren(returnFiber, child.sibling); | 1172 | | - const existing = useFiber( | 1173 | | - child, | 1174 | | - element.props.children, | 1175 | | - expirationTime, | 1176 | | - ); | | 1168 | + const existing = useFiber(child, element.props.children); | 1177 | 1169 | existing.return = returnFiber; | 1178 | 1170 | if (__DEV__) { | 1179 | 1171 | existing._debugSource = element._source; | @@ -1190,7 +1182,7 @@ function ChildReconciler(shouldTrackSideEffects) { | 1190 | 1182 | element.type.render === child.type.render | 1191 | 1183 | ) { | 1192 | 1184 | deleteRemainingChildren(returnFiber, child.sibling); | 1193 | | - const existing = useFiber(child, element.props, expirationTime); | | 1185 | + const existing = useFiber(child, element.props); | 1194 | 1186 | existing.type = element.type; | 1195 | 1187 | existing.return = returnFiber; | 1196 | 1188 | if (__DEV__) { | @@ -1211,7 +1203,7 @@ function ChildReconciler(shouldTrackSideEffects) { | 1211 | 1203 | : false) | 1212 | 1204 | ) { | 1213 | 1205 | deleteRemainingChildren(returnFiber, child.sibling); | 1214 | | - const existing = useFiber(child, element.props, expirationTime); | | 1206 | + const existing = useFiber(child, element.props); | 1215 | 1207 | existing.ref = coerceRef(returnFiber, child, element); | 1216 | 1208 | existing.return = returnFiber; | 1217 | 1209 | if (__DEV__) { | @@ -1271,11 +1263,7 @@ function ChildReconciler(shouldTrackSideEffects) { | 1271 | 1263 | child.stateNode.implementation === portal.implementation | 1272 | 1264 | ) { | 1273 | 1265 | deleteRemainingChildren(returnFiber, child.sibling); | 1274 | | - const existing = useFiber( | 1275 | | - child, | 1276 | | - portal.children || [], | 1277 | | - expirationTime, | 1278 | | - ); | | 1266 | + const existing = useFiber(child, portal.children || []); | 1279 | 1267 | existing.return = returnFiber; | 1280 | 1268 | return existing; | 1281 | 1269 | } else { | @@ -1441,11 +1429,7 @@ export function cloneChildFibers( | 1441 | 1429 | } | 1442 | 1430 |
| 1443 | 1431 | let currentChild = workInProgress.child; | 1444 | | - let newChild = createWorkInProgress( | 1445 | | - currentChild, | 1446 | | - currentChild.pendingProps, | 1447 | | - currentChild.expirationTime, | 1448 | | - ); | | 1432 | + let newChild = createWorkInProgress(currentChild, currentChild.pendingProps); | 1449 | 1433 | workInProgress.child = newChild; | 1450 | 1434 |
| 1451 | 1435 | newChild.return = workInProgress; | @@ -1454,7 +1438,6 @@ export function cloneChildFibers( | 1454 | 1438 | newChild = newChild.sibling = createWorkInProgress( | 1455 | 1439 | currentChild, | 1456 | 1440 | currentChild.pendingProps, | 1457 | | - currentChild.expirationTime, | 1458 | 1441 | ); | 1459 | 1442 | newChild.return = workInProgress; | 1460 | 1443 | } | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiber.js +1-5Lines changed: 1 addition & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -401,11 +401,7 @@ export function resolveLazyComponentTag(Component: Function): WorkTag { | 401 | 401 | } | 402 | 402 |
| 403 | 403 | // This is used to create an alternate fiber to do work on. | 404 | | -export function createWorkInProgress( | 405 | | - current: Fiber, | 406 | | - pendingProps: any, | 407 | | - expirationTime: ExpirationTime, | 408 | | -): Fiber { | | 404 | +export function createWorkInProgress(current: Fiber, pendingProps: any): Fiber { | 409 | 405 | let workInProgress = current.alternate; | 410 | 406 | if (workInProgress === null) { | 411 | 407 | // We use a double buffering pooling technique because we know that we'll | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberBeginWork.js +3-19Lines changed: 3 additions & 19 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -466,11 +466,7 @@ function updateMemoComponent( | 466 | 466 | } | 467 | 467 | // React DevTools reads this flag. | 468 | 468 | workInProgress.effectTag |= PerformedWork; | 469 | | - let newChild = createWorkInProgress( | 470 | | - currentChild, | 471 | | - nextProps, | 472 | | - renderExpirationTime, | 473 | | - ); | | 469 | + let newChild = createWorkInProgress(currentChild, nextProps); | 474 | 470 | newChild.ref = workInProgress.ref; | 475 | 471 | newChild.return = workInProgress; | 476 | 472 | workInProgress.child = newChild; | @@ -831,12 +827,7 @@ function updateClassComponent( | 831 | 827 | workInProgress.effectTag |= Placement; | 832 | 828 | } | 833 | 829 | // In the initial pass we might need to construct the instance. | 834 | | - constructClassInstance( | 835 | | - workInProgress, | 836 | | - Component, | 837 | | - nextProps, | 838 | | - renderExpirationTime, | 839 | | - ); | | 830 | + constructClassInstance(workInProgress, Component, nextProps); | 840 | 831 | mountClassInstance( | 841 | 832 | workInProgress, | 842 | 833 | Component, | @@ -1296,12 +1287,7 @@ function mountIncompleteClassComponent( | 1296 | 1287 | } | 1297 | 1288 | prepareToReadContext(workInProgress, renderExpirationTime); | 1298 | 1289 |
| 1299 | | - constructClassInstance( | 1300 | | - workInProgress, | 1301 | | - Component, | 1302 | | - nextProps, | 1303 | | - renderExpirationTime, | 1304 | | - ); | | 1290 | + constructClassInstance(workInProgress, Component, nextProps); | 1305 | 1291 | mountClassInstance( | 1306 | 1292 | workInProgress, | 1307 | 1293 | Component, | @@ -1871,7 +1857,6 @@ function updateSuspenseComponent( | 1871 | 1857 | const primaryChildFragment = createWorkInProgress( | 1872 | 1858 | currentPrimaryChildFragment, | 1873 | 1859 | currentPrimaryChildFragment.pendingProps, | 1874 | | - NoWork, | 1875 | 1860 | ); | 1876 | 1861 | primaryChildFragment.return = workInProgress; | 1877 | 1862 |
| @@ -1911,7 +1896,6 @@ function updateSuspenseComponent( | 1911 | 1896 | const fallbackChildFragment = createWorkInProgress( | 1912 | 1897 | currentFallbackChildFragment, | 1913 | 1898 | nextFallbackChildren, | 1914 | | - currentFallbackChildFragment.expirationTime, | 1915 | 1899 | ); | 1916 | 1900 | fallbackChildFragment.return = workInProgress; | 1917 | 1901 | primaryChildFragment.sibling = fallbackChildFragment; | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberClassComponent.js -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -535,7 +535,6 @@ function constructClassInstance( | 535 | 535 | workInProgress: Fiber, | 536 | 536 | ctor: any, | 537 | 537 | props: any, | 538 | | - renderExpirationTime: ExpirationTime, | 539 | 538 | ): any { | 540 | 539 | let isLegacyContextConsumer = false; | 541 | 540 | let unmaskedContext = emptyContextObject; | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberCommitWork.js +2-12Lines changed: 2 additions & 12 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -576,12 +576,7 @@ function commitLifeCycles( | 576 | 576 | // We could update instance props and state here, | 577 | 577 | // but instead we rely on them being set during last render. | 578 | 578 | // TODO: revisit this when we implement resuming. | 579 | | - commitUpdateQueue( | 580 | | - finishedWork, | 581 | | - updateQueue, | 582 | | - instance, | 583 | | - committedExpirationTime, | 584 | | - ); | | 579 | + commitUpdateQueue(finishedWork, updateQueue, instance); | 585 | 580 | } | 586 | 581 | return; | 587 | 582 | } | @@ -599,12 +594,7 @@ function commitLifeCycles( | 599 | 594 | break; | 600 | 595 | } | 601 | 596 | } | 602 | | - commitUpdateQueue( | 603 | | - finishedWork, | 604 | | - updateQueue, | 605 | | - instance, | 606 | | - committedExpirationTime, | 607 | | - ); | | 597 | + commitUpdateQueue(finishedWork, updateQueue, instance); | 608 | 598 | } | 609 | 599 | return; | 610 | 600 | } | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberWorkLoop.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -1252,7 +1252,7 @@ function prepareFreshStack(root, expirationTime) { | 1252 | 1252 | } | 1253 | 1253 | } | 1254 | 1254 | workInProgressRoot = root; | 1255 | | - workInProgress = createWorkInProgress(root.current, null, expirationTime); | | 1255 | + workInProgress = createWorkInProgress(root.current, null); | 1256 | 1256 | renderExpirationTime = expirationTime; | 1257 | 1257 | workInProgressRootExitStatus = RootIncomplete; | 1258 | 1258 | workInProgressRootFatalError = null; | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactUpdateQueue.js -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -528,7 +528,6 @@ export function commitUpdateQueue<State>( | 528 | 528 | finishedWork: Fiber, | 529 | 529 | finishedQueue: UpdateQueue<State>, | 530 | 530 | instance: any, | 531 | | - renderExpirationTime: ExpirationTime, | 532 | 531 | ): void { | 533 | 532 | // Commit the effects | 534 | 533 | const effects = finishedQueue.effects; | |
|