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 [87b495f](87b495f)
  • Loading branch information
kassens committed Apr 11, 2024
1 parent 2b619ee commit d9f3448
Show file tree
Hide file tree
Showing 30 changed files with 475 additions and 640 deletions.
35 changes: 19 additions & 16 deletions compiled/facebook-www/JSXDEVRuntime-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ if (__DEV__) {

var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name) {
function describeBuiltInComponentFrame(name, ownerFn) {
{
if (prefix === undefined) {
// Extract the VM specific prefix used by each line.
Expand Down Expand Up @@ -740,7 +740,7 @@ if (__DEV__) {

return syntheticFrame;
}
function describeFunctionComponentFrame(fn) {
function describeFunctionComponentFrame(fn, ownerFn) {
{
return describeNativeComponentFrame(fn, false);
}
Expand All @@ -751,7 +751,7 @@ if (__DEV__) {
return !!(prototype && prototype.isReactComponent);
}

function describeUnknownElementTypeFrameInDEV(type) {
function describeUnknownElementTypeFrameInDEV(type, ownerFn) {
if (type == null) {
return "";
}
Expand Down Expand Up @@ -781,7 +781,7 @@ if (__DEV__) {

case REACT_MEMO_TYPE:
// Memo may contain any component type so we recursively resolve it.
return describeUnknownElementTypeFrameInDEV(type.type);
return describeUnknownElementTypeFrameInDEV(type.type, ownerFn);

case REACT_LAZY_TYPE: {
var lazyComponent = type;
Expand All @@ -790,7 +790,10 @@ if (__DEV__) {

try {
// Lazy may contain any component type so we recursively resolve it.
return describeUnknownElementTypeFrameInDEV(init(payload));
return describeUnknownElementTypeFrameInDEV(
init(payload),
ownerFn
);
} catch (x) {}
}
}
Expand Down Expand Up @@ -1394,18 +1397,14 @@ if (__DEV__) {

if (
element &&
element._owner != null &&
element._owner &&
element._owner !== ReactCurrentOwner.current
) {
var ownerName = null;

if (typeof element._owner.tag === "number") {
ownerName = getComponentNameFromType(element._owner.type);
} else if (typeof element._owner.name === "string") {
ownerName = element._owner.name;
} // Give the component that originally created this child.

childOwner = " It was passed a child from " + ownerName + ".";
// Give the component that originally created this child.
childOwner =
" It was passed a child from " +
getComponentNameFromType(element._owner.type) +
".";
}

setCurrentlyValidatingElement(element);
Expand All @@ -1424,7 +1423,11 @@ if (__DEV__) {
function setCurrentlyValidatingElement(element) {
{
if (element) {
var stack = describeUnknownElementTypeFrameInDEV(element.type);
var owner = element._owner;
var stack = describeUnknownElementTypeFrameInDEV(
element.type,
owner ? owner.type : null
);
ReactDebugCurrentFrame.setExtraStackFrame(stack);
} else {
ReactDebugCurrentFrame.setExtraStackFrame(null);
Expand Down
35 changes: 19 additions & 16 deletions compiled/facebook-www/JSXDEVRuntime-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ if (__DEV__) {

var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name) {
function describeBuiltInComponentFrame(name, ownerFn) {
{
if (prefix === undefined) {
// Extract the VM specific prefix used by each line.
Expand Down Expand Up @@ -740,7 +740,7 @@ if (__DEV__) {

return syntheticFrame;
}
function describeFunctionComponentFrame(fn) {
function describeFunctionComponentFrame(fn, ownerFn) {
{
return describeNativeComponentFrame(fn, false);
}
Expand All @@ -751,7 +751,7 @@ if (__DEV__) {
return !!(prototype && prototype.isReactComponent);
}

function describeUnknownElementTypeFrameInDEV(type) {
function describeUnknownElementTypeFrameInDEV(type, ownerFn) {
if (type == null) {
return "";
}
Expand Down Expand Up @@ -781,7 +781,7 @@ if (__DEV__) {

case REACT_MEMO_TYPE:
// Memo may contain any component type so we recursively resolve it.
return describeUnknownElementTypeFrameInDEV(type.type);
return describeUnknownElementTypeFrameInDEV(type.type, ownerFn);

case REACT_LAZY_TYPE: {
var lazyComponent = type;
Expand All @@ -790,7 +790,10 @@ if (__DEV__) {

try {
// Lazy may contain any component type so we recursively resolve it.
return describeUnknownElementTypeFrameInDEV(init(payload));
return describeUnknownElementTypeFrameInDEV(
init(payload),
ownerFn
);
} catch (x) {}
}
}
Expand Down Expand Up @@ -1394,18 +1397,14 @@ if (__DEV__) {

if (
element &&
element._owner != null &&
element._owner &&
element._owner !== ReactCurrentOwner.current
) {
var ownerName = null;

if (typeof element._owner.tag === "number") {
ownerName = getComponentNameFromType(element._owner.type);
} else if (typeof element._owner.name === "string") {
ownerName = element._owner.name;
} // Give the component that originally created this child.

childOwner = " It was passed a child from " + ownerName + ".";
// Give the component that originally created this child.
childOwner =
" It was passed a child from " +
getComponentNameFromType(element._owner.type) +
".";
}

setCurrentlyValidatingElement(element);
Expand All @@ -1424,7 +1423,11 @@ if (__DEV__) {
function setCurrentlyValidatingElement(element) {
{
if (element) {
var stack = describeUnknownElementTypeFrameInDEV(element.type);
var owner = element._owner;
var stack = describeUnknownElementTypeFrameInDEV(
element.type,
owner ? owner.type : null
);
ReactDebugCurrentFrame.setExtraStackFrame(stack);
} else {
ReactDebugCurrentFrame.setExtraStackFrame(null);
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e0455fe62a648f541d2e029017465ae4b5f000a8
87b495f7d26a2c631c08952661d38bb5ce5acb03
37 changes: 20 additions & 17 deletions compiled/facebook-www/React-dev.classic.js
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 = "19.0.0-www-classic-8aa01ae9";
var ReactVersion = "19.0.0-www-classic-b9e0eea7";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -843,7 +843,7 @@ if (__DEV__) {

var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name) {
function describeBuiltInComponentFrame(name, ownerFn) {
{
if (prefix === undefined) {
// Extract the VM specific prefix used by each line.
Expand Down Expand Up @@ -1112,7 +1112,7 @@ if (__DEV__) {

return syntheticFrame;
}
function describeFunctionComponentFrame(fn) {
function describeFunctionComponentFrame(fn, ownerFn) {
{
return describeNativeComponentFrame(fn, false);
}
Expand All @@ -1123,7 +1123,7 @@ if (__DEV__) {
return !!(prototype && prototype.isReactComponent);
}

function describeUnknownElementTypeFrameInDEV(type) {
function describeUnknownElementTypeFrameInDEV(type, ownerFn) {
if (type == null) {
return "";
}
Expand Down Expand Up @@ -1153,7 +1153,7 @@ if (__DEV__) {

case REACT_MEMO_TYPE:
// Memo may contain any component type so we recursively resolve it.
return describeUnknownElementTypeFrameInDEV(type.type);
return describeUnknownElementTypeFrameInDEV(type.type, ownerFn);

case REACT_LAZY_TYPE: {
var lazyComponent = type;
Expand All @@ -1162,7 +1162,10 @@ if (__DEV__) {

try {
// Lazy may contain any component type so we recursively resolve it.
return describeUnknownElementTypeFrameInDEV(init(payload));
return describeUnknownElementTypeFrameInDEV(
init(payload),
ownerFn
);
} catch (x) {}
}
}
Expand Down Expand Up @@ -2094,18 +2097,14 @@ if (__DEV__) {

if (
element &&
element._owner != null &&
element._owner &&
element._owner !== ReactCurrentOwner.current
) {
var ownerName = null;

if (typeof element._owner.tag === "number") {
ownerName = getComponentNameFromType(element._owner.type);
} else if (typeof element._owner.name === "string") {
ownerName = element._owner.name;
} // Give the component that originally created this child.

childOwner = " It was passed a child from " + ownerName + ".";
// Give the component that originally created this child.
childOwner =
" It was passed a child from " +
getComponentNameFromType(element._owner.type) +
".";
}

setCurrentlyValidatingElement(element);
Expand All @@ -2124,7 +2123,11 @@ if (__DEV__) {
function setCurrentlyValidatingElement(element) {
{
if (element) {
var stack = describeUnknownElementTypeFrameInDEV(element.type);
var owner = element._owner;
var stack = describeUnknownElementTypeFrameInDEV(
element.type,
owner ? owner.type : null
);
ReactDebugCurrentFrame.setExtraStackFrame(stack);
} else {
ReactDebugCurrentFrame.setExtraStackFrame(null);
Expand Down
37 changes: 20 additions & 17 deletions compiled/facebook-www/React-dev.modern.js
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 = "19.0.0-www-modern-ab03ab4b";
var ReactVersion = "19.0.0-www-modern-3a8173ed";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -843,7 +843,7 @@ if (__DEV__) {

var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var prefix;
function describeBuiltInComponentFrame(name) {
function describeBuiltInComponentFrame(name, ownerFn) {
{
if (prefix === undefined) {
// Extract the VM specific prefix used by each line.
Expand Down Expand Up @@ -1112,7 +1112,7 @@ if (__DEV__) {

return syntheticFrame;
}
function describeFunctionComponentFrame(fn) {
function describeFunctionComponentFrame(fn, ownerFn) {
{
return describeNativeComponentFrame(fn, false);
}
Expand All @@ -1123,7 +1123,7 @@ if (__DEV__) {
return !!(prototype && prototype.isReactComponent);
}

function describeUnknownElementTypeFrameInDEV(type) {
function describeUnknownElementTypeFrameInDEV(type, ownerFn) {
if (type == null) {
return "";
}
Expand Down Expand Up @@ -1153,7 +1153,7 @@ if (__DEV__) {

case REACT_MEMO_TYPE:
// Memo may contain any component type so we recursively resolve it.
return describeUnknownElementTypeFrameInDEV(type.type);
return describeUnknownElementTypeFrameInDEV(type.type, ownerFn);

case REACT_LAZY_TYPE: {
var lazyComponent = type;
Expand All @@ -1162,7 +1162,10 @@ if (__DEV__) {

try {
// Lazy may contain any component type so we recursively resolve it.
return describeUnknownElementTypeFrameInDEV(init(payload));
return describeUnknownElementTypeFrameInDEV(
init(payload),
ownerFn
);
} catch (x) {}
}
}
Expand Down Expand Up @@ -2094,18 +2097,14 @@ if (__DEV__) {

if (
element &&
element._owner != null &&
element._owner &&
element._owner !== ReactCurrentOwner.current
) {
var ownerName = null;

if (typeof element._owner.tag === "number") {
ownerName = getComponentNameFromType(element._owner.type);
} else if (typeof element._owner.name === "string") {
ownerName = element._owner.name;
} // Give the component that originally created this child.

childOwner = " It was passed a child from " + ownerName + ".";
// Give the component that originally created this child.
childOwner =
" It was passed a child from " +
getComponentNameFromType(element._owner.type) +
".";
}

setCurrentlyValidatingElement(element);
Expand All @@ -2124,7 +2123,11 @@ if (__DEV__) {
function setCurrentlyValidatingElement(element) {
{
if (element) {
var stack = describeUnknownElementTypeFrameInDEV(element.type);
var owner = element._owner;
var stack = describeUnknownElementTypeFrameInDEV(
element.type,
owner ? owner.type : null
);
ReactDebugCurrentFrame.setExtraStackFrame(stack);
} else {
ReactDebugCurrentFrame.setExtraStackFrame(null);
Expand Down
Loading

0 comments on commit d9f3448

Please sign in to comment.