Skip to content

Commit f7ce1b5

Browse files
committed
Hot reloading: Avoid stack overflow on wide trees (facebook#34145)
Every sibling added to the stack here. Not sure this needs to be recursive at all but certainly for siblings this can just be a loop. DiffTrain build for [cf6e502](facebook@cf6e502)
1 parent f0ef8f4 commit f7ce1b5

34 files changed

+546
-556
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3958d5d84b3d3e6ae5c1caef9c8cf0dc58e862e6
1+
cf6e502ed23ab3357e58965789324ddfa0e12821
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3958d5d84b3d3e6ae5c1caef9c8cf0dc58e862e6
1+
cf6e502ed23ab3357e58965789324ddfa0e12821

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ __DEV__ &&
14341434
exports.useTransition = function () {
14351435
return resolveDispatcher().useTransition();
14361436
};
1437-
exports.version = "19.2.0-www-classic-3958d5d8-20250807";
1437+
exports.version = "19.2.0-www-classic-cf6e502e-20250809";
14381438
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
14391439
"function" ===
14401440
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ __DEV__ &&
14341434
exports.useTransition = function () {
14351435
return resolveDispatcher().useTransition();
14361436
};
1437-
exports.version = "19.2.0-www-modern-3958d5d8-20250807";
1437+
exports.version = "19.2.0-www-modern-cf6e502e-20250809";
14381438
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
14391439
"function" ===
14401440
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,4 +610,4 @@ exports.useSyncExternalStore = function (
610610
exports.useTransition = function () {
611611
return ReactSharedInternals.H.useTransition();
612612
};
613-
exports.version = "19.2.0-www-classic-3958d5d8-20250807";
613+
exports.version = "19.2.0-www-classic-cf6e502e-20250809";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,4 +610,4 @@ exports.useSyncExternalStore = function (
610610
exports.useTransition = function () {
611611
return ReactSharedInternals.H.useTransition();
612612
};
613-
exports.version = "19.2.0-www-modern-3958d5d8-20250807";
613+
exports.version = "19.2.0-www-modern-cf6e502e-20250809";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ exports.useSyncExternalStore = function (
614614
exports.useTransition = function () {
615615
return ReactSharedInternals.H.useTransition();
616616
};
617-
exports.version = "19.2.0-www-classic-3958d5d8-20250807";
617+
exports.version = "19.2.0-www-classic-cf6e502e-20250809";
618618
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
619619
"function" ===
620620
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ exports.useSyncExternalStore = function (
614614
exports.useTransition = function () {
615615
return ReactSharedInternals.H.useTransition();
616616
};
617-
exports.version = "19.2.0-www-modern-3958d5d8-20250807";
617+
exports.version = "19.2.0-www-modern-cf6e502e-20250809";
618618
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
619619
"function" ===
620620
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 49 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -16743,53 +16743,52 @@ __DEV__ &&
1674316743
updatedFamilies,
1674416744
staleFamilies
1674516745
) {
16746-
var alternate = fiber.alternate,
16747-
child = fiber.child,
16748-
sibling = fiber.sibling,
16749-
tag = fiber.tag,
16750-
type = fiber.type,
16751-
candidateType = null;
16752-
switch (tag) {
16753-
case 0:
16754-
case 15:
16755-
case 1:
16756-
candidateType = type;
16757-
break;
16758-
case 11:
16759-
candidateType = type.render;
16760-
}
16761-
if (null === resolveFamily)
16762-
throw Error("Expected resolveFamily to be set during hot reload.");
16763-
var needsRender = !1;
16764-
type = !1;
16765-
null !== candidateType &&
16766-
((candidateType = resolveFamily(candidateType)),
16767-
void 0 !== candidateType &&
16768-
(staleFamilies.has(candidateType)
16769-
? (type = !0)
16770-
: updatedFamilies.has(candidateType) &&
16771-
(1 === tag ? (type = !0) : (needsRender = !0))));
16772-
null !== failedBoundaries &&
16773-
(failedBoundaries.has(fiber) ||
16774-
(null !== alternate && failedBoundaries.has(alternate))) &&
16775-
(type = !0);
16776-
type && (fiber._debugNeedsRemount = !0);
16777-
if (type || needsRender)
16778-
(alternate = enqueueConcurrentRenderForLane(fiber, 2)),
16779-
null !== alternate && scheduleUpdateOnFiber(alternate, fiber, 2);
16780-
null === child ||
16781-
type ||
16782-
scheduleFibersWithFamiliesRecursively(
16783-
child,
16784-
updatedFamilies,
16785-
staleFamilies
16786-
);
16787-
null !== sibling &&
16788-
scheduleFibersWithFamiliesRecursively(
16789-
sibling,
16790-
updatedFamilies,
16791-
staleFamilies
16792-
);
16746+
do {
16747+
var _fiber = fiber,
16748+
alternate = _fiber.alternate,
16749+
child = _fiber.child,
16750+
sibling = _fiber.sibling,
16751+
tag = _fiber.tag;
16752+
_fiber = _fiber.type;
16753+
var candidateType = null;
16754+
switch (tag) {
16755+
case 0:
16756+
case 15:
16757+
case 1:
16758+
candidateType = _fiber;
16759+
break;
16760+
case 11:
16761+
candidateType = _fiber.render;
16762+
}
16763+
if (null === resolveFamily)
16764+
throw Error("Expected resolveFamily to be set during hot reload.");
16765+
var needsRender = !1;
16766+
_fiber = !1;
16767+
null !== candidateType &&
16768+
((candidateType = resolveFamily(candidateType)),
16769+
void 0 !== candidateType &&
16770+
(staleFamilies.has(candidateType)
16771+
? (_fiber = !0)
16772+
: updatedFamilies.has(candidateType) &&
16773+
(1 === tag ? (_fiber = !0) : (needsRender = !0))));
16774+
null !== failedBoundaries &&
16775+
(failedBoundaries.has(fiber) ||
16776+
(null !== alternate && failedBoundaries.has(alternate))) &&
16777+
(_fiber = !0);
16778+
_fiber && (fiber._debugNeedsRemount = !0);
16779+
if (_fiber || needsRender)
16780+
(alternate = enqueueConcurrentRenderForLane(fiber, 2)),
16781+
null !== alternate && scheduleUpdateOnFiber(alternate, fiber, 2);
16782+
null === child ||
16783+
_fiber ||
16784+
scheduleFibersWithFamiliesRecursively(
16785+
child,
16786+
updatedFamilies,
16787+
staleFamilies
16788+
);
16789+
if (null === sibling) break;
16790+
fiber = sibling;
16791+
} while (1);
1679316792
}
1679416793
function FiberNode(tag, pendingProps, key, mode) {
1679516794
this.tag = tag;
@@ -19582,10 +19581,10 @@ __DEV__ &&
1958219581
(function () {
1958319582
var internals = {
1958419583
bundleType: 1,
19585-
version: "19.2.0-www-classic-3958d5d8-20250807",
19584+
version: "19.2.0-www-classic-cf6e502e-20250809",
1958619585
rendererPackageName: "react-art",
1958719586
currentDispatcherRef: ReactSharedInternals,
19588-
reconcilerVersion: "19.2.0-www-classic-3958d5d8-20250807"
19587+
reconcilerVersion: "19.2.0-www-classic-cf6e502e-20250809"
1958919588
};
1959019589
internals.overrideHookState = overrideHookState;
1959119590
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -19619,7 +19618,7 @@ __DEV__ &&
1961919618
exports.Shape = Shape;
1962019619
exports.Surface = Surface;
1962119620
exports.Text = Text;
19622-
exports.version = "19.2.0-www-classic-3958d5d8-20250807";
19621+
exports.version = "19.2.0-www-classic-cf6e502e-20250809";
1962319622
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1962419623
"function" ===
1962519624
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 49 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -16556,53 +16556,52 @@ __DEV__ &&
1655616556
updatedFamilies,
1655716557
staleFamilies
1655816558
) {
16559-
var alternate = fiber.alternate,
16560-
child = fiber.child,
16561-
sibling = fiber.sibling,
16562-
tag = fiber.tag,
16563-
type = fiber.type,
16564-
candidateType = null;
16565-
switch (tag) {
16566-
case 0:
16567-
case 15:
16568-
case 1:
16569-
candidateType = type;
16570-
break;
16571-
case 11:
16572-
candidateType = type.render;
16573-
}
16574-
if (null === resolveFamily)
16575-
throw Error("Expected resolveFamily to be set during hot reload.");
16576-
var needsRender = !1;
16577-
type = !1;
16578-
null !== candidateType &&
16579-
((candidateType = resolveFamily(candidateType)),
16580-
void 0 !== candidateType &&
16581-
(staleFamilies.has(candidateType)
16582-
? (type = !0)
16583-
: updatedFamilies.has(candidateType) &&
16584-
(1 === tag ? (type = !0) : (needsRender = !0))));
16585-
null !== failedBoundaries &&
16586-
(failedBoundaries.has(fiber) ||
16587-
(null !== alternate && failedBoundaries.has(alternate))) &&
16588-
(type = !0);
16589-
type && (fiber._debugNeedsRemount = !0);
16590-
if (type || needsRender)
16591-
(alternate = enqueueConcurrentRenderForLane(fiber, 2)),
16592-
null !== alternate && scheduleUpdateOnFiber(alternate, fiber, 2);
16593-
null === child ||
16594-
type ||
16595-
scheduleFibersWithFamiliesRecursively(
16596-
child,
16597-
updatedFamilies,
16598-
staleFamilies
16599-
);
16600-
null !== sibling &&
16601-
scheduleFibersWithFamiliesRecursively(
16602-
sibling,
16603-
updatedFamilies,
16604-
staleFamilies
16605-
);
16559+
do {
16560+
var _fiber = fiber,
16561+
alternate = _fiber.alternate,
16562+
child = _fiber.child,
16563+
sibling = _fiber.sibling,
16564+
tag = _fiber.tag;
16565+
_fiber = _fiber.type;
16566+
var candidateType = null;
16567+
switch (tag) {
16568+
case 0:
16569+
case 15:
16570+
case 1:
16571+
candidateType = _fiber;
16572+
break;
16573+
case 11:
16574+
candidateType = _fiber.render;
16575+
}
16576+
if (null === resolveFamily)
16577+
throw Error("Expected resolveFamily to be set during hot reload.");
16578+
var needsRender = !1;
16579+
_fiber = !1;
16580+
null !== candidateType &&
16581+
((candidateType = resolveFamily(candidateType)),
16582+
void 0 !== candidateType &&
16583+
(staleFamilies.has(candidateType)
16584+
? (_fiber = !0)
16585+
: updatedFamilies.has(candidateType) &&
16586+
(1 === tag ? (_fiber = !0) : (needsRender = !0))));
16587+
null !== failedBoundaries &&
16588+
(failedBoundaries.has(fiber) ||
16589+
(null !== alternate && failedBoundaries.has(alternate))) &&
16590+
(_fiber = !0);
16591+
_fiber && (fiber._debugNeedsRemount = !0);
16592+
if (_fiber || needsRender)
16593+
(alternate = enqueueConcurrentRenderForLane(fiber, 2)),
16594+
null !== alternate && scheduleUpdateOnFiber(alternate, fiber, 2);
16595+
null === child ||
16596+
_fiber ||
16597+
scheduleFibersWithFamiliesRecursively(
16598+
child,
16599+
updatedFamilies,
16600+
staleFamilies
16601+
);
16602+
if (null === sibling) break;
16603+
fiber = sibling;
16604+
} while (1);
1660616605
}
1660716606
function FiberNode(tag, pendingProps, key, mode) {
1660816607
this.tag = tag;
@@ -19353,10 +19352,10 @@ __DEV__ &&
1935319352
(function () {
1935419353
var internals = {
1935519354
bundleType: 1,
19356-
version: "19.2.0-www-modern-3958d5d8-20250807",
19355+
version: "19.2.0-www-modern-cf6e502e-20250809",
1935719356
rendererPackageName: "react-art",
1935819357
currentDispatcherRef: ReactSharedInternals,
19359-
reconcilerVersion: "19.2.0-www-modern-3958d5d8-20250807"
19358+
reconcilerVersion: "19.2.0-www-modern-cf6e502e-20250809"
1936019359
};
1936119360
internals.overrideHookState = overrideHookState;
1936219361
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -19390,7 +19389,7 @@ __DEV__ &&
1939019389
exports.Shape = Shape;
1939119390
exports.Surface = Surface;
1939219391
exports.Text = Text;
19393-
exports.version = "19.2.0-www-modern-3958d5d8-20250807";
19392+
exports.version = "19.2.0-www-modern-cf6e502e-20250809";
1939419393
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1939519394
"function" ===
1939619395
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)