Skip to content

Commit 57f6b8f

Browse files
committed
Remove RefreshRuntime.findAffectedHostInstances (#30538)
I originally added this with a plan to visualize which nodes got updated after a Fast Refresh. I didn't end up implementing that part, and to my knowledge, no actively used integration actually does that or use this method. - [Webpack plugin doesn't use it](https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/f1c8b9a44198449093ca95f85af5df97925e1cfc/lib/runtime/RefreshUtils.js) - [RN doesn't use it](https://github.com/facebook/react-native/blob/23c5c42de01953ed7b8e8938c2d3a8fac82250a0/packages/react-native/Libraries/Core/setUpReactRefresh.js) - [Global GitHub code search](https://github.com/search?q=findAffectedHostInstances&type=code&p=1) only shows copies of this code and the type definition based on it, but not actual calls to it We should be able to delete this without a problem. DiffTrain build for [96f3093](96f3093)
1 parent 53526c5 commit 57f6b8f

36 files changed

+774
-1734
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
146df7c311831a1d5b35f3783dae4a7030638fcf
1+
96f3093becc1f26e06549b9a54b93db9df8f5689
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
146df7c311831a1d5b35f3783dae4a7030638fcf
1+
96f3093becc1f26e06549b9a54b93db9df8f5689

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2001,7 +2001,7 @@ __DEV__ &&
20012001
exports.useTransition = function () {
20022002
return resolveDispatcher().useTransition();
20032003
};
2004-
exports.version = "19.0.0-www-classic-146df7c3-20240730";
2004+
exports.version = "19.0.0-www-classic-96f3093b-20240730";
20052005
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
20062006
"function" ===
20072007
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
@@ -1981,7 +1981,7 @@ __DEV__ &&
19811981
exports.useTransition = function () {
19821982
return resolveDispatcher().useTransition();
19831983
};
1984-
exports.version = "19.0.0-www-modern-146df7c3-20240730";
1984+
exports.version = "19.0.0-www-modern-96f3093b-20240730";
19851985
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19861986
"function" ===
19871987
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
@@ -665,4 +665,4 @@ exports.useSyncExternalStore = function (
665665
exports.useTransition = function () {
666666
return ReactSharedInternals.H.useTransition();
667667
};
668-
exports.version = "19.0.0-www-classic-146df7c3-20240730";
668+
exports.version = "19.0.0-www-classic-96f3093b-20240730";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,4 +665,4 @@ exports.useSyncExternalStore = function (
665665
exports.useTransition = function () {
666666
return ReactSharedInternals.H.useTransition();
667667
};
668-
exports.version = "19.0.0-www-modern-146df7c3-20240730";
668+
exports.version = "19.0.0-www-modern-96f3093b-20240730";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ exports.useSyncExternalStore = function (
669669
exports.useTransition = function () {
670670
return ReactSharedInternals.H.useTransition();
671671
};
672-
exports.version = "19.0.0-www-classic-146df7c3-20240730";
672+
exports.version = "19.0.0-www-classic-96f3093b-20240730";
673673
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
674674
"function" ===
675675
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
@@ -669,7 +669,7 @@ exports.useSyncExternalStore = function (
669669
exports.useTransition = function () {
670670
return ReactSharedInternals.H.useTransition();
671671
};
672-
exports.version = "19.0.0-www-modern-146df7c3-20240730";
672+
exports.version = "19.0.0-www-modern-96f3093b-20240730";
673673
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
674674
"function" ===
675675
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 3 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,6 @@ __DEV__ &&
7272
function shouldErrorImpl() {
7373
return null;
7474
}
75-
function findHostInstancesForRefresh(root, families) {
76-
var hostInstances = new Set();
77-
families = new Set(
78-
families.map(function (family) {
79-
return family.current;
80-
})
81-
);
82-
findHostInstancesForMatchingFibersRecursively(
83-
root.current,
84-
families,
85-
hostInstances
86-
);
87-
return hostInstances;
88-
}
8975
function scheduleRoot(root, element) {
9076
root.context === emptyContextObject &&
9177
(updateContainerSync(element, root, null, null), flushSyncWork());
@@ -13964,83 +13950,6 @@ __DEV__ &&
1396413950
staleFamilies
1396513951
);
1396613952
}
13967-
function findHostInstancesForMatchingFibersRecursively(
13968-
fiber,
13969-
types,
13970-
hostInstances
13971-
) {
13972-
var child = fiber.child,
13973-
sibling = fiber.sibling,
13974-
type = fiber.type,
13975-
candidateType = null;
13976-
switch (fiber.tag) {
13977-
case 0:
13978-
case 15:
13979-
case 1:
13980-
candidateType = type;
13981-
break;
13982-
case 11:
13983-
candidateType = type.render;
13984-
}
13985-
type = !1;
13986-
null !== candidateType && types.has(candidateType) && (type = !0);
13987-
if (type)
13988-
a: {
13989-
b: for (child = fiber, candidateType = !1; ; ) {
13990-
if (5 === child.tag || 26 === child.tag)
13991-
(candidateType = !0), hostInstances.add(child.stateNode);
13992-
else if (null !== child.child) {
13993-
child.child.return = child;
13994-
child = child.child;
13995-
continue;
13996-
}
13997-
if (child === fiber) {
13998-
child = candidateType;
13999-
break b;
14000-
}
14001-
for (; null === child.sibling; ) {
14002-
if (null === child.return || child.return === fiber) {
14003-
child = candidateType;
14004-
break b;
14005-
}
14006-
child = child.return;
14007-
}
14008-
child.sibling.return = child.return;
14009-
child = child.sibling;
14010-
}
14011-
if (!child)
14012-
for (;;) {
14013-
switch (fiber.tag) {
14014-
case 27:
14015-
case 5:
14016-
hostInstances.add(fiber.stateNode);
14017-
break a;
14018-
case 4:
14019-
hostInstances.add(fiber.stateNode.containerInfo);
14020-
break a;
14021-
case 3:
14022-
hostInstances.add(fiber.stateNode.containerInfo);
14023-
break a;
14024-
}
14025-
if (null === fiber.return)
14026-
throw Error("Expected to reach root first.");
14027-
fiber = fiber.return;
14028-
}
14029-
}
14030-
else
14031-
null !== child &&
14032-
findHostInstancesForMatchingFibersRecursively(
14033-
child,
14034-
types,
14035-
hostInstances
14036-
);
14037-
null !== sibling &&
14038-
findHostInstancesForMatchingFibersRecursively(
14039-
sibling,
14040-
types,
14041-
hostInstances
14042-
);
14043-
}
1404413953
function FiberNode(tag, pendingProps, key, mode) {
1404513954
this.tag = tag;
1404613955
this.key = key;
@@ -16874,11 +16783,11 @@ __DEV__ &&
1687416783
(function () {
1687516784
var internals = {
1687616785
bundleType: 1,
16877-
version: "19.0.0-www-classic-146df7c3-20240730",
16786+
version: "19.0.0-www-classic-96f3093b-20240730",
1687816787
rendererPackageName: "react-art",
1687916788
currentDispatcherRef: ReactSharedInternals,
1688016789
findFiberByHostInstance: getInstanceFromNode,
16881-
reconcilerVersion: "19.0.0-www-classic-146df7c3-20240730"
16790+
reconcilerVersion: "19.0.0-www-classic-96f3093b-20240730"
1688216791
};
1688316792
internals.overrideHookState = overrideHookState;
1688416793
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -16889,7 +16798,6 @@ __DEV__ &&
1688916798
internals.scheduleUpdate = scheduleUpdate;
1689016799
internals.setErrorHandler = setErrorHandler;
1689116800
internals.setSuspenseHandler = setSuspenseHandler;
16892-
internals.findHostInstancesForRefresh = findHostInstancesForRefresh;
1689316801
internals.scheduleRefresh = scheduleRefresh;
1689416802
internals.scheduleRoot = scheduleRoot;
1689516803
internals.setRefreshHandler = setRefreshHandler;
@@ -16913,7 +16821,7 @@ __DEV__ &&
1691316821
exports.Shape = Shape;
1691416822
exports.Surface = Surface;
1691516823
exports.Text = Text;
16916-
exports.version = "19.0.0-www-classic-146df7c3-20240730";
16824+
exports.version = "19.0.0-www-classic-96f3093b-20240730";
1691716825
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1691816826
"function" ===
1691916827
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 3 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,6 @@ __DEV__ &&
7272
function shouldErrorImpl() {
7373
return null;
7474
}
75-
function findHostInstancesForRefresh(root, families) {
76-
var hostInstances = new Set();
77-
families = new Set(
78-
families.map(function (family) {
79-
return family.current;
80-
})
81-
);
82-
findHostInstancesForMatchingFibersRecursively(
83-
root.current,
84-
families,
85-
hostInstances
86-
);
87-
return hostInstances;
88-
}
8975
function scheduleRoot(root, element) {
9076
root.context === emptyContextObject &&
9177
(updateContainerSync(element, root, null, null), flushSyncWork());
@@ -13429,83 +13415,6 @@ __DEV__ &&
1342913415
staleFamilies
1343013416
);
1343113417
}
13432-
function findHostInstancesForMatchingFibersRecursively(
13433-
fiber,
13434-
types,
13435-
hostInstances
13436-
) {
13437-
var child = fiber.child,
13438-
sibling = fiber.sibling,
13439-
type = fiber.type,
13440-
candidateType = null;
13441-
switch (fiber.tag) {
13442-
case 0:
13443-
case 15:
13444-
case 1:
13445-
candidateType = type;
13446-
break;
13447-
case 11:
13448-
candidateType = type.render;
13449-
}
13450-
type = !1;
13451-
null !== candidateType && types.has(candidateType) && (type = !0);
13452-
if (type)
13453-
a: {
13454-
b: for (child = fiber, candidateType = !1; ; ) {
13455-
if (5 === child.tag || 26 === child.tag)
13456-
(candidateType = !0), hostInstances.add(child.stateNode);
13457-
else if (null !== child.child) {
13458-
child.child.return = child;
13459-
child = child.child;
13460-
continue;
13461-
}
13462-
if (child === fiber) {
13463-
child = candidateType;
13464-
break b;
13465-
}
13466-
for (; null === child.sibling; ) {
13467-
if (null === child.return || child.return === fiber) {
13468-
child = candidateType;
13469-
break b;
13470-
}
13471-
child = child.return;
13472-
}
13473-
child.sibling.return = child.return;
13474-
child = child.sibling;
13475-
}
13476-
if (!child)
13477-
for (;;) {
13478-
switch (fiber.tag) {
13479-
case 27:
13480-
case 5:
13481-
hostInstances.add(fiber.stateNode);
13482-
break a;
13483-
case 4:
13484-
hostInstances.add(fiber.stateNode.containerInfo);
13485-
break a;
13486-
case 3:
13487-
hostInstances.add(fiber.stateNode.containerInfo);
13488-
break a;
13489-
}
13490-
if (null === fiber.return)
13491-
throw Error("Expected to reach root first.");
13492-
fiber = fiber.return;
13493-
}
13494-
}
13495-
else
13496-
null !== child &&
13497-
findHostInstancesForMatchingFibersRecursively(
13498-
child,
13499-
types,
13500-
hostInstances
13501-
);
13502-
null !== sibling &&
13503-
findHostInstancesForMatchingFibersRecursively(
13504-
sibling,
13505-
types,
13506-
hostInstances
13507-
);
13508-
}
1350913418
function FiberNode(tag, pendingProps, key, mode) {
1351013419
this.tag = tag;
1351113420
this.key = key;
@@ -16287,11 +16196,11 @@ __DEV__ &&
1628716196
(function () {
1628816197
var internals = {
1628916198
bundleType: 1,
16290-
version: "19.0.0-www-modern-146df7c3-20240730",
16199+
version: "19.0.0-www-modern-96f3093b-20240730",
1629116200
rendererPackageName: "react-art",
1629216201
currentDispatcherRef: ReactSharedInternals,
1629316202
findFiberByHostInstance: getInstanceFromNode,
16294-
reconcilerVersion: "19.0.0-www-modern-146df7c3-20240730"
16203+
reconcilerVersion: "19.0.0-www-modern-96f3093b-20240730"
1629516204
};
1629616205
internals.overrideHookState = overrideHookState;
1629716206
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -16302,7 +16211,6 @@ __DEV__ &&
1630216211
internals.scheduleUpdate = scheduleUpdate;
1630316212
internals.setErrorHandler = setErrorHandler;
1630416213
internals.setSuspenseHandler = setSuspenseHandler;
16305-
internals.findHostInstancesForRefresh = findHostInstancesForRefresh;
1630616214
internals.scheduleRefresh = scheduleRefresh;
1630716215
internals.scheduleRoot = scheduleRoot;
1630816216
internals.setRefreshHandler = setRefreshHandler;
@@ -16326,7 +16234,7 @@ __DEV__ &&
1632616234
exports.Shape = Shape;
1632716235
exports.Surface = Surface;
1632816236
exports.Text = Text;
16329-
exports.version = "19.0.0-www-modern-146df7c3-20240730";
16237+
exports.version = "19.0.0-www-modern-96f3093b-20240730";
1633016238
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1633116239
"function" ===
1633216240
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)