Skip to content

Commit b255b4e

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 commit 96f3093.
1 parent 69c4bef commit b255b4e

File tree

14 files changed

+46
-322
lines changed

14 files changed

+46
-322
lines changed

compiled-rn/VERSION_NATIVE_FB

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.0.0-native-fb-146df7c3-20240730
1+
19.0.0-native-fb-96f3093b-20240730

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 6 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<1e2bece4331c5678fb57355aa29aeb8c>>
10+
* @generated SignedSource<<6fed2a4e8f06bbe58d92e30db4e93e26>>
1111
*/
1212

1313
"use strict";
1414
__DEV__ &&
1515
(function () {
16-
function JSCompiler_object_inline_createNodeMock_1093() {
16+
function JSCompiler_object_inline_createNodeMock_1088() {
1717
return null;
1818
}
1919
function findHook(fiber, id) {
@@ -78,20 +78,6 @@ __DEV__ &&
7878
function createFiber(tag, pendingProps, key, mode) {
7979
return new FiberNode(tag, pendingProps, key, mode);
8080
}
81-
function findHostInstancesForRefresh(root, families) {
82-
var hostInstances = new Set();
83-
families = new Set(
84-
families.map(function (family) {
85-
return family.current;
86-
})
87-
);
88-
findHostInstancesForMatchingFibersRecursively(
89-
root.current,
90-
families,
91-
hostInstances
92-
);
93-
return hostInstances;
94-
}
9581
function scheduleRoot(root, element) {
9682
root.context === emptyContextObject &&
9783
(0 === root.tag && flushPassiveEffects(),
@@ -12159,83 +12145,6 @@ __DEV__ &&
1215912145
staleFamilies
1216012146
);
1216112147
}
12162-
function findHostInstancesForMatchingFibersRecursively(
12163-
fiber,
12164-
types,
12165-
hostInstances
12166-
) {
12167-
var child = fiber.child,
12168-
sibling = fiber.sibling,
12169-
type = fiber.type,
12170-
candidateType = null;
12171-
switch (fiber.tag) {
12172-
case 0:
12173-
case 15:
12174-
case 1:
12175-
candidateType = type;
12176-
break;
12177-
case 11:
12178-
candidateType = type.render;
12179-
}
12180-
type = !1;
12181-
null !== candidateType && types.has(candidateType) && (type = !0);
12182-
if (type)
12183-
a: {
12184-
b: for (child = fiber, candidateType = !1; ; ) {
12185-
if (5 === child.tag || 26 === child.tag)
12186-
(candidateType = !0), hostInstances.add(child.stateNode);
12187-
else if (null !== child.child) {
12188-
child.child.return = child;
12189-
child = child.child;
12190-
continue;
12191-
}
12192-
if (child === fiber) {
12193-
child = candidateType;
12194-
break b;
12195-
}
12196-
for (; null === child.sibling; ) {
12197-
if (null === child.return || child.return === fiber) {
12198-
child = candidateType;
12199-
break b;
12200-
}
12201-
child = child.return;
12202-
}
12203-
child.sibling.return = child.return;
12204-
child = child.sibling;
12205-
}
12206-
if (!child)
12207-
for (;;) {
12208-
switch (fiber.tag) {
12209-
case 27:
12210-
case 5:
12211-
hostInstances.add(fiber.stateNode);
12212-
break a;
12213-
case 4:
12214-
hostInstances.add(fiber.stateNode.containerInfo);
12215-
break a;
12216-
case 3:
12217-
hostInstances.add(fiber.stateNode.containerInfo);
12218-
break a;
12219-
}
12220-
if (null === fiber.return)
12221-
throw Error("Expected to reach root first.");
12222-
fiber = fiber.return;
12223-
}
12224-
}
12225-
else
12226-
null !== child &&
12227-
findHostInstancesForMatchingFibersRecursively(
12228-
child,
12229-
types,
12230-
hostInstances
12231-
);
12232-
null !== sibling &&
12233-
findHostInstancesForMatchingFibersRecursively(
12234-
sibling,
12235-
types,
12236-
hostInstances
12237-
);
12238-
}
1223912148
function FiberNode(tag, pendingProps, key, mode) {
1224012149
this.tag = tag;
1224112150
this.key = key;
@@ -15017,11 +14926,11 @@ __DEV__ &&
1501714926
(function () {
1501814927
var internals = {
1501914928
bundleType: 1,
15020-
version: "19.0.0-native-fb-146df7c3-20240730",
14929+
version: "19.0.0-native-fb-96f3093b-20240730",
1502114930
rendererPackageName: "react-test-renderer",
1502214931
currentDispatcherRef: ReactSharedInternals,
1502314932
findFiberByHostInstance: getInstanceFromNode,
15024-
reconcilerVersion: "19.0.0-native-fb-146df7c3-20240730"
14933+
reconcilerVersion: "19.0.0-native-fb-96f3093b-20240730"
1502514934
};
1502614935
internals.overrideHookState = overrideHookState;
1502714936
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -15032,7 +14941,6 @@ __DEV__ &&
1503214941
internals.scheduleUpdate = scheduleUpdate;
1503314942
internals.setErrorHandler = setErrorHandler;
1503414943
internals.setSuspenseHandler = setSuspenseHandler;
15035-
internals.findHostInstancesForRefresh = findHostInstancesForRefresh;
1503614944
internals.scheduleRefresh = scheduleRefresh;
1503714945
internals.scheduleRoot = scheduleRoot;
1503814946
internals.setRefreshHandler = setRefreshHandler;
@@ -15044,7 +14952,7 @@ __DEV__ &&
1504414952
exports._Scheduler = Scheduler;
1504514953
exports.act = act;
1504614954
exports.create = function (element, options) {
15047-
var createNodeMock = JSCompiler_object_inline_createNodeMock_1093,
14955+
var createNodeMock = JSCompiler_object_inline_createNodeMock_1088,
1504814956
isConcurrent = !1,
1504914957
isStrictMode = !1;
1505014958
"object" === typeof options &&
@@ -15167,5 +15075,5 @@ __DEV__ &&
1516715075
flushSyncWorkAcrossRoots_impl(!0));
1516815076
}
1516915077
};
15170-
exports.version = "19.0.0-native-fb-146df7c3-20240730";
15078+
exports.version = "19.0.0-native-fb-96f3093b-20240730";
1517115079
})();

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<c3bfd3e45f3840d2b620a159b37f9bff>>
10+
* @generated SignedSource<<7887d86ddab680b088b8696053f34099>>
1111
*/
1212

1313
"use strict";
@@ -9312,14 +9312,14 @@ function wrapFiber(fiber) {
93129312
}
93139313
var internals$jscomp$inline_1206 = {
93149314
bundleType: 0,
9315-
version: "19.0.0-native-fb-146df7c3-20240730",
9315+
version: "19.0.0-native-fb-96f3093b-20240730",
93169316
rendererPackageName: "react-test-renderer",
93179317
currentDispatcherRef: ReactSharedInternals,
93189318
findFiberByHostInstance: function (mockNode) {
93199319
mockNode = nodeToInstanceMap.get(mockNode);
93209320
return void 0 !== mockNode ? mockNode.internalInstanceHandle : null;
93219321
},
9322-
reconcilerVersion: "19.0.0-native-fb-146df7c3-20240730"
9322+
reconcilerVersion: "19.0.0-native-fb-96f3093b-20240730"
93239323
};
93249324
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
93259325
var hook$jscomp$inline_1207 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -9455,4 +9455,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
94559455
flushSyncWorkAcrossRoots_impl(!0));
94569456
}
94579457
};
9458-
exports.version = "19.0.0-native-fb-146df7c3-20240730";
9458+
exports.version = "19.0.0-native-fb-96f3093b-20240730";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-test-renderer/cjs/ReactTestRenderer-profiling.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<818fd4f9a39eb697cf9e1b7406a19933>>
10+
* @generated SignedSource<<28661cbe8e9ef7198e1933b127e35856>>
1111
*/
1212

