Skip to content

Commit d9f3448

Browse files
committed
Revert "Track Owner for Server Components in DEV (#28753)"
This reverts commit e0455fe. DiffTrain build for [87b495f](87b495f)
1 parent 2b619ee commit d9f3448

30 files changed

+475
-640
lines changed

compiled/facebook-www/JSXDEVRuntime-dev.classic.js

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ if (__DEV__) {
471471

472472
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
473473
var prefix;
474-
function describeBuiltInComponentFrame(name) {
474+
function describeBuiltInComponentFrame(name, ownerFn) {
475475
{
476476
if (prefix === undefined) {
477477
// Extract the VM specific prefix used by each line.
@@ -740,7 +740,7 @@ if (__DEV__) {
740740

741741
return syntheticFrame;
742742
}
743-
function describeFunctionComponentFrame(fn) {
743+
function describeFunctionComponentFrame(fn, ownerFn) {
744744
{
745745
return describeNativeComponentFrame(fn, false);
746746
}
@@ -751,7 +751,7 @@ if (__DEV__) {
751751
return !!(prototype && prototype.isReactComponent);
752752
}
753753

754-
function describeUnknownElementTypeFrameInDEV(type) {
754+
function describeUnknownElementTypeFrameInDEV(type, ownerFn) {
755755
if (type == null) {
756756
return "";
757757
}
@@ -781,7 +781,7 @@ if (__DEV__) {
781781

782782
case REACT_MEMO_TYPE:
783783
// Memo may contain any component type so we recursively resolve it.
784-
return describeUnknownElementTypeFrameInDEV(type.type);
784+
return describeUnknownElementTypeFrameInDEV(type.type, ownerFn);
785785

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

791791
try {
792792
// Lazy may contain any component type so we recursively resolve it.
793-
return describeUnknownElementTypeFrameInDEV(init(payload));
793+
return describeUnknownElementTypeFrameInDEV(
794+
init(payload),
795+
ownerFn
796+
);
794797
} catch (x) {}
795798
}
796799
}
@@ -1394,18 +1397,14 @@ if (__DEV__) {
13941397

13951398
if (
13961399
element &&
1397-
element._owner != null &&
1400+
element._owner &&
13981401
element._owner !== ReactCurrentOwner.current
13991402
) {
1400-
var ownerName = null;
1401-
1402-
if (typeof element._owner.tag === "number") {
1403-
ownerName = getComponentNameFromType(element._owner.type);
1404-
} else if (typeof element._owner.name === "string") {
1405-
ownerName = element._owner.name;
1406-
} // Give the component that originally created this child.
1407-
1408-
childOwner = " It was passed a child from " + ownerName + ".";
1403+
// Give the component that originally created this child.
1404+
childOwner =
1405+
" It was passed a child from " +
1406+
getComponentNameFromType(element._owner.type) +
1407+
".";
14091408
}
14101409

14111410
setCurrentlyValidatingElement(element);
@@ -1424,7 +1423,11 @@ if (__DEV__) {
14241423
function setCurrentlyValidatingElement(element) {
14251424
{
14261425
if (element) {
1427-
var stack = describeUnknownElementTypeFrameInDEV(element.type);
1426+
var owner = element._owner;
1427+
var stack = describeUnknownElementTypeFrameInDEV(
1428+
element.type,
1429+
owner ? owner.type : null
1430+
);
14281431
ReactDebugCurrentFrame.setExtraStackFrame(stack);
14291432
} else {
14301433
ReactDebugCurrentFrame.setExtraStackFrame(null);

compiled/facebook-www/JSXDEVRuntime-dev.modern.js

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ if (__DEV__) {
471471

472472
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
473473
var prefix;
474-
function describeBuiltInComponentFrame(name) {
474+
function describeBuiltInComponentFrame(name, ownerFn) {
475475
{
476476
if (prefix === undefined) {
477477
// Extract the VM specific prefix used by each line.
@@ -740,7 +740,7 @@ if (__DEV__) {
740740

741741
return syntheticFrame;
742742
}
743-
function describeFunctionComponentFrame(fn) {
743+
function describeFunctionComponentFrame(fn, ownerFn) {
744744
{
745745
return describeNativeComponentFrame(fn, false);
746746
}
@@ -751,7 +751,7 @@ if (__DEV__) {
751751
return !!(prototype && prototype.isReactComponent);
752752
}
753753

754-
function describeUnknownElementTypeFrameInDEV(type) {
754+
function describeUnknownElementTypeFrameInDEV(type, ownerFn) {
755755
if (type == null) {
756756
return "";
757757
}
@@ -781,7 +781,7 @@ if (__DEV__) {
781781

782782
case REACT_MEMO_TYPE:
783783
// Memo may contain any component type so we recursively resolve it.
784-
return describeUnknownElementTypeFrameInDEV(type.type);
784+
return describeUnknownElementTypeFrameInDEV(type.type, ownerFn);
785785

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

791791
try {
792792
// Lazy may contain any component type so we recursively resolve it.
793-
return describeUnknownElementTypeFrameInDEV(init(payload));
793+
return describeUnknownElementTypeFrameInDEV(
794+
init(payload),
795+
ownerFn
796+
);
794797
} catch (x) {}
795798
}
796799
}
@@ -1394,18 +1397,14 @@ if (__DEV__) {
13941397

13951398
if (
13961399
element &&
1397-
element._owner != null &&
1400+
element._owner &&
13981401
element._owner !== ReactCurrentOwner.current
13991402
) {
1400-
var ownerName = null;
1401-
1402-
if (typeof element._owner.tag === "number") {
1403-
ownerName = getComponentNameFromType(element._owner.type);
1404-
} else if (typeof element._owner.name === "string") {
1405-
ownerName = element._owner.name;
1406-
} // Give the component that originally created this child.
1407-
1408-
childOwner = " It was passed a child from " + ownerName + ".";
1403+
// Give the component that originally created this child.
1404+
childOwner =
1405+
" It was passed a child from " +
1406+
getComponentNameFromType(element._owner.type) +
1407+
".";
14091408
}
14101409

14111410
setCurrentlyValidatingElement(element);
@@ -1424,7 +1423,11 @@ if (__DEV__) {
14241423
function setCurrentlyValidatingElement(element) {
14251424
{
14261425
if (element) {
1427-
var stack = describeUnknownElementTypeFrameInDEV(element.type);
1426+
var owner = element._owner;
1427+
var stack = describeUnknownElementTypeFrameInDEV(
1428+
element.type,
1429+
owner ? owner.type : null
1430+
);
14281431
ReactDebugCurrentFrame.setExtraStackFrame(stack);
14291432
} else {
14301433
ReactDebugCurrentFrame.setExtraStackFrame(null);

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e0455fe62a648f541d2e029017465ae4b5f000a8
1+
87b495f7d26a2c631c08952661d38bb5ce5acb03

compiled/facebook-www/React-dev.classic.js

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "19.0.0-www-classic-8aa01ae9";
27+
var ReactVersion = "19.0.0-www-classic-b9e0eea7";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,
@@ -843,7 +843,7 @@ if (__DEV__) {
843843

844844
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
845845
var prefix;
846-
function describeBuiltInComponentFrame(name) {
846+
function describeBuiltInComponentFrame(name, ownerFn) {
847847
{
848848
if (prefix === undefined) {
849849
// Extract the VM specific prefix used by each line.
@@ -1112,7 +1112,7 @@ if (__DEV__) {
11121112

11131113
return syntheticFrame;
11141114
}
1115-
function describeFunctionComponentFrame(fn) {
1115+
function describeFunctionComponentFrame(fn, ownerFn) {
11161116
{
11171117
return describeNativeComponentFrame(fn, false);
11181118
}
@@ -1123,7 +1123,7 @@ if (__DEV__) {
11231123
return !!(prototype && prototype.isReactComponent);
11241124
}
11251125

1126-
function describeUnknownElementTypeFrameInDEV(type) {
1126+
function describeUnknownElementTypeFrameInDEV(type, ownerFn) {
11271127
if (type == null) {
11281128
return "";
11291129
}
@@ -1153,7 +1153,7 @@ if (__DEV__) {
11531153

11541154
case REACT_MEMO_TYPE:
11551155
// Memo may contain any component type so we recursively resolve it.
1156-
return describeUnknownElementTypeFrameInDEV(type.type);
1156+
return describeUnknownElementTypeFrameInDEV(type.type, ownerFn);
11571157

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

11631163
try {
11641164
// Lazy may contain any component type so we recursively resolve it.
1165-
return describeUnknownElementTypeFrameInDEV(init(payload));
1165+
return describeUnknownElementTypeFrameInDEV(
1166+
init(payload),
1167+
ownerFn
1168+
);
11661169
} catch (x) {}
11671170
}
11681171
}
@@ -2094,18 +2097,14 @@ if (__DEV__) {
20942097

20952098
if (
20962099
element &&
2097-
element._owner != null &&
2100+
element._owner &&
20982101
element._owner !== ReactCurrentOwner.current
20992102
) {
2100-
var ownerName = null;
2101-
2102-
if (typeof element._owner.tag === "number") {
2103-
ownerName = getComponentNameFromType(element._owner.type);
2104-
} else if (typeof element._owner.name === "string") {
2105-
ownerName = element._owner.name;
2106-
} // Give the component that originally created this child.
2107-
2108-
childOwner = " It was passed a child from " + ownerName + ".";
2103+
// Give the component that originally created this child.
2104+
childOwner =
2105+
" It was passed a child from " +
2106+
getComponentNameFromType(element._owner.type) +
2107+
".";
21092108
}
21102109

21112110
setCurrentlyValidatingElement(element);
@@ -2124,7 +2123,11 @@ if (__DEV__) {
21242123
function setCurrentlyValidatingElement(element) {
21252124
{
21262125
if (element) {
2127-
var stack = describeUnknownElementTypeFrameInDEV(element.type);
2126+
var owner = element._owner;
2127+
var stack = describeUnknownElementTypeFrameInDEV(
2128+
element.type,
2129+
owner ? owner.type : null
2130+
);
21282131
ReactDebugCurrentFrame.setExtraStackFrame(stack);
21292132
} else {
21302133
ReactDebugCurrentFrame.setExtraStackFrame(null);

compiled/facebook-www/React-dev.modern.js

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "19.0.0-www-modern-ab03ab4b";
27+
var ReactVersion = "19.0.0-www-modern-3a8173ed";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,
@@ -843,7 +843,7 @@ if (__DEV__) {
843843

844844
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
845845
var prefix;
846-
function describeBuiltInComponentFrame(name) {
846+
function describeBuiltInComponentFrame(name, ownerFn) {
847847
{
848848
if (prefix === undefined) {
849849
// Extract the VM specific prefix used by each line.
@@ -1112,7 +1112,7 @@ if (__DEV__) {
11121112

11131113
return syntheticFrame;
11141114
}
1115-
function describeFunctionComponentFrame(fn) {
1115+
function describeFunctionComponentFrame(fn, ownerFn) {
11161116
{
11171117
return describeNativeComponentFrame(fn, false);
11181118
}
@@ -1123,7 +1123,7 @@ if (__DEV__) {
11231123
return !!(prototype && prototype.isReactComponent);
11241124
}
11251125

1126-
function describeUnknownElementTypeFrameInDEV(type) {
1126+
function describeUnknownElementTypeFrameInDEV(type, ownerFn) {
11271127
if (type == null) {
11281128
return "";
11291129
}
@@ -1153,7 +1153,7 @@ if (__DEV__) {
11531153

11541154
case REACT_MEMO_TYPE:
11551155
// Memo may contain any component type so we recursively resolve it.
1156-
return describeUnknownElementTypeFrameInDEV(type.type);
1156+
return describeUnknownElementTypeFrameInDEV(type.type, ownerFn);
11571157

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

11631163
try {
11641164
// Lazy may contain any component type so we recursively resolve it.
1165-
return describeUnknownElementTypeFrameInDEV(init(payload));
1165+
return describeUnknownElementTypeFrameInDEV(
1166+
init(payload),
1167+
ownerFn
1168+
);
11661169
} catch (x) {}
11671170
}
11681171
}
@@ -2094,18 +2097,14 @@ if (__DEV__) {
20942097

20952098
if (
20962099
element &&
2097-
element._owner != null &&
2100+
element._owner &&
20982101
element._owner !== ReactCurrentOwner.current
20992102
) {
2100-
var ownerName = null;
2101-
2102-
if (typeof element._owner.tag === "number") {
2103-
ownerName = getComponentNameFromType(element._owner.type);
2104-
} else if (typeof element._owner.name === "string") {
2105-
ownerName = element._owner.name;
2106-
} // Give the component that originally created this child.
2107-
2108-
childOwner = " It was passed a child from " + ownerName + ".";
2103+
// Give the component that originally created this child.
2104+
childOwner =
2105+
" It was passed a child from " +
2106+
getComponentNameFromType(element._owner.type) +
2107+
".";
21092108
}
21102109

21112110
setCurrentlyValidatingElement(element);
@@ -2124,7 +2123,11 @@ if (__DEV__) {
21242123
function setCurrentlyValidatingElement(element) {
21252124
{
21262125
if (element) {
2127-
var stack = describeUnknownElementTypeFrameInDEV(element.type);
2126+
var owner = element._owner;
2127+
var stack = describeUnknownElementTypeFrameInDEV(
2128+
element.type,
2129+
owner ? owner.type : null
2130+
);
21282131
ReactDebugCurrentFrame.setExtraStackFrame(stack);
21292132
} else {
21302133
ReactDebugCurrentFrame.setExtraStackFrame(null);

0 commit comments

Comments
 (0)