@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
69
69
return self;
70
70
}
71
71
72
- var ReactVersion = "18.3.0-www-classic-4f8ffec45-20230115 ";
72
+ var ReactVersion = "18.3.0-www-classic-ee8509801-20230117 ";
73
73
74
74
var LegacyRoot = 0;
75
75
var ConcurrentRoot = 1;
@@ -20273,55 +20273,40 @@ function detachFiberAfterEffects(fiber) {
20273
20273
if (alternate !== null) {
20274
20274
fiber.alternate = null;
20275
20275
detachFiberAfterEffects(alternate);
20276
- } // Note: Defensively using negation instead of < in case
20277
- // `deletedTreeCleanUpLevel` is undefined.
20276
+ } // Clear cyclical Fiber fields. This level alone is designed to roughly
20277
+ // approximate the planned Fiber refactor. In that world, `setState` will be
20278
+ // bound to a special "instance" object instead of a Fiber. The Instance
20279
+ // object will not have any of these fields. It will only be connected to
20280
+ // the fiber tree via a single link at the root. So if this level alone is
20281
+ // sufficient to fix memory issues, that bodes well for our plans.
20278
20282
20279
- {
20280
- // Clear cyclical Fiber fields. This level alone is designed to roughly
20281
- // approximate the planned Fiber refactor. In that world, `setState` will be
20282
- // bound to a special "instance" object instead of a Fiber. The Instance
20283
- // object will not have any of these fields. It will only be connected to
20284
- // the fiber tree via a single link at the root. So if this level alone is
20285
- // sufficient to fix memory issues, that bodes well for our plans.
20286
- fiber.child = null;
20287
- fiber.deletions = null;
20288
- fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
20289
- // tree, which has its own pointers to children, parents, and siblings.
20290
- // The other host nodes also point back to fibers, so we should detach that
20291
- // one, too.
20283
+ fiber.child = null;
20284
+ fiber.deletions = null;
20285
+ fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
20286
+ // tree, which has its own pointers to children, parents, and siblings.
20287
+ // The other host nodes also point back to fibers, so we should detach that
20288
+ // one, too.
20292
20289
20293
- if (fiber.tag === HostComponent) {
20294
- var hostInstance = fiber.stateNode;
20295
- }
20290
+ if (fiber.tag === HostComponent) {
20291
+ var hostInstance = fiber.stateNode;
20292
+ }
20296
20293
20297
- fiber.stateNode = null; // I'm intentionally not clearing the `return` field in this level. We
20298
- // already disconnect the `return` pointer at the root of the deleted
20299
- // subtree (in `detachFiberMutation`). Besides, `return` by itself is not
20300
- // cyclical — it's only cyclical when combined with `child`, `sibling`, and
20301
- // `alternate`. But we'll clear it in the next level anyway, just in case.
20294
+ fiber.stateNode = null;
20302
20295
20303
- {
20304
- fiber._debugOwner = null;
20305
- }
20296
+ {
20297
+ fiber._debugOwner = null;
20298
+ } // Theoretically, nothing in here should be necessary, because we already
20299
+ // disconnected the fiber from the tree. So even if something leaks this
20300
+ // particular fiber, it won't leak anything else.
20306
20301
20307
- {
20308
- // Theoretically, nothing in here should be necessary, because we already
20309
- // disconnected the fiber from the tree. So even if something leaks this
20310
- // particular fiber, it won't leak anything else
20311
- //
20312
- // The purpose of this branch is to be super aggressive so we can measure
20313
- // if there's any difference in memory impact. If there is, that could
20314
- // indicate a React leak we don't know about.
20315
- fiber.return = null;
20316
- fiber.dependencies = null;
20317
- fiber.memoizedProps = null;
20318
- fiber.memoizedState = null;
20319
- fiber.pendingProps = null;
20320
- fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
20302
+ fiber.return = null;
20303
+ fiber.dependencies = null;
20304
+ fiber.memoizedProps = null;
20305
+ fiber.memoizedState = null;
20306
+ fiber.pendingProps = null;
20307
+ fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
20321
20308
20322
- fiber.updateQueue = null;
20323
- }
20324
- }
20309
+ fiber.updateQueue = null;
20325
20310
}
20326
20311
20327
20312
function getHostParentFiber(fiber) {
@@ -22398,33 +22383,31 @@ function commitPassiveUnmountEffects(finishedWork) {
22398
22383
}
22399
22384
22400
22385
function detachAlternateSiblings(parentFiber) {
22401
- {
22402
- // A fiber was deleted from this parent fiber, but it's still part of the
22403
- // previous (alternate) parent fiber's list of children. Because children
22404
- // are a linked list, an earlier sibling that's still alive will be
22405
- // connected to the deleted fiber via its `alternate`:
22406
- //
22407
- // live fiber --alternate--> previous live fiber --sibling--> deleted
22408
- // fiber
22409
- //
22410
- // We can't disconnect `alternate` on nodes that haven't been deleted yet,
22411
- // but we can disconnect the `sibling` and `child` pointers.
22412
- var previousFiber = parentFiber.alternate;
22386
+ // A fiber was deleted from this parent fiber, but it's still part of the
22387
+ // previous (alternate) parent fiber's list of children. Because children
22388
+ // are a linked list, an earlier sibling that's still alive will be
22389
+ // connected to the deleted fiber via its `alternate`:
22390
+ //
22391
+ // live fiber --alternate--> previous live fiber --sibling--> deleted
22392
+ // fiber
22393
+ //
22394
+ // We can't disconnect `alternate` on nodes that haven't been deleted yet,
22395
+ // but we can disconnect the `sibling` and `child` pointers.
22396
+ var previousFiber = parentFiber.alternate;
22413
22397
22414
- if (previousFiber !== null) {
22415
- var detachedChild = previousFiber.child;
22398
+ if (previousFiber !== null) {
22399
+ var detachedChild = previousFiber.child;
22416
22400
22417
- if (detachedChild !== null) {
22418
- previousFiber.child = null;
22401
+ if (detachedChild !== null) {
22402
+ previousFiber.child = null;
22419
22403
22420
- do {
22421
- // $FlowFixMe[incompatible-use] found when upgrading Flow
22422
- var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
22404
+ do {
22405
+ // $FlowFixMe[incompatible-use] found when upgrading Flow
22406
+ var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
22423
22407
22424
- detachedChild.sibling = null;
22425
- detachedChild = detachedSibling;
22426
- } while (detachedChild !== null);
22427
- }
22408
+ detachedChild.sibling = null;
22409
+ detachedChild = detachedSibling;
22410
+ } while (detachedChild !== null);
22428
22411
}
22429
22412
}
22430
22413
}
@@ -22617,8 +22600,7 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
22617
22600
setCurrentFiber(fiber);
22618
22601
commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);
22619
22602
resetCurrentFiber();
22620
- var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag. (But, if we
22621
- // do this, still need to handle `deletedTreeCleanUpLevel` correctly.)
22603
+ var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag.
22622
22604
22623
22605
if (child !== null) {
22624
22606
child.return = fiber;
@@ -22637,18 +22619,15 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(
22637
22619
while (nextEffect !== null) {
22638
22620
var fiber = nextEffect;
22639
22621
var sibling = fiber.sibling;
22640
- var returnFiber = fiber.return;
22622
+ var returnFiber = fiber.return; // Recursively traverse the entire deleted tree and clean up fiber fields.
22623
+ // This is more aggressive than ideal, and the long term goal is to only
22624
+ // have to detach the deleted tree at the root.
22641
22625
22642
- {
22643
- // Recursively traverse the entire deleted tree and clean up fiber fields.
22644
- // This is more aggressive than ideal, and the long term goal is to only
22645
- // have to detach the deleted tree at the root.
22646
- detachFiberAfterEffects(fiber);
22626
+ detachFiberAfterEffects(fiber);
22647
22627
22648
- if (fiber === deletedSubtreeRoot) {
22649
- nextEffect = null;
22650
- return;
22651
- }
22628
+ if (fiber === deletedSubtreeRoot) {
22629
+ nextEffect = null;
22630
+ return;
22652
22631
}
22653
22632
22654
22633
if (sibling !== null) {
0 commit comments