Skip to content

Commit

Permalink
fix[ReactDebugHooks/find-primitive-index]: remove some assumptions (#…
Browse files Browse the repository at this point in the history
…29652)

Partially reverts #28593.

While rolling out RDT 5.2.0, I've observed some issues on React Native
side: hooks inspection for some complex hook trees, like in
AnimatedView, were broken. After some debugging, I've noticed a
difference between what is in frame's source.

The difference is in the top-most frame, where with V8 it will correctly
pick up the `Type` as `Proxy` in `hookStack`, but for Hermes it will be
`Object`. This means that for React Native this top most frame is
skipped, since sources are identical.

Here I am reverting back to the previous logic, where we check each
frame if its a part of the wrapper, but also updated `isReactWrapper`
function to have an explicit case for `useFormStatus` support.

DiffTrain build for commit fb61a1b.
  • Loading branch information
hoxyq committed May 30, 2024
1 parent a889374 commit 214868d
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<367c9327dcb04e3bfe28018853017027>>
* @generated SignedSource<<7ca4155a78e484bb791befb0a0483562>>
*/

'use strict';
Expand Down Expand Up @@ -23471,7 +23471,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}

var ReactVersion = '19.0.0-rc-5bd4031226-20240530';
var ReactVersion = '19.0.0-rc-fb61a1b515-20240530';

/*
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<c59e1f648d055156cb5c653b5cb5e8f3>>
* @generated SignedSource<<3467ef5cc029c44f026f965d523ec535>>
*/

"use strict";
Expand Down Expand Up @@ -9298,7 +9298,7 @@ var devToolsConfig$jscomp$inline_1047 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "19.0.0-rc-5bd4031226-20240530",
version: "19.0.0-rc-fb61a1b515-20240530",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1234 = {
Expand Down Expand Up @@ -9329,7 +9329,7 @@ var internals$jscomp$inline_1234 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-rc-5bd4031226-20240530"
reconcilerVersion: "19.0.0-rc-fb61a1b515-20240530"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1235 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<b9e44a6e588f26082b700ae7ee00b4d6>>
* @generated SignedSource<<dcdf0ff67842ef74c5e2d1b33aa75828>>
*/

"use strict";
Expand Down Expand Up @@ -9920,7 +9920,7 @@ var devToolsConfig$jscomp$inline_1130 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "19.0.0-rc-5bd4031226-20240530",
version: "19.0.0-rc-fb61a1b515-20240530",
rendererPackageName: "react-test-renderer"
};
(function (internals) {
Expand Down Expand Up @@ -9964,7 +9964,7 @@ var devToolsConfig$jscomp$inline_1130 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-rc-5bd4031226-20240530"
reconcilerVersion: "19.0.0-rc-fb61a1b515-20240530"
});
exports._Scheduler = Scheduler;
exports.act = act;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<3418fd00fe2b53485f207d00155bc6b3>>
* @generated SignedSource<<236832470786fa8d630f95ea59053100>>
*/

'use strict';
Expand All @@ -24,7 +24,7 @@ if (
}
var dynamicFlagsUntyped = require('ReactNativeInternalFeatureFlags');

var ReactVersion = '19.0.0-rc-5bd4031226-20240530';
var ReactVersion = '19.0.0-rc-fb61a1b515-20240530';

// Re-export dynamic flags from the internal module.
var dynamicFlags = dynamicFlagsUntyped; // We destructure each value before re-exporting to avoid a dynamic look-up on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<b6fbdccb3bf217f6f2c5fed4e0638b31>>
* @generated SignedSource<<0ad7d99d0ddc3869ed760873fb4a1782>>
*/

"use strict";
Expand Down Expand Up @@ -604,4 +604,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-rc-5bd4031226-20240530";
exports.version = "19.0.0-rc-fb61a1b515-20240530";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<71b4749bcbc89ff9b3f9ce7b74843237>>
* @generated SignedSource<<e486bd0359a6cb764eff1d066bebd329>>
*/

"use strict";
Expand Down Expand Up @@ -608,7 +608,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-rc-5bd4031226-20240530";
exports.version = "19.0.0-rc-fb61a1b515-20240530";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5bd403122645ef0f0924ac5466f56e670a8f5b8d
fb61a1b515c5ea0e31b0dac19184454a79c4baf1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<78fe1eefa98ef7ce9f3aebf663a4466b>>
* @generated SignedSource<<995c3dc1c310eccb6e0c62c1d4d635a7>>
*/

