Skip to content

Commit 288b7b7

Browse files
committed
Log Fragment name when trying to render a lazy fragment (#30372)
DiffTrain build for [9cc0f6e](9cc0f6e)
1 parent a9dbaee commit 288b7b7

34 files changed

+1212
-1013
lines changed

compiled/facebook-www/REVISION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b7e7f1a3fab87e8fc19e86a8088a9e0fe4710973
1+
9cc0f6e68de2b83b11d1fb2b514d2f508c2da6f7
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b7e7f1a3fab87e8fc19e86a8088a9e0fe4710973
1+
9cc0f6e68de2b83b11d1fb2b514d2f508c2da6f7

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1993,7 +1993,7 @@ __DEV__ &&
19931993
exports.useTransition = function () {
19941994
return resolveDispatcher().useTransition();
19951995
};
1996-
exports.version = "19.0.0-www-classic-b7e7f1a3-20240722";
1996+
exports.version = "19.0.0-www-classic-9cc0f6e6-20240723";
19971997
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19981998
"function" ===
19991999
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1973,7 +1973,7 @@ __DEV__ &&
19731973
exports.useTransition = function () {
19741974
return resolveDispatcher().useTransition();
19751975
};
1976-
exports.version = "19.0.0-www-modern-b7e7f1a3-20240722";
1976+
exports.version = "19.0.0-www-modern-9cc0f6e6-20240723";
19771977
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19781978
"function" ===
19791979
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -662,4 +662,4 @@ exports.useSyncExternalStore = function (
662662
exports.useTransition = function () {
663663
return ReactSharedInternals.H.useTransition();
664664
};
665-
exports.version = "19.0.0-www-classic-b7e7f1a3-20240722";
665+
exports.version = "19.0.0-www-classic-9cc0f6e6-20240723";

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -662,4 +662,4 @@ exports.useSyncExternalStore = function (
662662
exports.useTransition = function () {
663663
return ReactSharedInternals.H.useTransition();
664664
};
665-
exports.version = "19.0.0-www-modern-b7e7f1a3-20240722";
665+
exports.version = "19.0.0-www-modern-9cc0f6e6-20240723";

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ exports.useSyncExternalStore = function (
666666
exports.useTransition = function () {
667667
return ReactSharedInternals.H.useTransition();
668668
};
669-
exports.version = "19.0.0-www-classic-b7e7f1a3-20240722";
669+
exports.version = "19.0.0-www-classic-9cc0f6e6-20240723";
670670
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
671671
"function" ===
672672
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ exports.useSyncExternalStore = function (
666666
exports.useTransition = function () {
667667
return ReactSharedInternals.H.useTransition();
668668
};
669-
exports.version = "19.0.0-www-modern-b7e7f1a3-20240722";
669+
exports.version = "19.0.0-www-modern-9cc0f6e6-20240723";
670670
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
671671
"function" ===
672672
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -8139,9 +8139,10 @@ __DEV__ &&
81398139
current.$$typeof === REACT_LAZY_TYPE &&
81408140
(workInProgress =
81418141
" Did you wrap a component in React.lazy() more than once?");
8142+
renderLanes = getComponentNameFromType(current) || current;
81428143
throw Error(
81438144
"Element type is invalid. Received a promise that resolves to: " +
8144-
current +
8145+
renderLanes +
81458146
". Lazy element type must resolve to a class or function." +
81468147
workInProgress
81478148
);
@@ -17034,14 +17035,14 @@ __DEV__ &&
1703417035
scheduleRoot: scheduleRoot,
1703517036
setRefreshHandler: setRefreshHandler,
1703617037
getCurrentFiber: getCurrentFiberForDevTools,
17037-
reconcilerVersion: "19.0.0-www-classic-b7e7f1a3-20240722"
17038+
reconcilerVersion: "19.0.0-www-classic-9cc0f6e6-20240723"
1703817039
});
1703917040
})({
1704017041
findFiberByHostInstance: function () {
1704117042
return null;
1704217043
},
1704317044
bundleType: 1,
17044-
version: "19.0.0-www-classic-b7e7f1a3-20240722",
17045+
version: "19.0.0-www-classic-9cc0f6e6-20240723",
1704517046
rendererPackageName: "react-art"
1704617047
});
1704717048
var ClippingRectangle = TYPES.CLIPPING_RECTANGLE,

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -7849,9 +7849,10 @@ __DEV__ &&
78497849
current.$$typeof === REACT_LAZY_TYPE &&
78507850
(workInProgress =
78517851
" Did you wrap a component in React.lazy() more than once?");
7852+
renderLanes = getComponentNameFromType(current) || current;
78527853
throw Error(
78537854
"Element type is invalid. Received a promise that resolves to: " +
7854-
current +
7855+
renderLanes +
78557856
". Lazy element type must resolve to a class or function." +
78567857
workInProgress
78577858
);
@@ -16444,14 +16445,14 @@ __DEV__ &&
1644416445
scheduleRoot: scheduleRoot,
1644516446
setRefreshHandler: setRefreshHandler,
1644616447
getCurrentFiber: getCurrentFiberForDevTools,
16447-
reconcilerVersion: "19.0.0-www-modern-b7e7f1a3-20240722"
16448+
reconcilerVersion: "19.0.0-www-modern-9cc0f6e6-20240723"
1644816449
});
1644916450
})({
1645016451
findFiberByHostInstance: function () {
1645116452
return null;
1645216453
},
1645316454
bundleType: 1,
16454-
version: "19.0.0-www-modern-b7e7f1a3-20240722",
16455+
version: "19.0.0-www-modern-9cc0f6e6-20240723",
1645516456
rendererPackageName: "react-art"
1645616457
});
1645716458
var ClippingRectangle = TYPES.CLIPPING_RECTANGLE,

