Skip to content

Commit

Permalink
Encode better error messages when part of the context is a client ref…
Browse files Browse the repository at this point in the history
…erence (#28355)

Alternative to #28354.

If a client reference is one of the props being describes as part of
another error, we call toString on it, which errors.

We should error explicitly when a Symbol prop is extracted.

However, pragmatically I added the toString symbol tag even though we
don't know what the real tostring will be but we also lie about the
typeof.

We can however in addition to this give it a different description
because describing this property as an object isn't quite right.

We probably could extract the export name but that's kind of renderer
specific and I just added this shared module to Fizz which doesn't have
that which is unfortunate an consequence.

For default exports we don't have a good name of what the alias was in
the receiver. Could maybe call it "default" but for now I just call it
"client".

DiffTrain build for commit c323f82.
  • Loading branch information
sebmarkbage committed Feb 19, 2024
1 parent ff7932d commit 9afcb68
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25697,7 +25697,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "18.3.0-canary-65a0e2b25-20240219";
var ReactVersion = "18.3.0-canary-c323f8290-20240219";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9179,7 +9179,7 @@ var devToolsConfig$jscomp$inline_1018 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-65a0e2b25-20240219",
version: "18.3.0-canary-c323f8290-20240219",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1199 = {
Expand Down Expand Up @@ -9210,7 +9210,7 @@ var internals$jscomp$inline_1199 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-65a0e2b25-20240219"
reconcilerVersion: "18.3.0-canary-c323f8290-20240219"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1200 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9607,7 +9607,7 @@ var devToolsConfig$jscomp$inline_1060 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-65a0e2b25-20240219",
version: "18.3.0-canary-c323f8290-20240219",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1240 = {
Expand Down Expand Up @@ -9638,7 +9638,7 @@ var internals$jscomp$inline_1240 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-65a0e2b25-20240219"
reconcilerVersion: "18.3.0-canary-c323f8290-20240219"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1241 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.0-canary-65a0e2b25-20240219";
var ReactVersion = "18.3.0-canary-c323f8290-20240219";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,4 +590,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-65a0e2b25-20240219";
exports.version = "18.3.0-canary-c323f8290-20240219";
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-65a0e2b25-20240219";
exports.version = "18.3.0-canary-c323f8290-20240219";
"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 @@
65a0e2b25ec4642f83c32d7599b5252c3955a60b
c323f8290c2336713b62c69322bb30ed63234c24

0 comments on commit 9afcb68

Please sign in to comment.