'use strict';
Expand Down Expand Up @@ -26206,7 +26206,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}

var ReactVersion = '19.0.0-rc-5bd4031226-20240530';
var ReactVersion = '19.0.0-rc-fb61a1b515-20240530';

/*
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<c40039fc034f320dbb7945da452feee1>>
* @generated SignedSource<<845d34a6fb2bdf695a5050c565c6b6d8>>
*/

"use strict";
Expand Down Expand Up @@ -10551,7 +10551,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1124 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "19.0.0-rc-5bd4031226-20240530",
version: "19.0.0-rc-fb61a1b515-20240530",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -10594,7 +10594,7 @@ var internals$jscomp$inline_1350 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-rc-5bd4031226-20240530"
reconcilerVersion: "19.0.0-rc-fb61a1b515-20240530"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1351 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<687caccb927bc1400fc4b3a52c018710>>
* @generated SignedSource<<e6d8bc91c13c8cda3989052069e1ea8f>>
*/

"use strict";
Expand Down Expand Up @@ -11257,7 +11257,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1205 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "19.0.0-rc-5bd4031226-20240530",
version: "19.0.0-rc-fb61a1b515-20240530",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -11313,7 +11313,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-rc-5bd4031226-20240530"
reconcilerVersion: "19.0.0-rc-fb61a1b515-20240530"
});
exports.createPortal = function (children, containerTag) {
return createPortal$1(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<c4e3e8482b88b0308d88a57f77c48bc9>>
* @generated SignedSource<<e135c6377058b2f8f0688646d84a7ee7>>
*/

'use strict';
Expand Down Expand Up @@ -26562,7 +26562,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}

var ReactVersion = '19.0.0-rc-5bd4031226-20240530';
var ReactVersion = '19.0.0-rc-fb61a1b515-20240530';

/*
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<b2538261a147c0772bf6d2020bee9028>>
* @generated SignedSource<<f87be2e9c8f672af7046ca562209db03>>
*/

"use strict";
Expand Down Expand Up @@ -10696,11 +10696,11 @@ function traverseOwnerTreeUp(hierarchy, instance) {
traverseOwnerTreeUp(hierarchy, instance);
}
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-rc-5bd4031226-20240530" !== isomorphicReactPackageVersion)
if ("19.0.0-rc-fb61a1b515-20240530" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-native-renderer: 19.0.0-rc-5bd4031226-20240530\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-native-renderer: 19.0.0-rc-fb61a1b515-20240530\nLearn more: https://react.dev/warnings/version-mismatch")
);
if (
"function" !==
Expand Down Expand Up @@ -10750,7 +10750,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1192 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "19.0.0-rc-5bd4031226-20240530",
version: "19.0.0-rc-fb61a1b515-20240530",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -10793,7 +10793,7 @@ var internals$jscomp$inline_1439 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-rc-5bd4031226-20240530"
reconcilerVersion: "19.0.0-rc-fb61a1b515-20240530"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1440 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<98d2e60e6aaa56fee0e82981872ca9cc>>
* @generated SignedSource<<0cff48a4781a04f48ecdeb3be7565d9e>>
*/

"use strict";
Expand Down Expand Up @@ -11403,11 +11403,11 @@ function traverseOwnerTreeUp(hierarchy, instance) {
traverseOwnerTreeUp(hierarchy, instance);
}
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-rc-5bd4031226-20240530" !== isomorphicReactPackageVersion)
if ("19.0.0-rc-fb61a1b515-20240530" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-native-renderer: 19.0.0-rc-5bd4031226-20240530\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-native-renderer: 19.0.0-rc-fb61a1b515-20240530\nLearn more: https://react.dev/warnings/version-mismatch")
);
if (
"function" !==
Expand Down Expand Up @@ -11457,7 +11457,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1273 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "19.0.0-rc-5bd4031226-20240530",
version: "19.0.0-rc-fb61a1b515-20240530",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForInstance: getInspectorDataForInstance,
Expand Down Expand Up @@ -11513,7 +11513,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-rc-5bd4031226-20240530"
reconcilerVersion: "19.0.0-rc-fb61a1b515-20240530"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
computeComponentStackForErrorReporting: function (reactTag) {
Expand Down

0 comments on commit 214868d

Please sign in to comment.