compiled/facebook-www/ReactART-prod.classic.js

+17-16
Original file line numberDiff line numberDiff line change
@@ -5763,7 +5763,8 @@ function beginWork(current, workInProgress, renderLanes) {
57635763
);
57645764
break a;
57655765
}
5766-
throw Error(formatProdErrorMessage(306, current, ""));
5766+
workInProgress = getComponentNameFromType(current) || current;
5767+
throw Error(formatProdErrorMessage(306, workInProgress, ""));
57675768
}
57685769
}
57695770
return workInProgress;
@@ -10757,19 +10758,19 @@ var slice = Array.prototype.slice,
1075710758
};
1075810759
return Text;
1075910760
})(React.Component),
10760-
devToolsConfig$jscomp$inline_1174 = {
10761+
devToolsConfig$jscomp$inline_1175 = {
1076110762
findFiberByHostInstance: function () {
1076210763
return null;
1076310764
},
1076410765
bundleType: 0,
10765-
version: "19.0.0-www-classic-b7e7f1a3-20240722",
10766+
version: "19.0.0-www-classic-9cc0f6e6-20240723",
1076610767
rendererPackageName: "react-art"
1076710768
};
10768-
var internals$jscomp$inline_1386 = {
10769-
bundleType: devToolsConfig$jscomp$inline_1174.bundleType,
10770-
version: devToolsConfig$jscomp$inline_1174.version,
10771-
rendererPackageName: devToolsConfig$jscomp$inline_1174.rendererPackageName,
10772-
rendererConfig: devToolsConfig$jscomp$inline_1174.rendererConfig,
10769+
var internals$jscomp$inline_1387 = {
10770+
bundleType: devToolsConfig$jscomp$inline_1175.bundleType,
10771+
version: devToolsConfig$jscomp$inline_1175.version,
10772+
rendererPackageName: devToolsConfig$jscomp$inline_1175.rendererPackageName,
10773+
rendererConfig: devToolsConfig$jscomp$inline_1175.rendererConfig,
1077310774
overrideHookState: null,
1077410775
overrideHookStateDeletePath: null,
1077510776
overrideHookStateRenamePath: null,
@@ -10786,26 +10787,26 @@ var internals$jscomp$inline_1386 = {
1078610787
return null === fiber ? null : fiber.stateNode;
1078710788
},
1078810789
findFiberByHostInstance:
10789-
devToolsConfig$jscomp$inline_1174.findFiberByHostInstance ||
10790+
devToolsConfig$jscomp$inline_1175.findFiberByHostInstance ||
1079010791
emptyFindFiberByHostInstance,
1079110792
findHostInstancesForRefresh: null,
1079210793
scheduleRefresh: null,
1079310794
scheduleRoot: null,
1079410795
setRefreshHandler: null,
1079510796
getCurrentFiber: null,
10796-
reconcilerVersion: "19.0.0-www-classic-b7e7f1a3-20240722"
10797+
reconcilerVersion: "19.0.0-www-classic-9cc0f6e6-20240723"
1079710798
};
1079810799
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
10799-
var hook$jscomp$inline_1387 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
10800+
var hook$jscomp$inline_1388 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
1080010801
if (
10801-
!hook$jscomp$inline_1387.isDisabled &&
10802-
hook$jscomp$inline_1387.supportsFiber
10802+
!hook$jscomp$inline_1388.isDisabled &&
10803+
hook$jscomp$inline_1388.supportsFiber
1080310804
)
1080410805
try {
10805-
(rendererID = hook$jscomp$inline_1387.inject(
10806-
internals$jscomp$inline_1386
10806+
(rendererID = hook$jscomp$inline_1388.inject(
10807+
internals$jscomp$inline_1387
1080710808
)),
10808-
(injectedHook = hook$jscomp$inline_1387);
10809+
(injectedHook = hook$jscomp$inline_1388);
1080910810
} catch (err) {}
1081010811
}
1081110812
var Path = Mode$1.Path;

compiled/facebook-www/ReactART-prod.modern.js

+77-17
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,66 @@ function getIteratorFn(maybeIterable) {
115115
maybeIterable["@@iterator"];
116116
return "function" === typeof maybeIterable ? maybeIterable : null;
117117
}
118-
Symbol.for("react.client.reference");
118+
var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
119+
function getComponentNameFromType(type) {
120+
if (null == type) return null;
121+
if ("function" === typeof type)
122+
return type.$$typeof === REACT_CLIENT_REFERENCE
123+
? null
124+
: type.displayName || type.name || null;
125+
if ("string" === typeof type) return type;
126+
switch (type) {
127+
case REACT_FRAGMENT_TYPE:
128+
return "Fragment";
129+
case REACT_PORTAL_TYPE:
130+
return "Portal";
131+
case REACT_PROFILER_TYPE:
132+
return "Profiler";
133+
case REACT_STRICT_MODE_TYPE:
134+
return "StrictMode";
135+
case REACT_SUSPENSE_TYPE:
136+
return "Suspense";
137+
case REACT_SUSPENSE_LIST_TYPE:
138+
return "SuspenseList";
139+
case REACT_TRACING_MARKER_TYPE:
140+
if (enableTransitionTracing) return "TracingMarker";
141+
}
142+
if ("object" === typeof type)
143+
switch (type.$$typeof) {
144+
case REACT_PROVIDER_TYPE:
145+
if (enableRenderableContext) break;
146+
else return (type._context.displayName || "Context") + ".Provider";
147+
case REACT_CONTEXT_TYPE:
148+
return enableRenderableContext
149+
? (type.displayName || "Context") + ".Provider"
150+
: (type.displayName || "Context") + ".Consumer";
151+
case REACT_CONSUMER_TYPE:
152+
if (enableRenderableContext)
153+
return (type._context.displayName || "Context") + ".Consumer";
154+
break;
155+
case REACT_FORWARD_REF_TYPE:
156+
var innerType = type.render;
157+
type = type.displayName;
158+
type ||
159+
((type = innerType.displayName || innerType.name || ""),
160+
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
161+
return type;
162+
case REACT_MEMO_TYPE:
163+
return (
164+
(innerType = type.displayName || null),
165+
null !== innerType
166+
? innerType
167+
: getComponentNameFromType(type.type) || "Memo"
168+
);
169+
case REACT_LAZY_TYPE:
170+
innerType = type._payload;
171+
type = type._init;
172+
try {
173+
return getComponentNameFromType(type(innerType));
174+
} catch (x) {}
175+
}
176+
return null;
177+
}
119178
var ReactSharedInternals =
120179
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
121180
prefix,
@@ -5397,7 +5456,8 @@ function beginWork(current, workInProgress, renderLanes) {
53975456
);
53985457
break a;
53995458
}
5400-
throw Error(formatProdErrorMessage(306, current, ""));
5459+
workInProgress = getComponentNameFromType(current) || current;
5460+
throw Error(formatProdErrorMessage(306, workInProgress, ""));
54015461
}
54025462
}
54035463
return workInProgress;
@@ -10201,19 +10261,19 @@ var slice = Array.prototype.slice,
1020110261
};
1020210262
return Text;
1020310263
})(React.Component),
10204-
devToolsConfig$jscomp$inline_1138 = {
10264+
devToolsConfig$jscomp$inline_1139 = {
1020510265
findFiberByHostInstance: function () {
1020610266
return null;
1020710267
},
1020810268
bundleType: 0,
10209-
version: "19.0.0-www-modern-b7e7f1a3-20240722",
10269+
version: "19.0.0-www-modern-9cc0f6e6-20240723",
1021010270
rendererPackageName: "react-art"
1021110271
};
10212-
var internals$jscomp$inline_1372 = {
10213-
bundleType: devToolsConfig$jscomp$inline_1138.bundleType,
10214-
version: devToolsConfig$jscomp$inline_1138.version,
10215-
rendererPackageName: devToolsConfig$jscomp$inline_1138.rendererPackageName,
10216-
rendererConfig: devToolsConfig$jscomp$inline_1138.rendererConfig,
10272+
var internals$jscomp$inline_1373 = {
10273+
bundleType: devToolsConfig$jscomp$inline_1139.bundleType,
10274+
version: devToolsConfig$jscomp$inline_1139.version,
10275+
rendererPackageName: devToolsConfig$jscomp$inline_1139.rendererPackageName,
10276+
rendererConfig: devToolsConfig$jscomp$inline_1139.rendererConfig,
1021710277
overrideHookState: null,
1021810278
overrideHookStateDeletePath: null,
1021910279
overrideHookStateRenamePath: null,
@@ -10230,26 +10290,26 @@ var internals$jscomp$inline_1372 = {
1023010290
return null === fiber ? null : fiber.stateNode;
1023110291
},
1023210292
findFiberByHostInstance:
10233-
devToolsConfig$jscomp$inline_1138.findFiberByHostInstance ||
10293+
devToolsConfig$jscomp$inline_1139.findFiberByHostInstance ||
1023410294
emptyFindFiberByHostInstance,
1023510295
findHostInstancesForRefresh: null,
1023610296
scheduleRefresh: null,
1023710297
scheduleRoot: null,
1023810298
setRefreshHandler: null,
1023910299
getCurrentFiber: null,
10240-
reconcilerVersion: "19.0.0-www-modern-b7e7f1a3-20240722"
10300+
reconcilerVersion: "19.0.0-www-modern-9cc0f6e6-20240723"
1024110301
};
1024210302
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
10243-
var hook$jscomp$inline_1373 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
10303+
var hook$jscomp$inline_1374 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
1024410304
if (
10245-
!hook$jscomp$inline_1373.isDisabled &&
10246-
hook$jscomp$inline_1373.supportsFiber
10305+
!hook$jscomp$inline_1374.isDisabled &&
10306+
hook$jscomp$inline_1374.supportsFiber
1024710307
)
1024810308
try {
10249-
(rendererID = hook$jscomp$inline_1373.inject(
10250-
internals$jscomp$inline_1372
10309+
(rendererID = hook$jscomp$inline_1374.inject(
10310+
internals$jscomp$inline_1373
1025110311
)),
10252-
(injectedHook = hook$jscomp$inline_1373);
10312+
(injectedHook = hook$jscomp$inline_1374);
1025310313
} catch (err) {}
1025410314
}
1025510315
var Path = Mode$1.Path;

0 commit comments

Comments
 (0)