mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[cleanup] remove deletedTreeCleanUpLevel feature flag (#25529)
I noticed this was an experiment concluded 16 months ago (#21679) that
this extra work is beneficial
to break up cycles leaking memory in product code.
DiffTrain build for [ee85098019](https://github.com/facebook/react/commit/ee85098019bf9703b32f608f8bbd5f8fb1a7d60b)
[View git log for this commit](https://github.com/facebook/react/commits/ee85098019bf9703b32f608f8bbd5f8fb1a7d60b)
This commit is contained in:
@@ -1 +1 @@
|
||||
4f8ffec453c41fcb6e98cb4e003f7319bb1c81b9
|
||||
ee85098019bf9703b32f608f8bbd5f8fb1a7d60b
|
||||
|
||||
@@ -1 +1 @@
|
||||
4f8ffec453c41fcb6e98cb4e003f7319bb1c81b9
|
||||
ee85098019bf9703b32f608f8bbd5f8fb1a7d60b
|
||||
|
||||
@@ -27,7 +27,7 @@ if (
|
||||
}
|
||||
"use strict";
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-4f8ffec45-20230115";
|
||||
var ReactVersion = "18.3.0-www-classic-ee8509801-20230117";
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
|
||||
@@ -27,7 +27,7 @@ if (
|
||||
}
|
||||
"use strict";
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-4f8ffec45-20230115";
|
||||
var ReactVersion = "18.3.0-www-modern-ee8509801-20230117";
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
|
||||
@@ -643,4 +643,4 @@ exports.useSyncExternalStore = function(
|
||||
);
|
||||
};
|
||||
exports.useTransition = useTransition;
|
||||
exports.version = "18.3.0-www-classic-4f8ffec45-20230115";
|
||||
exports.version = "18.3.0-www-classic-ee8509801-20230117";
|
||||
|
||||
@@ -635,4 +635,4 @@ exports.useSyncExternalStore = function(
|
||||
);
|
||||
};
|
||||
exports.useTransition = useTransition;
|
||||
exports.version = "18.3.0-www-modern-4f8ffec45-20230115";
|
||||
exports.version = "18.3.0-www-modern-ee8509801-20230117";
|
||||
|
||||
@@ -654,7 +654,7 @@ exports.useSyncExternalStore = function(
|
||||
);
|
||||
};
|
||||
exports.useTransition = useTransition;
|
||||
exports.version = "18.3.0-www-classic-4f8ffec45-20230115";
|
||||
exports.version = "18.3.0-www-classic-ee8509801-20230117";
|
||||
|
||||
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
||||
if (
|
||||
|
||||
@@ -646,7 +646,7 @@ exports.useSyncExternalStore = function(
|
||||
);
|
||||
};
|
||||
exports.useTransition = useTransition;
|
||||
exports.version = "18.3.0-www-modern-4f8ffec45-20230115";
|
||||
exports.version = "18.3.0-www-modern-ee8509801-20230117";
|
||||
|
||||
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
||||
if (
|
||||
|
||||
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-4f8ffec45-20230115";
|
||||
var ReactVersion = "18.3.0-www-classic-ee8509801-20230117";
|
||||
|
||||
var LegacyRoot = 0;
|
||||
var ConcurrentRoot = 1;
|
||||
@@ -20273,55 +20273,40 @@ function detachFiberAfterEffects(fiber) {
|
||||
if (alternate !== null) {
|
||||
fiber.alternate = null;
|
||||
detachFiberAfterEffects(alternate);
|
||||
} // Note: Defensively using negation instead of < in case
|
||||
// `deletedTreeCleanUpLevel` is undefined.
|
||||
} // Clear cyclical Fiber fields. This level alone is designed to roughly
|
||||
// approximate the planned Fiber refactor. In that world, `setState` will be
|
||||
// bound to a special "instance" object instead of a Fiber. The Instance
|
||||
// object will not have any of these fields. It will only be connected to
|
||||
// the fiber tree via a single link at the root. So if this level alone is
|
||||
// sufficient to fix memory issues, that bodes well for our plans.
|
||||
|
||||
fiber.child = null;
|
||||
fiber.deletions = null;
|
||||
fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
|
||||
// tree, which has its own pointers to children, parents, and siblings.
|
||||
// The other host nodes also point back to fibers, so we should detach that
|
||||
// one, too.
|
||||
|
||||
if (fiber.tag === HostComponent) {
|
||||
var hostInstance = fiber.stateNode;
|
||||
}
|
||||
|
||||
fiber.stateNode = null;
|
||||
|
||||
{
|
||||
// Clear cyclical Fiber fields. This level alone is designed to roughly
|
||||
// approximate the planned Fiber refactor. In that world, `setState` will be
|
||||
// bound to a special "instance" object instead of a Fiber. The Instance
|
||||
// object will not have any of these fields. It will only be connected to
|
||||
// the fiber tree via a single link at the root. So if this level alone is
|
||||
// sufficient to fix memory issues, that bodes well for our plans.
|
||||
fiber.child = null;
|
||||
fiber.deletions = null;
|
||||
fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
|
||||
// tree, which has its own pointers to children, parents, and siblings.
|
||||
// The other host nodes also point back to fibers, so we should detach that
|
||||
// one, too.
|
||||
fiber._debugOwner = null;
|
||||
} // Theoretically, nothing in here should be necessary, because we already
|
||||
// disconnected the fiber from the tree. So even if something leaks this
|
||||
// particular fiber, it won't leak anything else.
|
||||
|
||||
if (fiber.tag === HostComponent) {
|
||||
var hostInstance = fiber.stateNode;
|
||||
}
|
||||
fiber.return = null;
|
||||
fiber.dependencies = null;
|
||||
fiber.memoizedProps = null;
|
||||
fiber.memoizedState = null;
|
||||
fiber.pendingProps = null;
|
||||
fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
|
||||
|
||||
fiber.stateNode = null; // I'm intentionally not clearing the `return` field in this level. We
|
||||
// already disconnect the `return` pointer at the root of the deleted
|
||||
// subtree (in `detachFiberMutation`). Besides, `return` by itself is not
|
||||
// cyclical — it's only cyclical when combined with `child`, `sibling`, and
|
||||
// `alternate`. But we'll clear it in the next level anyway, just in case.
|
||||
|
||||
{
|
||||
fiber._debugOwner = null;
|
||||
}
|
||||
|
||||
{
|
||||
// Theoretically, nothing in here should be necessary, because we already
|
||||
// disconnected the fiber from the tree. So even if something leaks this
|
||||
// particular fiber, it won't leak anything else
|
||||
//
|
||||
// The purpose of this branch is to be super aggressive so we can measure
|
||||
// if there's any difference in memory impact. If there is, that could
|
||||
// indicate a React leak we don't know about.
|
||||
fiber.return = null;
|
||||
fiber.dependencies = null;
|
||||
fiber.memoizedProps = null;
|
||||
fiber.memoizedState = null;
|
||||
fiber.pendingProps = null;
|
||||
fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
|
||||
|
||||
fiber.updateQueue = null;
|
||||
}
|
||||
}
|
||||
fiber.updateQueue = null;
|
||||
}
|
||||
|
||||
function getHostParentFiber(fiber) {
|
||||
@@ -22398,33 +22383,31 @@ function commitPassiveUnmountEffects(finishedWork) {
|
||||
}
|
||||
|
||||
function detachAlternateSiblings(parentFiber) {
|
||||
{
|
||||
// A fiber was deleted from this parent fiber, but it's still part of the
|
||||
// previous (alternate) parent fiber's list of children. Because children
|
||||
// are a linked list, an earlier sibling that's still alive will be
|
||||
// connected to the deleted fiber via its `alternate`:
|
||||
//
|
||||
// live fiber --alternate--> previous live fiber --sibling--> deleted
|
||||
// fiber
|
||||
//
|
||||
// We can't disconnect `alternate` on nodes that haven't been deleted yet,
|
||||
// but we can disconnect the `sibling` and `child` pointers.
|
||||
var previousFiber = parentFiber.alternate;
|
||||
// A fiber was deleted from this parent fiber, but it's still part of the
|
||||
// previous (alternate) parent fiber's list of children. Because children
|
||||
// are a linked list, an earlier sibling that's still alive will be
|
||||
// connected to the deleted fiber via its `alternate`:
|
||||
//
|
||||
// live fiber --alternate--> previous live fiber --sibling--> deleted
|
||||
// fiber
|
||||
//
|
||||
// We can't disconnect `alternate` on nodes that haven't been deleted yet,
|
||||
// but we can disconnect the `sibling` and `child` pointers.
|
||||
var previousFiber = parentFiber.alternate;
|
||||
|
||||
if (previousFiber !== null) {
|
||||
var detachedChild = previousFiber.child;
|
||||
if (previousFiber !== null) {
|
||||
var detachedChild = previousFiber.child;
|
||||
|
||||
if (detachedChild !== null) {
|
||||
previousFiber.child = null;
|
||||
if (detachedChild !== null) {
|
||||
previousFiber.child = null;
|
||||
|
||||
do {
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
do {
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
|
||||
detachedChild.sibling = null;
|
||||
detachedChild = detachedSibling;
|
||||
} while (detachedChild !== null);
|
||||
}
|
||||
detachedChild.sibling = null;
|
||||
detachedChild = detachedSibling;
|
||||
} while (detachedChild !== null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22617,8 +22600,7 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
|
||||
setCurrentFiber(fiber);
|
||||
commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);
|
||||
resetCurrentFiber();
|
||||
var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag. (But, if we
|
||||
// do this, still need to handle `deletedTreeCleanUpLevel` correctly.)
|
||||
var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag.
|
||||
|
||||
if (child !== null) {
|
||||
child.return = fiber;
|
||||
@@ -22637,18 +22619,15 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(
|
||||
while (nextEffect !== null) {
|
||||
var fiber = nextEffect;
|
||||
var sibling = fiber.sibling;
|
||||
var returnFiber = fiber.return;
|
||||
var returnFiber = fiber.return; // Recursively traverse the entire deleted tree and clean up fiber fields.
|
||||
// This is more aggressive than ideal, and the long term goal is to only
|
||||
// have to detach the deleted tree at the root.
|
||||
|
||||
{
|
||||
// Recursively traverse the entire deleted tree and clean up fiber fields.
|
||||
// This is more aggressive than ideal, and the long term goal is to only
|
||||
// have to detach the deleted tree at the root.
|
||||
detachFiberAfterEffects(fiber);
|
||||
detachFiberAfterEffects(fiber);
|
||||
|
||||
if (fiber === deletedSubtreeRoot) {
|
||||
nextEffect = null;
|
||||
return;
|
||||
}
|
||||
if (fiber === deletedSubtreeRoot) {
|
||||
nextEffect = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (sibling !== null) {
|
||||
|
||||
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-4f8ffec45-20230115";
|
||||
var ReactVersion = "18.3.0-www-modern-ee8509801-20230117";
|
||||
|
||||
var LegacyRoot = 0;
|
||||
var ConcurrentRoot = 1;
|
||||
@@ -19962,55 +19962,40 @@ function detachFiberAfterEffects(fiber) {
|
||||
if (alternate !== null) {
|
||||
fiber.alternate = null;
|
||||
detachFiberAfterEffects(alternate);
|
||||
} // Note: Defensively using negation instead of < in case
|
||||
// `deletedTreeCleanUpLevel` is undefined.
|
||||
} // Clear cyclical Fiber fields. This level alone is designed to roughly
|
||||
// approximate the planned Fiber refactor. In that world, `setState` will be
|
||||
// bound to a special "instance" object instead of a Fiber. The Instance
|
||||
// object will not have any of these fields. It will only be connected to
|
||||
// the fiber tree via a single link at the root. So if this level alone is
|
||||
// sufficient to fix memory issues, that bodes well for our plans.
|
||||
|
||||
fiber.child = null;
|
||||
fiber.deletions = null;
|
||||
fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
|
||||
// tree, which has its own pointers to children, parents, and siblings.
|
||||
// The other host nodes also point back to fibers, so we should detach that
|
||||
// one, too.
|
||||
|
||||
if (fiber.tag === HostComponent) {
|
||||
var hostInstance = fiber.stateNode;
|
||||
}
|
||||
|
||||
fiber.stateNode = null;
|
||||
|
||||
{
|
||||
// Clear cyclical Fiber fields. This level alone is designed to roughly
|
||||
// approximate the planned Fiber refactor. In that world, `setState` will be
|
||||
// bound to a special "instance" object instead of a Fiber. The Instance
|
||||
// object will not have any of these fields. It will only be connected to
|
||||
// the fiber tree via a single link at the root. So if this level alone is
|
||||
// sufficient to fix memory issues, that bodes well for our plans.
|
||||
fiber.child = null;
|
||||
fiber.deletions = null;
|
||||
fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
|
||||
// tree, which has its own pointers to children, parents, and siblings.
|
||||
// The other host nodes also point back to fibers, so we should detach that
|
||||
// one, too.
|
||||
fiber._debugOwner = null;
|
||||
} // Theoretically, nothing in here should be necessary, because we already
|
||||
// disconnected the fiber from the tree. So even if something leaks this
|
||||
// particular fiber, it won't leak anything else.
|
||||
|
||||
if (fiber.tag === HostComponent) {
|
||||
var hostInstance = fiber.stateNode;
|
||||
}
|
||||
fiber.return = null;
|
||||
fiber.dependencies = null;
|
||||
fiber.memoizedProps = null;
|
||||
fiber.memoizedState = null;
|
||||
fiber.pendingProps = null;
|
||||
fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
|
||||
|
||||
fiber.stateNode = null; // I'm intentionally not clearing the `return` field in this level. We
|
||||
// already disconnect the `return` pointer at the root of the deleted
|
||||
// subtree (in `detachFiberMutation`). Besides, `return` by itself is not
|
||||
// cyclical — it's only cyclical when combined with `child`, `sibling`, and
|
||||
// `alternate`. But we'll clear it in the next level anyway, just in case.
|
||||
|
||||
{
|
||||
fiber._debugOwner = null;
|
||||
}
|
||||
|
||||
{
|
||||
// Theoretically, nothing in here should be necessary, because we already
|
||||
// disconnected the fiber from the tree. So even if something leaks this
|
||||
// particular fiber, it won't leak anything else
|
||||
//
|
||||
// The purpose of this branch is to be super aggressive so we can measure
|
||||
// if there's any difference in memory impact. If there is, that could
|
||||
// indicate a React leak we don't know about.
|
||||
fiber.return = null;
|
||||
fiber.dependencies = null;
|
||||
fiber.memoizedProps = null;
|
||||
fiber.memoizedState = null;
|
||||
fiber.pendingProps = null;
|
||||
fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
|
||||
|
||||
fiber.updateQueue = null;
|
||||
}
|
||||
}
|
||||
fiber.updateQueue = null;
|
||||
}
|
||||
|
||||
function getHostParentFiber(fiber) {
|
||||
@@ -22087,33 +22072,31 @@ function commitPassiveUnmountEffects(finishedWork) {
|
||||
}
|
||||
|
||||
function detachAlternateSiblings(parentFiber) {
|
||||
{
|
||||
// A fiber was deleted from this parent fiber, but it's still part of the
|
||||
// previous (alternate) parent fiber's list of children. Because children
|
||||
// are a linked list, an earlier sibling that's still alive will be
|
||||
// connected to the deleted fiber via its `alternate`:
|
||||
//
|
||||
// live fiber --alternate--> previous live fiber --sibling--> deleted
|
||||
// fiber
|
||||
//
|
||||
// We can't disconnect `alternate` on nodes that haven't been deleted yet,
|
||||
// but we can disconnect the `sibling` and `child` pointers.
|
||||
var previousFiber = parentFiber.alternate;
|
||||
// A fiber was deleted from this parent fiber, but it's still part of the
|
||||
// previous (alternate) parent fiber's list of children. Because children
|
||||
// are a linked list, an earlier sibling that's still alive will be
|
||||
// connected to the deleted fiber via its `alternate`:
|
||||
//
|
||||
// live fiber --alternate--> previous live fiber --sibling--> deleted
|
||||
// fiber
|
||||
//
|
||||
// We can't disconnect `alternate` on nodes that haven't been deleted yet,
|
||||
// but we can disconnect the `sibling` and `child` pointers.
|
||||
var previousFiber = parentFiber.alternate;
|
||||
|
||||
if (previousFiber !== null) {
|
||||
var detachedChild = previousFiber.child;
|
||||
if (previousFiber !== null) {
|
||||
var detachedChild = previousFiber.child;
|
||||
|
||||
if (detachedChild !== null) {
|
||||
previousFiber.child = null;
|
||||
if (detachedChild !== null) {
|
||||
previousFiber.child = null;
|
||||
|
||||
do {
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
do {
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
|
||||
detachedChild.sibling = null;
|
||||
detachedChild = detachedSibling;
|
||||
} while (detachedChild !== null);
|
||||
}
|
||||
detachedChild.sibling = null;
|
||||
detachedChild = detachedSibling;
|
||||
} while (detachedChild !== null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22306,8 +22289,7 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
|
||||
setCurrentFiber(fiber);
|
||||
commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);
|
||||
resetCurrentFiber();
|
||||
var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag. (But, if we
|
||||
// do this, still need to handle `deletedTreeCleanUpLevel` correctly.)
|
||||
var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag.
|
||||
|
||||
if (child !== null) {
|
||||
child.return = fiber;
|
||||
@@ -22326,18 +22308,15 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(
|
||||
while (nextEffect !== null) {
|
||||
var fiber = nextEffect;
|
||||
var sibling = fiber.sibling;
|
||||
var returnFiber = fiber.return;
|
||||
var returnFiber = fiber.return; // Recursively traverse the entire deleted tree and clean up fiber fields.
|
||||
// This is more aggressive than ideal, and the long term goal is to only
|
||||
// have to detach the deleted tree at the root.
|
||||
|
||||
{
|
||||
// Recursively traverse the entire deleted tree and clean up fiber fields.
|
||||
// This is more aggressive than ideal, and the long term goal is to only
|
||||
// have to detach the deleted tree at the root.
|
||||
detachFiberAfterEffects(fiber);
|
||||
detachFiberAfterEffects(fiber);
|
||||
|
||||
if (fiber === deletedSubtreeRoot) {
|
||||
nextEffect = null;
|
||||
return;
|
||||
}
|
||||
if (fiber === deletedSubtreeRoot) {
|
||||
nextEffect = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (sibling !== null) {
|
||||
|
||||
@@ -9804,7 +9804,7 @@ var slice = Array.prototype.slice,
|
||||
return null;
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-classic-4f8ffec45-20230115",
|
||||
version: "18.3.0-www-classic-ee8509801-20230117",
|
||||
rendererPackageName: "react-art"
|
||||
};
|
||||
var internals$jscomp$inline_1318 = {
|
||||
@@ -9835,7 +9835,7 @@ var internals$jscomp$inline_1318 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-4f8ffec45-20230115"
|
||||
reconcilerVersion: "18.3.0-next-ee8509801-20230117"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1319 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
@@ -9471,7 +9471,7 @@ var slice = Array.prototype.slice,
|
||||
return null;
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-modern-4f8ffec45-20230115",
|
||||
version: "18.3.0-www-modern-ee8509801-20230117",
|
||||
rendererPackageName: "react-art"
|
||||
};
|
||||
var internals$jscomp$inline_1309 = {
|
||||
@@ -9502,7 +9502,7 @@ var internals$jscomp$inline_1309 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-4f8ffec45-20230115"
|
||||
reconcilerVersion: "18.3.0-next-ee8509801-20230117"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1310 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
@@ -34949,59 +34949,44 @@ function detachFiberAfterEffects(fiber) {
|
||||
if (alternate !== null) {
|
||||
fiber.alternate = null;
|
||||
detachFiberAfterEffects(alternate);
|
||||
} // Note: Defensively using negation instead of < in case
|
||||
// `deletedTreeCleanUpLevel` is undefined.
|
||||
} // Clear cyclical Fiber fields. This level alone is designed to roughly
|
||||
// approximate the planned Fiber refactor. In that world, `setState` will be
|
||||
// bound to a special "instance" object instead of a Fiber. The Instance
|
||||
// object will not have any of these fields. It will only be connected to
|
||||
// the fiber tree via a single link at the root. So if this level alone is
|
||||
// sufficient to fix memory issues, that bodes well for our plans.
|
||||
|
||||
{
|
||||
// Clear cyclical Fiber fields. This level alone is designed to roughly
|
||||
// approximate the planned Fiber refactor. In that world, `setState` will be
|
||||
// bound to a special "instance" object instead of a Fiber. The Instance
|
||||
// object will not have any of these fields. It will only be connected to
|
||||
// the fiber tree via a single link at the root. So if this level alone is
|
||||
// sufficient to fix memory issues, that bodes well for our plans.
|
||||
fiber.child = null;
|
||||
fiber.deletions = null;
|
||||
fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
|
||||
// tree, which has its own pointers to children, parents, and siblings.
|
||||
// The other host nodes also point back to fibers, so we should detach that
|
||||
// one, too.
|
||||
fiber.child = null;
|
||||
fiber.deletions = null;
|
||||
fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
|
||||
// tree, which has its own pointers to children, parents, and siblings.
|
||||
// The other host nodes also point back to fibers, so we should detach that
|
||||
// one, too.
|
||||
|
||||
if (fiber.tag === HostComponent) {
|
||||
var hostInstance = fiber.stateNode;
|
||||
if (fiber.tag === HostComponent) {
|
||||
var hostInstance = fiber.stateNode;
|
||||
|
||||
if (hostInstance !== null) {
|
||||
detachDeletedInstance(hostInstance);
|
||||
}
|
||||
}
|
||||
|
||||
fiber.stateNode = null; // I'm intentionally not clearing the `return` field in this level. We
|
||||
// already disconnect the `return` pointer at the root of the deleted
|
||||
// subtree (in `detachFiberMutation`). Besides, `return` by itself is not
|
||||
// cyclical — it's only cyclical when combined with `child`, `sibling`, and
|
||||
// `alternate`. But we'll clear it in the next level anyway, just in case.
|
||||
|
||||
{
|
||||
fiber._debugOwner = null;
|
||||
}
|
||||
|
||||
{
|
||||
// Theoretically, nothing in here should be necessary, because we already
|
||||
// disconnected the fiber from the tree. So even if something leaks this
|
||||
// particular fiber, it won't leak anything else
|
||||
//
|
||||
// The purpose of this branch is to be super aggressive so we can measure
|
||||
// if there's any difference in memory impact. If there is, that could
|
||||
// indicate a React leak we don't know about.
|
||||
fiber.return = null;
|
||||
fiber.dependencies = null;
|
||||
fiber.memoizedProps = null;
|
||||
fiber.memoizedState = null;
|
||||
fiber.pendingProps = null;
|
||||
fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
|
||||
|
||||
fiber.updateQueue = null;
|
||||
if (hostInstance !== null) {
|
||||
detachDeletedInstance(hostInstance);
|
||||
}
|
||||
}
|
||||
|
||||
fiber.stateNode = null;
|
||||
|
||||
{
|
||||
fiber._debugOwner = null;
|
||||
} // Theoretically, nothing in here should be necessary, because we already
|
||||
// disconnected the fiber from the tree. So even if something leaks this
|
||||
// particular fiber, it won't leak anything else.
|
||||
|
||||
fiber.return = null;
|
||||
fiber.dependencies = null;
|
||||
fiber.memoizedProps = null;
|
||||
fiber.memoizedState = null;
|
||||
fiber.pendingProps = null;
|
||||
fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
|
||||
|
||||
fiber.updateQueue = null;
|
||||
}
|
||||
|
||||
function getHostParentFiber(fiber) {
|
||||
@@ -37250,33 +37235,31 @@ function commitPassiveUnmountEffects(finishedWork) {
|
||||
}
|
||||
|
||||
function detachAlternateSiblings(parentFiber) {
|
||||
{
|
||||
// A fiber was deleted from this parent fiber, but it's still part of the
|
||||
// previous (alternate) parent fiber's list of children. Because children
|
||||
// are a linked list, an earlier sibling that's still alive will be
|
||||
// connected to the deleted fiber via its `alternate`:
|
||||
//
|
||||
// live fiber --alternate--> previous live fiber --sibling--> deleted
|
||||
// fiber
|
||||
//
|
||||
// We can't disconnect `alternate` on nodes that haven't been deleted yet,
|
||||
// but we can disconnect the `sibling` and `child` pointers.
|
||||
var previousFiber = parentFiber.alternate;
|
||||
// A fiber was deleted from this parent fiber, but it's still part of the
|
||||
// previous (alternate) parent fiber's list of children. Because children
|
||||
// are a linked list, an earlier sibling that's still alive will be
|
||||
// connected to the deleted fiber via its `alternate`:
|
||||
//
|
||||
// live fiber --alternate--> previous live fiber --sibling--> deleted
|
||||
// fiber
|
||||
//
|
||||
// We can't disconnect `alternate` on nodes that haven't been deleted yet,
|
||||
// but we can disconnect the `sibling` and `child` pointers.
|
||||
var previousFiber = parentFiber.alternate;
|
||||
|
||||
if (previousFiber !== null) {
|
||||
var detachedChild = previousFiber.child;
|
||||
if (previousFiber !== null) {
|
||||
var detachedChild = previousFiber.child;
|
||||
|
||||
if (detachedChild !== null) {
|
||||
previousFiber.child = null;
|
||||
if (detachedChild !== null) {
|
||||
previousFiber.child = null;
|
||||
|
||||
do {
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
do {
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
|
||||
detachedChild.sibling = null;
|
||||
detachedChild = detachedSibling;
|
||||
} while (detachedChild !== null);
|
||||
}
|
||||
detachedChild.sibling = null;
|
||||
detachedChild = detachedSibling;
|
||||
} while (detachedChild !== null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37469,8 +37452,7 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
|
||||
setCurrentFiber(fiber);
|
||||
commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);
|
||||
resetCurrentFiber();
|
||||
var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag. (But, if we
|
||||
// do this, still need to handle `deletedTreeCleanUpLevel` correctly.)
|
||||
var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag.
|
||||
|
||||
if (child !== null) {
|
||||
child.return = fiber;
|
||||
@@ -37489,18 +37471,15 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(
|
||||
while (nextEffect !== null) {
|
||||
var fiber = nextEffect;
|
||||
var sibling = fiber.sibling;
|
||||
var returnFiber = fiber.return;
|
||||
var returnFiber = fiber.return; // Recursively traverse the entire deleted tree and clean up fiber fields.
|
||||
// This is more aggressive than ideal, and the long term goal is to only
|
||||
// have to detach the deleted tree at the root.
|
||||
|
||||
{
|
||||
// Recursively traverse the entire deleted tree and clean up fiber fields.
|
||||
// This is more aggressive than ideal, and the long term goal is to only
|
||||
// have to detach the deleted tree at the root.
|
||||
detachFiberAfterEffects(fiber);
|
||||
detachFiberAfterEffects(fiber);
|
||||
|
||||
if (fiber === deletedSubtreeRoot) {
|
||||
nextEffect = null;
|
||||
return;
|
||||
}
|
||||
if (fiber === deletedSubtreeRoot) {
|
||||
nextEffect = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (sibling !== null) {
|
||||
@@ -42667,7 +42646,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-4f8ffec45-20230115";
|
||||
var ReactVersion = "18.3.0-www-classic-ee8509801-20230117";
|
||||
|
||||
function createPortal(
|
||||
children,
|
||||
|
||||
@@ -34673,59 +34673,44 @@ function detachFiberAfterEffects(fiber) {
|
||||
if (alternate !== null) {
|
||||
fiber.alternate = null;
|
||||
detachFiberAfterEffects(alternate);
|
||||
} // Note: Defensively using negation instead of < in case
|
||||
// `deletedTreeCleanUpLevel` is undefined.
|
||||
} // Clear cyclical Fiber fields. This level alone is designed to roughly
|
||||
// approximate the planned Fiber refactor. In that world, `setState` will be
|
||||
// bound to a special "instance" object instead of a Fiber. The Instance
|
||||
// object will not have any of these fields. It will only be connected to
|
||||
// the fiber tree via a single link at the root. So if this level alone is
|
||||
// sufficient to fix memory issues, that bodes well for our plans.
|
||||
|
||||
{
|
||||
// Clear cyclical Fiber fields. This level alone is designed to roughly
|
||||
// approximate the planned Fiber refactor. In that world, `setState` will be
|
||||
// bound to a special "instance" object instead of a Fiber. The Instance
|
||||
// object will not have any of these fields. It will only be connected to
|
||||
// the fiber tree via a single link at the root. So if this level alone is
|
||||
// sufficient to fix memory issues, that bodes well for our plans.
|
||||
fiber.child = null;
|
||||
fiber.deletions = null;
|
||||
fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
|
||||
// tree, which has its own pointers to children, parents, and siblings.
|
||||
// The other host nodes also point back to fibers, so we should detach that
|
||||
// one, too.
|
||||
fiber.child = null;
|
||||
fiber.deletions = null;
|
||||
fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
|
||||
// tree, which has its own pointers to children, parents, and siblings.
|
||||
// The other host nodes also point back to fibers, so we should detach that
|
||||
// one, too.
|
||||
|
||||
if (fiber.tag === HostComponent) {
|
||||
var hostInstance = fiber.stateNode;
|
||||
if (fiber.tag === HostComponent) {
|
||||
var hostInstance = fiber.stateNode;
|
||||
|
||||
if (hostInstance !== null) {
|
||||
detachDeletedInstance(hostInstance);
|
||||
}
|
||||
}
|
||||
|
||||
fiber.stateNode = null; // I'm intentionally not clearing the `return` field in this level. We
|
||||
// already disconnect the `return` pointer at the root of the deleted
|
||||
// subtree (in `detachFiberMutation`). Besides, `return` by itself is not
|
||||
// cyclical — it's only cyclical when combined with `child`, `sibling`, and
|
||||
// `alternate`. But we'll clear it in the next level anyway, just in case.
|
||||
|
||||
{
|
||||
fiber._debugOwner = null;
|
||||
}
|
||||
|
||||
{
|
||||
// Theoretically, nothing in here should be necessary, because we already
|
||||
// disconnected the fiber from the tree. So even if something leaks this
|
||||
// particular fiber, it won't leak anything else
|
||||
//
|
||||
// The purpose of this branch is to be super aggressive so we can measure
|
||||
// if there's any difference in memory impact. If there is, that could
|
||||
// indicate a React leak we don't know about.
|
||||
fiber.return = null;
|
||||
fiber.dependencies = null;
|
||||
fiber.memoizedProps = null;
|
||||
fiber.memoizedState = null;
|
||||
fiber.pendingProps = null;
|
||||
fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
|
||||
|
||||
fiber.updateQueue = null;
|
||||
if (hostInstance !== null) {
|
||||
detachDeletedInstance(hostInstance);
|
||||
}
|
||||
}
|
||||
|
||||
fiber.stateNode = null;
|
||||
|
||||
{
|
||||
fiber._debugOwner = null;
|
||||
} // Theoretically, nothing in here should be necessary, because we already
|
||||
// disconnected the fiber from the tree. So even if something leaks this
|
||||
// particular fiber, it won't leak anything else.
|
||||
|
||||
fiber.return = null;
|
||||
fiber.dependencies = null;
|
||||
fiber.memoizedProps = null;
|
||||
fiber.memoizedState = null;
|
||||
fiber.pendingProps = null;
|
||||
fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
|
||||
|
||||
fiber.updateQueue = null;
|
||||
}
|
||||
|
||||
function getHostParentFiber(fiber) {
|
||||
@@ -36974,33 +36959,31 @@ function commitPassiveUnmountEffects(finishedWork) {
|
||||
}
|
||||
|
||||
function detachAlternateSiblings(parentFiber) {
|
||||
{
|
||||
// A fiber was deleted from this parent fiber, but it's still part of the
|
||||
// previous (alternate) parent fiber's list of children. Because children
|
||||
// are a linked list, an earlier sibling that's still alive will be
|
||||
// connected to the deleted fiber via its `alternate`:
|
||||
//
|
||||
// live fiber --alternate--> previous live fiber --sibling--> deleted
|
||||
// fiber
|
||||
//
|
||||
// We can't disconnect `alternate` on nodes that haven't been deleted yet,
|
||||
// but we can disconnect the `sibling` and `child` pointers.
|
||||
var previousFiber = parentFiber.alternate;
|
||||
// A fiber was deleted from this parent fiber, but it's still part of the
|
||||
// previous (alternate) parent fiber's list of children. Because children
|
||||
// are a linked list, an earlier sibling that's still alive will be
|
||||
// connected to the deleted fiber via its `alternate`:
|
||||
//
|
||||
// live fiber --alternate--> previous live fiber --sibling--> deleted
|
||||
// fiber
|
||||
//
|
||||
// We can't disconnect `alternate` on nodes that haven't been deleted yet,
|
||||
// but we can disconnect the `sibling` and `child` pointers.
|
||||
var previousFiber = parentFiber.alternate;
|
||||
|
||||
if (previousFiber !== null) {
|
||||
var detachedChild = previousFiber.child;
|
||||
if (previousFiber !== null) {
|
||||
var detachedChild = previousFiber.child;
|
||||
|
||||
if (detachedChild !== null) {
|
||||
previousFiber.child = null;
|
||||
if (detachedChild !== null) {
|
||||
previousFiber.child = null;
|
||||
|
||||
do {
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
do {
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
|
||||
detachedChild.sibling = null;
|
||||
detachedChild = detachedSibling;
|
||||
} while (detachedChild !== null);
|
||||
}
|
||||
detachedChild.sibling = null;
|
||||
detachedChild = detachedSibling;
|
||||
} while (detachedChild !== null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37193,8 +37176,7 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
|
||||
setCurrentFiber(fiber);
|
||||
commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);
|
||||
resetCurrentFiber();
|
||||
var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag. (But, if we
|
||||
// do this, still need to handle `deletedTreeCleanUpLevel` correctly.)
|
||||
var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag.
|
||||
|
||||
if (child !== null) {
|
||||
child.return = fiber;
|
||||
@@ -37213,18 +37195,15 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(
|
||||
while (nextEffect !== null) {
|
||||
var fiber = nextEffect;
|
||||
var sibling = fiber.sibling;
|
||||
var returnFiber = fiber.return;
|
||||
var returnFiber = fiber.return; // Recursively traverse the entire deleted tree and clean up fiber fields.
|
||||
// This is more aggressive than ideal, and the long term goal is to only
|
||||
// have to detach the deleted tree at the root.
|
||||
|
||||
{
|
||||
// Recursively traverse the entire deleted tree and clean up fiber fields.
|
||||
// This is more aggressive than ideal, and the long term goal is to only
|
||||
// have to detach the deleted tree at the root.
|
||||
detachFiberAfterEffects(fiber);
|
||||
detachFiberAfterEffects(fiber);
|
||||
|
||||
if (fiber === deletedSubtreeRoot) {
|
||||
nextEffect = null;
|
||||
return;
|
||||
}
|
||||
if (fiber === deletedSubtreeRoot) {
|
||||
nextEffect = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (sibling !== null) {
|
||||
@@ -42391,7 +42370,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-4f8ffec45-20230115";
|
||||
var ReactVersion = "18.3.0-www-modern-ee8509801-20230117";
|
||||
|
||||
function createPortal(
|
||||
children,
|
||||
|
||||
@@ -15529,7 +15529,7 @@ Internals.Events = [
|
||||
var devToolsConfig$jscomp$inline_1750 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-classic-4f8ffec45-20230115",
|
||||
version: "18.3.0-www-classic-ee8509801-20230117",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
var internals$jscomp$inline_2134 = {
|
||||
@@ -15559,7 +15559,7 @@ var internals$jscomp$inline_2134 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-4f8ffec45-20230115"
|
||||
reconcilerVersion: "18.3.0-next-ee8509801-20230117"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_2135 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -15801,4 +15801,4 @@ exports.unstable_renderSubtreeIntoContainer = function(
|
||||
);
|
||||
};
|
||||
exports.unstable_runWithPriority = runWithPriority;
|
||||
exports.version = "18.3.0-next-4f8ffec45-20230115";
|
||||
exports.version = "18.3.0-next-ee8509801-20230117";
|
||||
|
||||
@@ -15090,7 +15090,7 @@ Internals.Events = [
|
||||
var devToolsConfig$jscomp$inline_1718 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-modern-4f8ffec45-20230115",
|
||||
version: "18.3.0-www-modern-ee8509801-20230117",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
var internals$jscomp$inline_2109 = {
|
||||
@@ -15121,7 +15121,7 @@ var internals$jscomp$inline_2109 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-4f8ffec45-20230115"
|
||||
reconcilerVersion: "18.3.0-next-ee8509801-20230117"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_2110 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -15309,4 +15309,4 @@ exports.unstable_flushControlled = function(fn) {
|
||||
}
|
||||
};
|
||||
exports.unstable_runWithPriority = runWithPriority;
|
||||
exports.version = "18.3.0-next-4f8ffec45-20230115";
|
||||
exports.version = "18.3.0-next-ee8509801-20230117";
|
||||
|
||||
@@ -16299,7 +16299,7 @@ Internals.Events = [
|
||||
var devToolsConfig$jscomp$inline_1824 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-classic-4f8ffec45-20230115",
|
||||
version: "18.3.0-www-classic-ee8509801-20230117",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
(function(internals) {
|
||||
@@ -16343,7 +16343,7 @@ var devToolsConfig$jscomp$inline_1824 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-4f8ffec45-20230115"
|
||||
reconcilerVersion: "18.3.0-next-ee8509801-20230117"
|
||||
});
|
||||
assign(Internals, {
|
||||
ReactBrowserEventEmitter: {
|
||||
@@ -16572,7 +16572,7 @@ exports.unstable_renderSubtreeIntoContainer = function(
|
||||
);
|
||||
};
|
||||
exports.unstable_runWithPriority = runWithPriority;
|
||||
exports.version = "18.3.0-next-4f8ffec45-20230115";
|
||||
exports.version = "18.3.0-next-ee8509801-20230117";
|
||||
|
||||
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
||||
if (
|
||||
|
||||
@@ -15850,7 +15850,7 @@ Internals.Events = [
|
||||
var devToolsConfig$jscomp$inline_1792 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-modern-4f8ffec45-20230115",
|
||||
version: "18.3.0-www-modern-ee8509801-20230117",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
(function(internals) {
|
||||
@@ -15895,7 +15895,7 @@ var devToolsConfig$jscomp$inline_1792 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-4f8ffec45-20230115"
|
||||
reconcilerVersion: "18.3.0-next-ee8509801-20230117"
|
||||
});
|
||||
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
|
||||
exports.createPortal = function(children, container) {
|
||||
@@ -16070,7 +16070,7 @@ exports.unstable_flushControlled = function(fn) {
|
||||
}
|
||||
};
|
||||
exports.unstable_runWithPriority = runWithPriority;
|
||||
exports.version = "18.3.0-next-4f8ffec45-20230115";
|
||||
exports.version = "18.3.0-next-ee8509801-20230117";
|
||||
|
||||
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
||||
if (
|
||||
|
||||
@@ -19,7 +19,7 @@ if (__DEV__) {
|
||||
var React = require("react");
|
||||
var ReactDOM = require("react-dom");
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-4f8ffec45-20230115";
|
||||
var ReactVersion = "18.3.0-www-classic-ee8509801-20230117";
|
||||
|
||||
// This refers to a WWW module.
|
||||
var warningWWW = require("warning");
|
||||
|
||||
@@ -19,7 +19,7 @@ if (__DEV__) {
|
||||
var React = require("react");
|
||||
var ReactDOM = require("react-dom");
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-4f8ffec45-20230115";
|
||||
var ReactVersion = "18.3.0-www-modern-ee8509801-20230117";
|
||||
|
||||
// This refers to a WWW module.
|
||||
var warningWWW = require("warning");
|
||||
|
||||
@@ -3633,4 +3633,4 @@ exports.renderToString = function(children, options) {
|
||||
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
|
||||
);
|
||||
};
|
||||
exports.version = "18.3.0-www-classic-4f8ffec45-20230115";
|
||||
exports.version = "18.3.0-www-classic-ee8509801-20230117";
|
||||
|
||||
@@ -3546,4 +3546,4 @@ exports.renderToString = function(children, options) {
|
||||
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
|
||||
);
|
||||
};
|
||||
exports.version = "18.3.0-www-modern-4f8ffec45-20230115";
|
||||
exports.version = "18.3.0-www-modern-ee8509801-20230117";
|
||||
|
||||
@@ -24174,59 +24174,44 @@ function detachFiberAfterEffects(fiber) {
|
||||
if (alternate !== null) {
|
||||
fiber.alternate = null;
|
||||
detachFiberAfterEffects(alternate);
|
||||
} // Note: Defensively using negation instead of < in case
|
||||
// `deletedTreeCleanUpLevel` is undefined.
|
||||
} // Clear cyclical Fiber fields. This level alone is designed to roughly
|
||||
// approximate the planned Fiber refactor. In that world, `setState` will be
|
||||
// bound to a special "instance" object instead of a Fiber. The Instance
|
||||
// object will not have any of these fields. It will only be connected to
|
||||
// the fiber tree via a single link at the root. So if this level alone is
|
||||
// sufficient to fix memory issues, that bodes well for our plans.
|
||||
|
||||
{
|
||||
// Clear cyclical Fiber fields. This level alone is designed to roughly
|
||||
// approximate the planned Fiber refactor. In that world, `setState` will be
|
||||
// bound to a special "instance" object instead of a Fiber. The Instance
|
||||
// object will not have any of these fields. It will only be connected to
|
||||
// the fiber tree via a single link at the root. So if this level alone is
|
||||
// sufficient to fix memory issues, that bodes well for our plans.
|
||||
fiber.child = null;
|
||||
fiber.deletions = null;
|
||||
fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
|
||||
// tree, which has its own pointers to children, parents, and siblings.
|
||||
// The other host nodes also point back to fibers, so we should detach that
|
||||
// one, too.
|
||||
fiber.child = null;
|
||||
fiber.deletions = null;
|
||||
fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
|
||||
// tree, which has its own pointers to children, parents, and siblings.
|
||||
// The other host nodes also point back to fibers, so we should detach that
|
||||
// one, too.
|
||||
|
||||
if (fiber.tag === HostComponent) {
|
||||
var hostInstance = fiber.stateNode;
|
||||
if (fiber.tag === HostComponent) {
|
||||
var hostInstance = fiber.stateNode;
|
||||
|
||||
if (hostInstance !== null) {
|
||||
detachDeletedInstance(hostInstance);
|
||||
}
|
||||
}
|
||||
|
||||
fiber.stateNode = null; // I'm intentionally not clearing the `return` field in this level. We
|
||||
// already disconnect the `return` pointer at the root of the deleted
|
||||
// subtree (in `detachFiberMutation`). Besides, `return` by itself is not
|
||||
// cyclical — it's only cyclical when combined with `child`, `sibling`, and
|
||||
// `alternate`. But we'll clear it in the next level anyway, just in case.
|
||||
|
||||
{
|
||||
fiber._debugOwner = null;
|
||||
}
|
||||
|
||||
{
|
||||
// Theoretically, nothing in here should be necessary, because we already
|
||||
// disconnected the fiber from the tree. So even if something leaks this
|
||||
// particular fiber, it won't leak anything else
|
||||
//
|
||||
// The purpose of this branch is to be super aggressive so we can measure
|
||||
// if there's any difference in memory impact. If there is, that could
|
||||
// indicate a React leak we don't know about.
|
||||
fiber.return = null;
|
||||
fiber.dependencies = null;
|
||||
fiber.memoizedProps = null;
|
||||
fiber.memoizedState = null;
|
||||
fiber.pendingProps = null;
|
||||
fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
|
||||
|
||||
fiber.updateQueue = null;
|
||||
if (hostInstance !== null) {
|
||||
detachDeletedInstance(hostInstance);
|
||||
}
|
||||
}
|
||||
|
||||
fiber.stateNode = null;
|
||||
|
||||
{
|
||||
fiber._debugOwner = null;
|
||||
} // Theoretically, nothing in here should be necessary, because we already
|
||||
// disconnected the fiber from the tree. So even if something leaks this
|
||||
// particular fiber, it won't leak anything else.
|
||||
|
||||
fiber.return = null;
|
||||
fiber.dependencies = null;
|
||||
fiber.memoizedProps = null;
|
||||
fiber.memoizedState = null;
|
||||
fiber.pendingProps = null;
|
||||
fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
|
||||
|
||||
fiber.updateQueue = null;
|
||||
}
|
||||
|
||||
function getHostParentFiber(fiber) {
|
||||
@@ -26226,33 +26211,31 @@ function commitPassiveUnmountEffects(finishedWork) {
|
||||
}
|
||||
|
||||
function detachAlternateSiblings(parentFiber) {
|
||||
{
|
||||
// A fiber was deleted from this parent fiber, but it's still part of the
|
||||
// previous (alternate) parent fiber's list of children. Because children
|
||||
// are a linked list, an earlier sibling that's still alive will be
|
||||
// connected to the deleted fiber via its `alternate`:
|
||||
//
|
||||
// live fiber --alternate--> previous live fiber --sibling--> deleted
|
||||
// fiber
|
||||
//
|
||||
// We can't disconnect `alternate` on nodes that haven't been deleted yet,
|
||||
// but we can disconnect the `sibling` and `child` pointers.
|
||||
var previousFiber = parentFiber.alternate;
|
||||
// A fiber was deleted from this parent fiber, but it's still part of the
|
||||
// previous (alternate) parent fiber's list of children. Because children
|
||||
// are a linked list, an earlier sibling that's still alive will be
|
||||
// connected to the deleted fiber via its `alternate`:
|
||||
//
|
||||
// live fiber --alternate--> previous live fiber --sibling--> deleted
|
||||
// fiber
|
||||
//
|
||||
// We can't disconnect `alternate` on nodes that haven't been deleted yet,
|
||||
// but we can disconnect the `sibling` and `child` pointers.
|
||||
var previousFiber = parentFiber.alternate;
|
||||
|
||||
if (previousFiber !== null) {
|
||||
var detachedChild = previousFiber.child;
|
||||
if (previousFiber !== null) {
|
||||
var detachedChild = previousFiber.child;
|
||||
|
||||
if (detachedChild !== null) {
|
||||
previousFiber.child = null;
|
||||
if (detachedChild !== null) {
|
||||
previousFiber.child = null;
|
||||
|
||||
do {
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
do {
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
|
||||
detachedChild.sibling = null;
|
||||
detachedChild = detachedSibling;
|
||||
} while (detachedChild !== null);
|
||||
}
|
||||
detachedChild.sibling = null;
|
||||
detachedChild = detachedSibling;
|
||||
} while (detachedChild !== null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26437,8 +26420,7 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
|
||||
setCurrentFiber(fiber);
|
||||
commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);
|
||||
resetCurrentFiber();
|
||||
var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag. (But, if we
|
||||
// do this, still need to handle `deletedTreeCleanUpLevel` correctly.)
|
||||
var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag.
|
||||
|
||||
if (child !== null) {
|
||||
child.return = fiber;
|
||||
@@ -26457,18 +26439,15 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(
|
||||
while (nextEffect !== null) {
|
||||
var fiber = nextEffect;
|
||||
var sibling = fiber.sibling;
|
||||
var returnFiber = fiber.return;
|
||||
var returnFiber = fiber.return; // Recursively traverse the entire deleted tree and clean up fiber fields.
|
||||
// This is more aggressive than ideal, and the long term goal is to only
|
||||
// have to detach the deleted tree at the root.
|
||||
|
||||
{
|
||||
// Recursively traverse the entire deleted tree and clean up fiber fields.
|
||||
// This is more aggressive than ideal, and the long term goal is to only
|
||||
// have to detach the deleted tree at the root.
|
||||
detachFiberAfterEffects(fiber);
|
||||
detachFiberAfterEffects(fiber);
|
||||
|
||||
if (fiber === deletedSubtreeRoot) {
|
||||
nextEffect = null;
|
||||
return;
|
||||
}
|
||||
if (fiber === deletedSubtreeRoot) {
|
||||
nextEffect = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (sibling !== null) {
|
||||
@@ -31206,7 +31185,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-4f8ffec45-20230115";
|
||||
var ReactVersion = "18.3.0-www-classic-ee8509801-20230117";
|
||||
|
||||
function createPortal(
|
||||
children,
|
||||
|
||||
@@ -31487,59 +31487,44 @@ function detachFiberAfterEffects(fiber) {
|
||||
if (alternate !== null) {
|
||||
fiber.alternate = null;
|
||||
detachFiberAfterEffects(alternate);
|
||||
} // Note: Defensively using negation instead of < in case
|
||||
// `deletedTreeCleanUpLevel` is undefined.
|
||||
} // Clear cyclical Fiber fields. This level alone is designed to roughly
|
||||
// approximate the planned Fiber refactor. In that world, `setState` will be
|
||||
// bound to a special "instance" object instead of a Fiber. The Instance
|
||||
// object will not have any of these fields. It will only be connected to
|
||||
// the fiber tree via a single link at the root. So if this level alone is
|
||||
// sufficient to fix memory issues, that bodes well for our plans.
|
||||
|
||||
{
|
||||
// Clear cyclical Fiber fields. This level alone is designed to roughly
|
||||
// approximate the planned Fiber refactor. In that world, `setState` will be
|
||||
// bound to a special "instance" object instead of a Fiber. The Instance
|
||||
// object will not have any of these fields. It will only be connected to
|
||||
// the fiber tree via a single link at the root. So if this level alone is
|
||||
// sufficient to fix memory issues, that bodes well for our plans.
|
||||
fiber.child = null;
|
||||
fiber.deletions = null;
|
||||
fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
|
||||
// tree, which has its own pointers to children, parents, and siblings.
|
||||
// The other host nodes also point back to fibers, so we should detach that
|
||||
// one, too.
|
||||
fiber.child = null;
|
||||
fiber.deletions = null;
|
||||
fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
|
||||
// tree, which has its own pointers to children, parents, and siblings.
|
||||
// The other host nodes also point back to fibers, so we should detach that
|
||||
// one, too.
|
||||
|
||||
if (fiber.tag === HostComponent) {
|
||||
var hostInstance = fiber.stateNode;
|
||||
if (fiber.tag === HostComponent) {
|
||||
var hostInstance = fiber.stateNode;
|
||||
|
||||
if (hostInstance !== null) {
|
||||
detachDeletedInstance(hostInstance);
|
||||
}
|
||||
}
|
||||
|
||||
fiber.stateNode = null; // I'm intentionally not clearing the `return` field in this level. We
|
||||
// already disconnect the `return` pointer at the root of the deleted
|
||||
// subtree (in `detachFiberMutation`). Besides, `return` by itself is not
|
||||
// cyclical — it's only cyclical when combined with `child`, `sibling`, and
|
||||
// `alternate`. But we'll clear it in the next level anyway, just in case.
|
||||
|
||||
{
|
||||
fiber._debugOwner = null;
|
||||
}
|
||||
|
||||
{
|
||||
// Theoretically, nothing in here should be necessary, because we already
|
||||
// disconnected the fiber from the tree. So even if something leaks this
|
||||
// particular fiber, it won't leak anything else
|
||||
//
|
||||
// The purpose of this branch is to be super aggressive so we can measure
|
||||
// if there's any difference in memory impact. If there is, that could
|
||||
// indicate a React leak we don't know about.
|
||||
fiber.return = null;
|
||||
fiber.dependencies = null;
|
||||
fiber.memoizedProps = null;
|
||||
fiber.memoizedState = null;
|
||||
fiber.pendingProps = null;
|
||||
fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
|
||||
|
||||
fiber.updateQueue = null;
|
||||
if (hostInstance !== null) {
|
||||
detachDeletedInstance(hostInstance);
|
||||
}
|
||||
}
|
||||
|
||||
fiber.stateNode = null;
|
||||
|
||||
{
|
||||
fiber._debugOwner = null;
|
||||
} // Theoretically, nothing in here should be necessary, because we already
|
||||
// disconnected the fiber from the tree. So even if something leaks this
|
||||
// particular fiber, it won't leak anything else.
|
||||
|
||||
fiber.return = null;
|
||||
fiber.dependencies = null;
|
||||
fiber.memoizedProps = null;
|
||||
fiber.memoizedState = null;
|
||||
fiber.pendingProps = null;
|
||||
fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
|
||||
|
||||
fiber.updateQueue = null;
|
||||
}
|
||||
|
||||
function getHostParentFiber(fiber) {
|
||||
@@ -33539,33 +33524,31 @@ function commitPassiveUnmountEffects(finishedWork) {
|
||||
}
|
||||
|
||||
function detachAlternateSiblings(parentFiber) {
|
||||
{
|
||||
// A fiber was deleted from this parent fiber, but it's still part of the
|
||||
// previous (alternate) parent fiber's list of children. Because children
|
||||
// are a linked list, an earlier sibling that's still alive will be
|
||||
// connected to the deleted fiber via its `alternate`:
|
||||
//
|
||||
// live fiber --alternate--> previous live fiber --sibling--> deleted
|
||||
// fiber
|
||||
//
|
||||
// We can't disconnect `alternate` on nodes that haven't been deleted yet,
|
||||
// but we can disconnect the `sibling` and `child` pointers.
|
||||
var previousFiber = parentFiber.alternate;
|
||||
// A fiber was deleted from this parent fiber, but it's still part of the
|
||||
// previous (alternate) parent fiber's list of children. Because children
|
||||
// are a linked list, an earlier sibling that's still alive will be
|
||||
// connected to the deleted fiber via its `alternate`:
|
||||
//
|
||||
// live fiber --alternate--> previous live fiber --sibling--> deleted
|
||||
// fiber
|
||||
//
|
||||
// We can't disconnect `alternate` on nodes that haven't been deleted yet,
|
||||
// but we can disconnect the `sibling` and `child` pointers.
|
||||
var previousFiber = parentFiber.alternate;
|
||||
|
||||
if (previousFiber !== null) {
|
||||
var detachedChild = previousFiber.child;
|
||||
if (previousFiber !== null) {
|
||||
var detachedChild = previousFiber.child;
|
||||
|
||||
if (detachedChild !== null) {
|
||||
previousFiber.child = null;
|
||||
if (detachedChild !== null) {
|
||||
previousFiber.child = null;
|
||||
|
||||
do {
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
do {
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
|
||||
detachedChild.sibling = null;
|
||||
detachedChild = detachedSibling;
|
||||
} while (detachedChild !== null);
|
||||
}
|
||||
detachedChild.sibling = null;
|
||||
detachedChild = detachedSibling;
|
||||
} while (detachedChild !== null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33750,8 +33733,7 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
|
||||
setCurrentFiber(fiber);
|
||||
commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);
|
||||
resetCurrentFiber();
|
||||
var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag. (But, if we
|
||||
// do this, still need to handle `deletedTreeCleanUpLevel` correctly.)
|
||||
var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag.
|
||||
|
||||
if (child !== null) {
|
||||
child.return = fiber;
|
||||
@@ -33770,18 +33752,15 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(
|
||||
while (nextEffect !== null) {
|
||||
var fiber = nextEffect;
|
||||
var sibling = fiber.sibling;
|
||||
var returnFiber = fiber.return;
|
||||
var returnFiber = fiber.return; // Recursively traverse the entire deleted tree and clean up fiber fields.
|
||||
// This is more aggressive than ideal, and the long term goal is to only
|
||||
// have to detach the deleted tree at the root.
|
||||
|
||||
{
|
||||
// Recursively traverse the entire deleted tree and clean up fiber fields.
|
||||
// This is more aggressive than ideal, and the long term goal is to only
|
||||
// have to detach the deleted tree at the root.
|
||||
detachFiberAfterEffects(fiber);
|
||||
detachFiberAfterEffects(fiber);
|
||||
|
||||
if (fiber === deletedSubtreeRoot) {
|
||||
nextEffect = null;
|
||||
return;
|
||||
}
|
||||
if (fiber === deletedSubtreeRoot) {
|
||||
nextEffect = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (sibling !== null) {
|
||||
@@ -38519,7 +38498,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-4f8ffec45-20230115";
|
||||
var ReactVersion = "18.3.0-www-modern-ee8509801-20230117";
|
||||
|
||||
function createPortal(
|
||||
children,
|
||||
|
||||
@@ -11328,7 +11328,7 @@ Internals.Events = [
|
||||
var devToolsConfig$jscomp$inline_1518 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-classic-4f8ffec45-20230115",
|
||||
version: "18.3.0-www-classic-ee8509801-20230117",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
var internals$jscomp$inline_2047 = {
|
||||
@@ -11358,7 +11358,7 @@ var internals$jscomp$inline_2047 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-4f8ffec45-20230115"
|
||||
reconcilerVersion: "18.3.0-next-ee8509801-20230117"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_2048 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -14847,4 +14847,4 @@ exports.unstable_renderSubtreeIntoContainer = function(
|
||||
);
|
||||
};
|
||||
exports.unstable_runWithPriority = runWithPriority;
|
||||
exports.version = "18.3.0-next-4f8ffec45-20230115";
|
||||
exports.version = "18.3.0-next-ee8509801-20230117";
|
||||
|
||||
@@ -13967,7 +13967,7 @@ Internals.Events = [
|
||||
var devToolsConfig$jscomp$inline_1673 = {
|
||||
findFiberByHostInstance: getClosestInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-www-modern-4f8ffec45-20230115",
|
||||
version: "18.3.0-www-modern-ee8509801-20230117",
|
||||
rendererPackageName: "react-dom"
|
||||
};
|
||||
var internals$jscomp$inline_2072 = {
|
||||
@@ -13998,7 +13998,7 @@ var internals$jscomp$inline_2072 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-4f8ffec45-20230115"
|
||||
reconcilerVersion: "18.3.0-next-ee8509801-20230117"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_2073 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
@@ -14321,4 +14321,4 @@ exports.unstable_flushControlled = function(fn) {
|
||||
}
|
||||
};
|
||||
exports.unstable_runWithPriority = runWithPriority;
|
||||
exports.version = "18.3.0-next-4f8ffec45-20230115";
|
||||
exports.version = "18.3.0-next-ee8509801-20230117";
|
||||
|
||||
@@ -17450,55 +17450,40 @@ function detachFiberAfterEffects(fiber) {
|
||||
if (alternate !== null) {
|
||||
fiber.alternate = null;
|
||||
detachFiberAfterEffects(alternate);
|
||||
} // Note: Defensively using negation instead of < in case
|
||||
// `deletedTreeCleanUpLevel` is undefined.
|
||||
} // Clear cyclical Fiber fields. This level alone is designed to roughly
|
||||
// approximate the planned Fiber refactor. In that world, `setState` will be
|
||||
// bound to a special "instance" object instead of a Fiber. The Instance
|
||||
// object will not have any of these fields. It will only be connected to
|
||||
// the fiber tree via a single link at the root. So if this level alone is
|
||||
// sufficient to fix memory issues, that bodes well for our plans.
|
||||
|
||||
fiber.child = null;
|
||||
fiber.deletions = null;
|
||||
fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
|
||||
// tree, which has its own pointers to children, parents, and siblings.
|
||||
// The other host nodes also point back to fibers, so we should detach that
|
||||
// one, too.
|
||||
|
||||
if (fiber.tag === HostComponent) {
|
||||
var hostInstance = fiber.stateNode;
|
||||
}
|
||||
|
||||
fiber.stateNode = null;
|
||||
|
||||
{
|
||||
// Clear cyclical Fiber fields. This level alone is designed to roughly
|
||||
// approximate the planned Fiber refactor. In that world, `setState` will be
|
||||
// bound to a special "instance" object instead of a Fiber. The Instance
|
||||
// object will not have any of these fields. It will only be connected to
|
||||
// the fiber tree via a single link at the root. So if this level alone is
|
||||
// sufficient to fix memory issues, that bodes well for our plans.
|
||||
fiber.child = null;
|
||||
fiber.deletions = null;
|
||||
fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
|
||||
// tree, which has its own pointers to children, parents, and siblings.
|
||||
// The other host nodes also point back to fibers, so we should detach that
|
||||
// one, too.
|
||||
fiber._debugOwner = null;
|
||||
} // Theoretically, nothing in here should be necessary, because we already
|
||||
// disconnected the fiber from the tree. So even if something leaks this
|
||||
// particular fiber, it won't leak anything else.
|
||||
|
||||
if (fiber.tag === HostComponent) {
|
||||
var hostInstance = fiber.stateNode;
|
||||
}
|
||||
fiber.return = null;
|
||||
fiber.dependencies = null;
|
||||
fiber.memoizedProps = null;
|
||||
fiber.memoizedState = null;
|
||||
fiber.pendingProps = null;
|
||||
fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
|
||||
|
||||
fiber.stateNode = null; // I'm intentionally not clearing the `return` field in this level. We
|
||||
// already disconnect the `return` pointer at the root of the deleted
|
||||
// subtree (in `detachFiberMutation`). Besides, `return` by itself is not
|
||||
// cyclical — it's only cyclical when combined with `child`, `sibling`, and
|
||||
// `alternate`. But we'll clear it in the next level anyway, just in case.
|
||||
|
||||
{
|
||||
fiber._debugOwner = null;
|
||||
}
|
||||
|
||||
{
|
||||
// Theoretically, nothing in here should be necessary, because we already
|
||||
// disconnected the fiber from the tree. So even if something leaks this
|
||||
// particular fiber, it won't leak anything else
|
||||
//
|
||||
// The purpose of this branch is to be super aggressive so we can measure
|
||||
// if there's any difference in memory impact. If there is, that could
|
||||
// indicate a React leak we don't know about.
|
||||
fiber.return = null;
|
||||
fiber.dependencies = null;
|
||||
fiber.memoizedProps = null;
|
||||
fiber.memoizedState = null;
|
||||
fiber.pendingProps = null;
|
||||
fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
|
||||
|
||||
fiber.updateQueue = null;
|
||||
}
|
||||
}
|
||||
fiber.updateQueue = null;
|
||||
}
|
||||
|
||||
function getHostParentFiber(fiber) {
|
||||
@@ -19357,33 +19342,31 @@ function commitPassiveUnmountEffects(finishedWork) {
|
||||
}
|
||||
|
||||
function detachAlternateSiblings(parentFiber) {
|
||||
{
|
||||
// A fiber was deleted from this parent fiber, but it's still part of the
|
||||
// previous (alternate) parent fiber's list of children. Because children
|
||||
// are a linked list, an earlier sibling that's still alive will be
|
||||
// connected to the deleted fiber via its `alternate`:
|
||||
//
|
||||
// live fiber --alternate--> previous live fiber --sibling--> deleted
|
||||
// fiber
|
||||
//
|
||||
// We can't disconnect `alternate` on nodes that haven't been deleted yet,
|
||||
// but we can disconnect the `sibling` and `child` pointers.
|
||||
var previousFiber = parentFiber.alternate;
|
||||
// A fiber was deleted from this parent fiber, but it's still part of the
|
||||
// previous (alternate) parent fiber's list of children. Because children
|
||||
// are a linked list, an earlier sibling that's still alive will be
|
||||
// connected to the deleted fiber via its `alternate`:
|
||||
//
|
||||
// live fiber --alternate--> previous live fiber --sibling--> deleted
|
||||
// fiber
|
||||
//
|
||||
// We can't disconnect `alternate` on nodes that haven't been deleted yet,
|
||||
// but we can disconnect the `sibling` and `child` pointers.
|
||||
var previousFiber = parentFiber.alternate;
|
||||
|
||||
if (previousFiber !== null) {
|
||||
var detachedChild = previousFiber.child;
|
||||
if (previousFiber !== null) {
|
||||
var detachedChild = previousFiber.child;
|
||||
|
||||
if (detachedChild !== null) {
|
||||
previousFiber.child = null;
|
||||
if (detachedChild !== null) {
|
||||
previousFiber.child = null;
|
||||
|
||||
do {
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
do {
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
|
||||
detachedChild.sibling = null;
|
||||
detachedChild = detachedSibling;
|
||||
} while (detachedChild !== null);
|
||||
}
|
||||
detachedChild.sibling = null;
|
||||
detachedChild = detachedSibling;
|
||||
} while (detachedChild !== null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19576,8 +19559,7 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
|
||||
setCurrentFiber(fiber);
|
||||
commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);
|
||||
resetCurrentFiber();
|
||||
var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag. (But, if we
|
||||
// do this, still need to handle `deletedTreeCleanUpLevel` correctly.)
|
||||
var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag.
|
||||
|
||||
if (child !== null) {
|
||||
child.return = fiber;
|
||||
@@ -19596,18 +19578,15 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(
|
||||
while (nextEffect !== null) {
|
||||
var fiber = nextEffect;
|
||||
var sibling = fiber.sibling;
|
||||
var returnFiber = fiber.return;
|
||||
var returnFiber = fiber.return; // Recursively traverse the entire deleted tree and clean up fiber fields.
|
||||
// This is more aggressive than ideal, and the long term goal is to only
|
||||
// have to detach the deleted tree at the root.
|
||||
|
||||
{
|
||||
// Recursively traverse the entire deleted tree and clean up fiber fields.
|
||||
// This is more aggressive than ideal, and the long term goal is to only
|
||||
// have to detach the deleted tree at the root.
|
||||
detachFiberAfterEffects(fiber);
|
||||
detachFiberAfterEffects(fiber);
|
||||
|
||||
if (fiber === deletedSubtreeRoot) {
|
||||
nextEffect = null;
|
||||
return;
|
||||
}
|
||||
if (fiber === deletedSubtreeRoot) {
|
||||
nextEffect = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (sibling !== null) {
|
||||
@@ -23903,7 +23882,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-classic-4f8ffec45-20230115";
|
||||
var ReactVersion = "18.3.0-www-classic-ee8509801-20230117";
|
||||
|
||||
// Might add PROFILE later.
|
||||
|
||||
|
||||
@@ -17450,55 +17450,40 @@ function detachFiberAfterEffects(fiber) {
|
||||
if (alternate !== null) {
|
||||
fiber.alternate = null;
|
||||
detachFiberAfterEffects(alternate);
|
||||
} // Note: Defensively using negation instead of < in case
|
||||
// `deletedTreeCleanUpLevel` is undefined.
|
||||
} // Clear cyclical Fiber fields. This level alone is designed to roughly
|
||||
// approximate the planned Fiber refactor. In that world, `setState` will be
|
||||
// bound to a special "instance" object instead of a Fiber. The Instance
|
||||
// object will not have any of these fields. It will only be connected to
|
||||
// the fiber tree via a single link at the root. So if this level alone is
|
||||
// sufficient to fix memory issues, that bodes well for our plans.
|
||||
|
||||
fiber.child = null;
|
||||
fiber.deletions = null;
|
||||
fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
|
||||
// tree, which has its own pointers to children, parents, and siblings.
|
||||
// The other host nodes also point back to fibers, so we should detach that
|
||||
// one, too.
|
||||
|
||||
if (fiber.tag === HostComponent) {
|
||||
var hostInstance = fiber.stateNode;
|
||||
}
|
||||
|
||||
fiber.stateNode = null;
|
||||
|
||||
{
|
||||
// Clear cyclical Fiber fields. This level alone is designed to roughly
|
||||
// approximate the planned Fiber refactor. In that world, `setState` will be
|
||||
// bound to a special "instance" object instead of a Fiber. The Instance
|
||||
// object will not have any of these fields. It will only be connected to
|
||||
// the fiber tree via a single link at the root. So if this level alone is
|
||||
// sufficient to fix memory issues, that bodes well for our plans.
|
||||
fiber.child = null;
|
||||
fiber.deletions = null;
|
||||
fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host
|
||||
// tree, which has its own pointers to children, parents, and siblings.
|
||||
// The other host nodes also point back to fibers, so we should detach that
|
||||
// one, too.
|
||||
fiber._debugOwner = null;
|
||||
} // Theoretically, nothing in here should be necessary, because we already
|
||||
// disconnected the fiber from the tree. So even if something leaks this
|
||||
// particular fiber, it won't leak anything else.
|
||||
|
||||
if (fiber.tag === HostComponent) {
|
||||
var hostInstance = fiber.stateNode;
|
||||
}
|
||||
fiber.return = null;
|
||||
fiber.dependencies = null;
|
||||
fiber.memoizedProps = null;
|
||||
fiber.memoizedState = null;
|
||||
fiber.pendingProps = null;
|
||||
fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
|
||||
|
||||
fiber.stateNode = null; // I'm intentionally not clearing the `return` field in this level. We
|
||||
// already disconnect the `return` pointer at the root of the deleted
|
||||
// subtree (in `detachFiberMutation`). Besides, `return` by itself is not
|
||||
// cyclical — it's only cyclical when combined with `child`, `sibling`, and
|
||||
// `alternate`. But we'll clear it in the next level anyway, just in case.
|
||||
|
||||
{
|
||||
fiber._debugOwner = null;
|
||||
}
|
||||
|
||||
{
|
||||
// Theoretically, nothing in here should be necessary, because we already
|
||||
// disconnected the fiber from the tree. So even if something leaks this
|
||||
// particular fiber, it won't leak anything else
|
||||
//
|
||||
// The purpose of this branch is to be super aggressive so we can measure
|
||||
// if there's any difference in memory impact. If there is, that could
|
||||
// indicate a React leak we don't know about.
|
||||
fiber.return = null;
|
||||
fiber.dependencies = null;
|
||||
fiber.memoizedProps = null;
|
||||
fiber.memoizedState = null;
|
||||
fiber.pendingProps = null;
|
||||
fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead.
|
||||
|
||||
fiber.updateQueue = null;
|
||||
}
|
||||
}
|
||||
fiber.updateQueue = null;
|
||||
}
|
||||
|
||||
function getHostParentFiber(fiber) {
|
||||
@@ -19357,33 +19342,31 @@ function commitPassiveUnmountEffects(finishedWork) {
|
||||
}
|
||||
|
||||
function detachAlternateSiblings(parentFiber) {
|
||||
{
|
||||
// A fiber was deleted from this parent fiber, but it's still part of the
|
||||
// previous (alternate) parent fiber's list of children. Because children
|
||||
// are a linked list, an earlier sibling that's still alive will be
|
||||
// connected to the deleted fiber via its `alternate`:
|
||||
//
|
||||
// live fiber --alternate--> previous live fiber --sibling--> deleted
|
||||
// fiber
|
||||
//
|
||||
// We can't disconnect `alternate` on nodes that haven't been deleted yet,
|
||||
// but we can disconnect the `sibling` and `child` pointers.
|
||||
var previousFiber = parentFiber.alternate;
|
||||
// A fiber was deleted from this parent fiber, but it's still part of the
|
||||
// previous (alternate) parent fiber's list of children. Because children
|
||||
// are a linked list, an earlier sibling that's still alive will be
|
||||
// connected to the deleted fiber via its `alternate`:
|
||||
//
|
||||
// live fiber --alternate--> previous live fiber --sibling--> deleted
|
||||
// fiber
|
||||
//
|
||||
// We can't disconnect `alternate` on nodes that haven't been deleted yet,
|
||||
// but we can disconnect the `sibling` and `child` pointers.
|
||||
var previousFiber = parentFiber.alternate;
|
||||
|
||||
if (previousFiber !== null) {
|
||||
var detachedChild = previousFiber.child;
|
||||
if (previousFiber !== null) {
|
||||
var detachedChild = previousFiber.child;
|
||||
|
||||
if (detachedChild !== null) {
|
||||
previousFiber.child = null;
|
||||
if (detachedChild !== null) {
|
||||
previousFiber.child = null;
|
||||
|
||||
do {
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
do {
|
||||
// $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
var detachedSibling = detachedChild.sibling; // $FlowFixMe[incompatible-use] found when upgrading Flow
|
||||
|
||||
detachedChild.sibling = null;
|
||||
detachedChild = detachedSibling;
|
||||
} while (detachedChild !== null);
|
||||
}
|
||||
detachedChild.sibling = null;
|
||||
detachedChild = detachedSibling;
|
||||
} while (detachedChild !== null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19576,8 +19559,7 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(
|
||||
setCurrentFiber(fiber);
|
||||
commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);
|
||||
resetCurrentFiber();
|
||||
var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag. (But, if we
|
||||
// do this, still need to handle `deletedTreeCleanUpLevel` correctly.)
|
||||
var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag.
|
||||
|
||||
if (child !== null) {
|
||||
child.return = fiber;
|
||||
@@ -19596,18 +19578,15 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(
|
||||
while (nextEffect !== null) {
|
||||
var fiber = nextEffect;
|
||||
var sibling = fiber.sibling;
|
||||
var returnFiber = fiber.return;
|
||||
var returnFiber = fiber.return; // Recursively traverse the entire deleted tree and clean up fiber fields.
|
||||
// This is more aggressive than ideal, and the long term goal is to only
|
||||
// have to detach the deleted tree at the root.
|
||||
|
||||
{
|
||||
// Recursively traverse the entire deleted tree and clean up fiber fields.
|
||||
// This is more aggressive than ideal, and the long term goal is to only
|
||||
// have to detach the deleted tree at the root.
|
||||
detachFiberAfterEffects(fiber);
|
||||
detachFiberAfterEffects(fiber);
|
||||
|
||||
if (fiber === deletedSubtreeRoot) {
|
||||
nextEffect = null;
|
||||
return;
|
||||
}
|
||||
if (fiber === deletedSubtreeRoot) {
|
||||
nextEffect = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (sibling !== null) {
|
||||
@@ -23903,7 +23882,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-www-modern-4f8ffec45-20230115";
|
||||
var ReactVersion = "18.3.0-www-modern-ee8509801-20230117";
|
||||
|
||||
// Might add PROFILE later.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user