Skip to content

Commit

Permalink
Revert "Track Owner for Server Components in DEV (#28753)"
Browse files Browse the repository at this point in the history
This reverts commit e0455fe.

DiffTrain build for commit 87b495f.
  • Loading branch information
kassens committed Apr 11, 2024
1 parent 812db07 commit 97eab46
Show file tree
Hide file tree
Showing 13 changed files with 434 additions and 361 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<568cb702cdaad263cf51f5b74157b2ba>>
* @generated SignedSource<<3151ca79177b1e7b421f14db372bfd97>>
*/

"use strict";
Expand Down Expand Up @@ -349,17 +349,6 @@ if (__DEV__) {
return type.displayName || "Context";
}

function getComponentNameFromOwner(owner) {
if (typeof owner.tag === "number") {
return getComponentNameFromFiber(owner);
}

if (typeof owner.name === "string") {
return owner.name;
}

return null;
}
function getComponentNameFromFiber(fiber) {
var tag = fiber.tag,
type = fiber.type;
Expand Down Expand Up @@ -2892,14 +2881,21 @@ if (__DEV__) {

var objectIs = typeof Object.is === "function" ? Object.is : is; // $FlowFixMe[method-unbinding]

function describeBuiltInComponentFrame(name) {
function describeBuiltInComponentFrame(name, ownerFn) {
{
return describeComponentFrame(name);
var ownerName = null;

if (ownerFn) {
ownerName = ownerFn.displayName || ownerFn.name || null;
}

return describeComponentFrame(name, ownerName);
}
}
function describeDebugInfoFrame(name, env) {
return describeBuiltInComponentFrame(
name + (env ? " (" + env + ")" : "")
name + (env ? " (" + env + ")" : ""),
null
);
}

Expand All @@ -2908,51 +2904,65 @@ if (__DEV__) {
new PossiblyWeakMap$1();
}

function describeComponentFrame(name) {
return "\n in " + (name || "Unknown");
function describeComponentFrame(name, ownerName) {
var sourceInfo = "";

if (ownerName) {
sourceInfo = " (created by " + ownerName + ")";
}

return "\n in " + (name || "Unknown") + sourceInfo;
}

function describeClassComponentFrame(ctor) {
function describeClassComponentFrame(ctor, ownerFn) {
{
return describeFunctionComponentFrame(ctor);
return describeFunctionComponentFrame(ctor, ownerFn);
}
}
function describeFunctionComponentFrame(fn) {
function describeFunctionComponentFrame(fn, ownerFn) {
{
if (!fn) {
return "";
}

var name = fn.displayName || fn.name || null;
return describeComponentFrame(name);
var ownerName = null;

if (ownerFn) {
ownerName = ownerFn.displayName || ownerFn.name || null;
}

return describeComponentFrame(name, ownerName);
}
}

function describeFiber(fiber) {
var owner = fiber._debugOwner ? fiber._debugOwner.type : null;

switch (fiber.tag) {
case HostHoistable:
case HostSingleton:
case HostComponent:
return describeBuiltInComponentFrame(fiber.type);
return describeBuiltInComponentFrame(fiber.type, owner);

case LazyComponent:
return describeBuiltInComponentFrame("Lazy");
return describeBuiltInComponentFrame("Lazy", owner);

case SuspenseComponent:
return describeBuiltInComponentFrame("Suspense");
return describeBuiltInComponentFrame("Suspense", owner);

case SuspenseListComponent:
return describeBuiltInComponentFrame("SuspenseList");
return describeBuiltInComponentFrame("SuspenseList", owner);

case FunctionComponent:
case SimpleMemoComponent:
return describeFunctionComponentFrame(fiber.type);
return describeFunctionComponentFrame(fiber.type, owner);

case ForwardRef:
return describeFunctionComponentFrame(fiber.type.render);
return describeFunctionComponentFrame(fiber.type.render, owner);

case ClassComponent:
return describeClassComponentFrame(fiber.type);
return describeClassComponentFrame(fiber.type, owner);

default:
return "";
Expand Down Expand Up @@ -5243,8 +5253,8 @@ if (__DEV__) {

var owner = current._debugOwner;

if (owner != null) {
return getComponentNameFromOwner(owner);
if (owner !== null && typeof owner !== "undefined") {
return getComponentNameFromFiber(owner);
}
}

Expand Down Expand Up @@ -26550,7 +26560,7 @@ if (__DEV__) {
"named imports.";
}

var ownerName = owner ? getComponentNameFromOwner(owner) : null;
var ownerName = owner ? getComponentNameFromFiber(owner) : null;

if (ownerName) {
info += "\n\nCheck the render method of `" + ownerName + "`.";
Expand Down Expand Up @@ -26813,7 +26823,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "19.0.0-canary-6077cfa0";
var ReactVersion = "19.0.0-canary-29bd6113";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<edf13283385b2e5a6dba5a299a226ed0>>
* @generated SignedSource<<432e9d2dc4a6b45da0162dd89f63ecfc>>
*/

"use strict";
Expand Down Expand Up @@ -654,24 +654,28 @@ function is(x, y) {
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
}
var objectIs = "function" === typeof Object.is ? Object.is : is;
function describeBuiltInComponentFrame(name) {
return "\n in " + (name || "Unknown");
function describeComponentFrame(name, ownerName) {
var sourceInfo = "";
ownerName && (sourceInfo = " (created by " + ownerName + ")");
return "\n in " + (name || "Unknown") + sourceInfo;
}
function describeFunctionComponentFrame(fn) {
return fn ? "\n in " + (fn.displayName || fn.name || "Unknown") : "";
return fn
? describeComponentFrame(fn.displayName || fn.name || null, null)
: "";
}
function describeFiber(fiber) {
switch (fiber.tag) {
case 26:
case 27:
case 5:
return describeBuiltInComponentFrame(fiber.type);
return describeComponentFrame(fiber.type, null);
case 16:
return describeBuiltInComponentFrame("Lazy");
return describeComponentFrame("Lazy", null);
case 13:
return describeBuiltInComponentFrame("Suspense");
return describeComponentFrame("Suspense", null);
case 19:
return describeBuiltInComponentFrame("SuspenseList");
return describeComponentFrame("SuspenseList", null);
case 0:
case 15:
return describeFunctionComponentFrame(fiber.type);
Expand Down Expand Up @@ -9207,19 +9211,19 @@ function wrapFiber(fiber) {
fiberToWrapper.set(fiber, wrapper));
return wrapper;
}
var devToolsConfig$jscomp$inline_994 = {
var devToolsConfig$jscomp$inline_995 = {
findFiberByHostInstance: function () {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "19.0.0-canary-51953c35",
version: "19.0.0-canary-0689007c",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1184 = {
bundleType: devToolsConfig$jscomp$inline_994.bundleType,
version: devToolsConfig$jscomp$inline_994.version,
rendererPackageName: devToolsConfig$jscomp$inline_994.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_994.rendererConfig,
var internals$jscomp$inline_1185 = {
bundleType: devToolsConfig$jscomp$inline_995.bundleType,
version: devToolsConfig$jscomp$inline_995.version,
rendererPackageName: devToolsConfig$jscomp$inline_995.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_995.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
Expand All @@ -9236,26 +9240,26 @@ var internals$jscomp$inline_1184 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_994.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_995.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-canary-51953c35"
reconcilerVersion: "19.0.0-canary-0689007c"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1185 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
var hook$jscomp$inline_1186 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
if (
!hook$jscomp$inline_1185.isDisabled &&
hook$jscomp$inline_1185.supportsFiber
!hook$jscomp$inline_1186.isDisabled &&
hook$jscomp$inline_1186.supportsFiber
)
try {
(rendererID = hook$jscomp$inline_1185.inject(
internals$jscomp$inline_1184
(rendererID = hook$jscomp$inline_1186.inject(
internals$jscomp$inline_1185
)),
(injectedHook = hook$jscomp$inline_1185);
(injectedHook = hook$jscomp$inline_1186);
} catch (err) {}
}
exports._Scheduler = Scheduler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<ab4a7efab0297a08768bdea5ec49f164>>
* @generated SignedSource<<c03b4f2580a3f28e5204dac43fdc8e39>>
*/

"use strict";
Expand Down Expand Up @@ -742,24 +742,28 @@ function is(x, y) {
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
}
var objectIs = "function" === typeof Object.is ? Object.is : is;
function describeBuiltInComponentFrame(name) {
return "\n in " + (name || "Unknown");
function describeComponentFrame(name, ownerName) {
var sourceInfo = "";
ownerName && (sourceInfo = " (created by " + ownerName + ")");
return "\n in " + (name || "Unknown") + sourceInfo;
}
function describeFunctionComponentFrame(fn) {
return fn ? "\n in " + (fn.displayName || fn.name || "Unknown") : "";
return fn
? describeComponentFrame(fn.displayName || fn.name || null, null)
: "";
}
function describeFiber(fiber) {
switch (fiber.tag) {
case 26:
case 27:
case 5:
return describeBuiltInComponentFrame(fiber.type);
return describeComponentFrame(fiber.type, null);
case 16:
return describeBuiltInComponentFrame("Lazy");
return describeComponentFrame("Lazy", null);
case 13:
return describeBuiltInComponentFrame("Suspense");
return describeComponentFrame("Suspense", null);
case 19:
return describeBuiltInComponentFrame("SuspenseList");
return describeComponentFrame("SuspenseList", null);
case 0:
case 15:
return describeFunctionComponentFrame(fiber.type);
Expand Down Expand Up @@ -9823,12 +9827,12 @@ function wrapFiber(fiber) {
fiberToWrapper.set(fiber, wrapper));
return wrapper;
}
var devToolsConfig$jscomp$inline_1078 = {
var devToolsConfig$jscomp$inline_1079 = {
findFiberByHostInstance: function () {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "19.0.0-canary-c0ff0c26",
version: "19.0.0-canary-3aa3c53d",
rendererPackageName: "react-test-renderer"
};
(function (internals) {
Expand All @@ -9845,10 +9849,10 @@ var devToolsConfig$jscomp$inline_1078 = {
} catch (err) {}
return hook.checkDCE ? !0 : !1;
})({
bundleType: devToolsConfig$jscomp$inline_1078.bundleType,
version: devToolsConfig$jscomp$inline_1078.version,
rendererPackageName: devToolsConfig$jscomp$inline_1078.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1078.rendererConfig,
bundleType: devToolsConfig$jscomp$inline_1079.bundleType,
version: devToolsConfig$jscomp$inline_1079.version,
rendererPackageName: devToolsConfig$jscomp$inline_1079.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1079.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
Expand All @@ -9865,14 +9869,14 @@ var devToolsConfig$jscomp$inline_1078 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_1078.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_1079.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-canary-c0ff0c26"
reconcilerVersion: "19.0.0-canary-3aa3c53d"
});
exports._Scheduler = Scheduler;
exports.act = act;
Expand Down
Loading

0 comments on commit 97eab46

Please sign in to comment.