1313
"use strict";
@@ -9925,14 +9925,14 @@ function wrapFiber(fiber) {
99259925
}
99269926
var internals$jscomp$inline_1115 = {
99279927
bundleType: 0,
9928-
version: "19.0.0-native-fb-146df7c3-20240730",
9928+
version: "19.0.0-native-fb-96f3093b-20240730",
99299929
rendererPackageName: "react-test-renderer",
99309930
currentDispatcherRef: ReactSharedInternals,
99319931
findFiberByHostInstance: function (mockNode) {
99329932
mockNode = nodeToInstanceMap.get(mockNode);
99339933
return void 0 !== mockNode ? mockNode.internalInstanceHandle : null;
99349934
},
9935-
reconcilerVersion: "19.0.0-native-fb-146df7c3-20240730",
9935+
reconcilerVersion: "19.0.0-native-fb-96f3093b-20240730",
99369936
getLaneLabelMap: function () {
99379937
for (
99389938
var map = new Map(), lane = 1, index$148 = 0;
@@ -10083,4 +10083,4 @@ exports.unstable_batchedUpdates = function (fn, a) {
1008310083
flushSyncWorkAcrossRoots_impl(!0));
1008410084
}
1008510085
};
10086-
exports.version = "19.0.0-native-fb-146df7c3-20240730";
10086+
exports.version = "19.0.0-native-fb-96f3093b-20240730";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-dev.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<ee5346fb56e9ad0934e5069ea5042faa>>
10+
* @generated SignedSource<<3d06ad2166842760b7fc295fa3c6e3a2>>
1111
*/
1212

1313
"use strict";
@@ -1704,7 +1704,7 @@ __DEV__ &&
17041704
exports.useTransition = function () {
17051705
return resolveDispatcher().useTransition();
17061706
};
1707-
exports.version = "19.0.0-native-fb-146df7c3-20240730";
1707+
exports.version = "19.0.0-native-fb-96f3093b-20240730";
17081708
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
17091709
"function" ===
17101710
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<98e42f2fa8df1a38514b097d02bfd297>>
10+
* @generated SignedSource<<a96e075cac5116019856730abdd19558>>
1111
*/
1212

1313
"use strict";
@@ -579,4 +579,4 @@ exports.useSyncExternalStore = function (
579579
exports.useTransition = function () {
580580
return ReactSharedInternals.H.useTransition();
581581
};
582-
exports.version = "19.0.0-native-fb-146df7c3-20240730";
582+
exports.version = "19.0.0-native-fb-96f3093b-20240730";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react/cjs/React-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<c818979e8843a701bbd26f7a9fc9e095>>
10+
* @generated SignedSource<<62aeefaea01dd817227ea47385e560fe>>
1111
*/
1212

1313
"use strict";
@@ -583,7 +583,7 @@ exports.useSyncExternalStore = function (
583583
exports.useTransition = function () {
584584
return ReactSharedInternals.H.useTransition();
585585
};
586-
exports.version = "19.0.0-native-fb-146df7c3-20240730";
586+
exports.version = "19.0.0-native-fb-96f3093b-20240730";
587587
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
588588
"function" ===
589589
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
146df7c311831a1d5b35f3783dae4a7030638fcf
1+
96f3093becc1f26e06549b9a54b93db9df8f5689

0 commit comments

Comments
 (0)