Skip to content

Commit ef702ab

Browse files
committed
Performance Tracks: log properties diff for renders in DEV if no console task available (#34370)
React Native doesn't support `console.createTask` yet, but it does support `performance.measure` and extensibility APIs for Performance panel, including `detail.devtools` field. Previously, this logic was gated with `if (__DEV__ && debugTask)`, now `debugTask` is no longer required to log render. If there is no console task, we will just call `performance.measure(...)`. The same pattern is used in other reporters. DiffTrain build for [2805f0e](2805f0e)
1 parent 134a502 commit ef702ab

34 files changed

+502
-494
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bb6f0c8d2f29754347db0ff28186dc89c128b6ca
1+
2805f0ed9e702454527839c0076a9979553c2fd7
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bb6f0c8d2f29754347db0ff28186dc89c128b6ca
1+
2805f0ed9e702454527839c0076a9979553c2fd7

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ __DEV__ &&
14181418
exports.useTransition = function () {
14191419
return resolveDispatcher().useTransition();
14201420
};
1421-
exports.version = "19.2.0-www-classic-bb6f0c8d-20250901";
1421+
exports.version = "19.2.0-www-classic-2805f0ed-20250903";
14221422
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
14231423
"function" ===
14241424
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ __DEV__ &&
14181418
exports.useTransition = function () {
14191419
return resolveDispatcher().useTransition();
14201420
};
1421-
exports.version = "19.2.0-www-modern-bb6f0c8d-20250901";
1421+
exports.version = "19.2.0-www-modern-2805f0ed-20250903";
14221422
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
14231423
"function" ===
14241424
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,4 +600,4 @@ exports.useSyncExternalStore = function (
600600
exports.useTransition = function () {
601601
return ReactSharedInternals.H.useTransition();
602602
};
603-
exports.version = "19.2.0-www-classic-bb6f0c8d-20250901";
603+
exports.version = "19.2.0-www-classic-2805f0ed-20250903";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,4 +600,4 @@ exports.useSyncExternalStore = function (
600600
exports.useTransition = function () {
601601
return ReactSharedInternals.H.useTransition();
602602
};
603-
exports.version = "19.2.0-www-modern-bb6f0c8d-20250901";
603+
exports.version = "19.2.0-www-modern-2805f0ed-20250903";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ exports.useSyncExternalStore = function (
604604
exports.useTransition = function () {
605605
return ReactSharedInternals.H.useTransition();
606606
};
607-
exports.version = "19.2.0-www-classic-bb6f0c8d-20250901";
607+
exports.version = "19.2.0-www-classic-2805f0ed-20250903";
608608
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
609609
"function" ===
610610
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ exports.useSyncExternalStore = function (
604604
exports.useTransition = function () {
605605
return ReactSharedInternals.H.useTransition();
606606
};
607-
exports.version = "19.2.0-www-modern-bb6f0c8d-20250901";
607+
exports.version = "19.2.0-www-modern-2805f0ed-20250903";
608608
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
609609
"function" ===
610610
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 55 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,64 +1479,65 @@ __DEV__ &&
14791479
? "tertiary-dark"
14801480
: "primary-dark"
14811481
: "error";
1482-
if ((selfTime = fiber._debugTask)) {
1483-
var props = fiber.memoizedProps;
1484-
if (
1485-
null !== props &&
1486-
null !== alternate &&
1487-
alternate.memoizedProps !== props &&
1488-
((child = [resuableChangedPropsEntry]),
1482+
var props = fiber.memoizedProps;
1483+
selfTime = fiber._debugTask;
1484+
null !== props &&
1485+
null !== alternate &&
1486+
alternate.memoizedProps !== props
1487+
? ((child = [resuableChangedPropsEntry]),
14891488
(props = addObjectDiffToProperties(
14901489
alternate.memoizedProps,
14911490
props,
14921491
child,
14931492
0
14941493
)),
1495-
1 < child.length)
1496-
) {
1497-
props &&
1498-
!alreadyWarnedForDeepEquality &&
1499-
0 === (alternate.lanes & committedLanes) &&
1500-
100 < fiber.actualDuration
1501-
? ((alreadyWarnedForDeepEquality = !0),
1502-
(child[0] = reusableDeeplyEqualPropsEntry),
1503-
(reusableComponentDevToolDetails.color = "warning"),
1504-
(reusableComponentDevToolDetails.tooltipText =
1505-
"This component received deeply equal props. It might benefit from useMemo or the React Compiler in its owner."))
1506-
: ((reusableComponentDevToolDetails.color = wasHydrated),
1507-
(reusableComponentDevToolDetails.tooltipText = name));
1508-
reusableComponentDevToolDetails.properties = child;
1509-
reusableComponentOptions.start = startTime;
1510-
reusableComponentOptions.end = endTime;
1511-
selfTime.run(
1512-
performance.measure.bind(
1513-
performance,
1514-
"\u200b" + name,
1515-
reusableComponentOptions
1494+
1 < child.length &&
1495+
(props &&
1496+
!alreadyWarnedForDeepEquality &&
1497+
0 === (alternate.lanes & committedLanes) &&
1498+
100 < fiber.actualDuration
1499+
? ((alreadyWarnedForDeepEquality = !0),
1500+
(child[0] = reusableDeeplyEqualPropsEntry),
1501+
(reusableComponentDevToolDetails.color = "warning"),
1502+
(reusableComponentDevToolDetails.tooltipText =
1503+
"This component received deeply equal props. It might benefit from useMemo or the React Compiler in its owner."))
1504+
: ((reusableComponentDevToolDetails.color = wasHydrated),
1505+
(reusableComponentDevToolDetails.tooltipText = name)),
1506+
(reusableComponentDevToolDetails.properties = child),
1507+
(reusableComponentOptions.start = startTime),
1508+
(reusableComponentOptions.end = endTime),
1509+
null != selfTime
1510+
? selfTime.run(
1511+
performance.measure.bind(
1512+
performance,
1513+
"\u200b" + name,
1514+
reusableComponentOptions
1515+
)
1516+
)
1517+
: performance.measure(
1518+
"\u200b" + name,
1519+
reusableComponentOptions
1520+
)))
1521+
: null != selfTime
1522+
? selfTime.run(
1523+
console.timeStamp.bind(
1524+
console,
1525+
name,
1526+
startTime,
1527+
endTime,
1528+
"Components \u269b",
1529+
void 0,
1530+
wasHydrated
1531+
)
15161532
)
1517-
);
1518-
return;
1519-
}
1520-
selfTime.run(
1521-
console.timeStamp.bind(
1522-
console,
1523-
name,
1524-
startTime,
1525-
endTime,
1526-
"Components \u269b",
1527-
void 0,
1528-
wasHydrated
1529-
)
1530-
);
1531-
} else
1532-
console.timeStamp(
1533-
name,
1534-
startTime,
1535-
endTime,
1536-
"Components \u269b",
1537-
void 0,
1538-
wasHydrated
1539-
);
1533+
: console.timeStamp(
1534+
name,
1535+
startTime,
1536+
endTime,
1537+
"Components \u269b",
1538+
void 0,
1539+
wasHydrated
1540+
);
15401541
}
15411542
}
15421543
function logComponentErrored(fiber, startTime, endTime, errors) {
@@ -19588,10 +19589,10 @@ __DEV__ &&
1958819589
(function () {
1958919590
var internals = {
1959019591
bundleType: 1,
19591-
version: "19.2.0-www-classic-bb6f0c8d-20250901",
19592+
version: "19.2.0-www-classic-2805f0ed-20250903",
1959219593
rendererPackageName: "react-art",
1959319594
currentDispatcherRef: ReactSharedInternals,
19594-
reconcilerVersion: "19.2.0-www-classic-bb6f0c8d-20250901"
19595+
reconcilerVersion: "19.2.0-www-classic-2805f0ed-20250903"
1959519596
};
1959619597
internals.overrideHookState = overrideHookState;
1959719598
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -19625,7 +19626,7 @@ __DEV__ &&
1962519626
exports.Shape = Shape;
1962619627
exports.Surface = Surface;
1962719628
exports.Text = Text;
19628-
exports.version = "19.2.0-www-classic-bb6f0c8d-20250901";
19629+
exports.version = "19.2.0-www-classic-2805f0ed-20250903";
1962919630
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1963019631
"function" ===
1963119632
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 55 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,64 +1385,65 @@ __DEV__ &&
13851385
? "tertiary-dark"
13861386
: "primary-dark"
13871387
: "error";
1388-
if ((selfTime = fiber._debugTask)) {
1389-
var props = fiber.memoizedProps;
1390-
if (
1391-
null !== props &&
1392-
null !== alternate &&
1393-
alternate.memoizedProps !== props &&
1394-
((child = [resuableChangedPropsEntry]),
1388+
var props = fiber.memoizedProps;
1389+
selfTime = fiber._debugTask;
1390+
null !== props &&
1391+
null !== alternate &&
1392+
alternate.memoizedProps !== props
1393+
? ((child = [resuableChangedPropsEntry]),
13951394
(props = addObjectDiffToProperties(
13961395
alternate.memoizedProps,
13971396
props,
13981397
child,
13991398
0
14001399
)),
1401-
1 < child.length)
1402-
) {
1403-
props &&
1404-
!alreadyWarnedForDeepEquality &&
1405-
0 === (alternate.lanes & committedLanes) &&
1406-
100 < fiber.actualDuration
1407-
? ((alreadyWarnedForDeepEquality = !0),
1408-
(child[0] = reusableDeeplyEqualPropsEntry),
1409-
(reusableComponentDevToolDetails.color = "warning"),
1410-
(reusableComponentDevToolDetails.tooltipText =
1411-
"This component received deeply equal props. It might benefit from useMemo or the React Compiler in its owner."))
1412-
: ((reusableComponentDevToolDetails.color = wasHydrated),
1413-
(reusableComponentDevToolDetails.tooltipText = name));
1414-
reusableComponentDevToolDetails.properties = child;
1415-
reusableComponentOptions.start = startTime;
1416-
reusableComponentOptions.end = endTime;
1417-
selfTime.run(
1418-
performance.measure.bind(
1419-
performance,
1420-
"\u200b" + name,
1421-
reusableComponentOptions
1400+
1 < child.length &&
1401+
(props &&
1402+
!alreadyWarnedForDeepEquality &&
1403+
0 === (alternate.lanes & committedLanes) &&
1404+
100 < fiber.actualDuration
1405+
? ((alreadyWarnedForDeepEquality = !0),
1406+
(child[0] = reusableDeeplyEqualPropsEntry),
1407+
(reusableComponentDevToolDetails.color = "warning"),
1408+
(reusableComponentDevToolDetails.tooltipText =
1409+
"This component received deeply equal props. It might benefit from useMemo or the React Compiler in its owner."))
1410+
: ((reusableComponentDevToolDetails.color = wasHydrated),
1411+
(reusableComponentDevToolDetails.tooltipText = name)),
1412+
(reusableComponentDevToolDetails.properties = child),
1413+
(reusableComponentOptions.start = startTime),
1414+
(reusableComponentOptions.end = endTime),
1415+
null != selfTime
1416+
? selfTime.run(
1417+
performance.measure.bind(
1418+
performance,
1419+
"\u200b" + name,
1420+
reusableComponentOptions
1421+
)
1422+
)
1423+
: performance.measure(
1424+
"\u200b" + name,
1425+
reusableComponentOptions
1426+
)))
1427+
: null != selfTime
1428+
? selfTime.run(
1429+
console.timeStamp.bind(
1430+
console,
1431+
name,
1432+
startTime,
1433+
endTime,
1434+
"Components \u269b",
1435+
void 0,
1436+
wasHydrated
1437+
)
14221438
)
1423-
);
1424-
return;
1425-
}
1426-
selfTime.run(
1427-
console.timeStamp.bind(
1428-
console,
1429-
name,
1430-
startTime,
1431-
endTime,
1432-
"Components \u269b",
1433-
void 0,
1434-
wasHydrated
1435-
)
1436-
);
1437-
} else
1438-
console.timeStamp(
1439-
name,
1440-
startTime,
1441-
endTime,
1442-
"Components \u269b",
1443-
void 0,
1444-
wasHydrated
1445-
);
1439+
: console.timeStamp(
1440+
name,
1441+
startTime,
1442+
endTime,
1443+
"Components \u269b",
1444+
void 0,
1445+
wasHydrated
1446+
);
14461447
}
14471448
}
14481449
function logComponentErrored(fiber, startTime, endTime, errors) {
@@ -19359,10 +19360,10 @@ __DEV__ &&
1935919360
(function () {
1936019361
var internals = {
1936119362
bundleType: 1,
19362-
version: "19.2.0-www-modern-bb6f0c8d-20250901",
19363+
version: "19.2.0-www-modern-2805f0ed-20250903",
1936319364
rendererPackageName: "react-art",
1936419365
currentDispatcherRef: ReactSharedInternals,
19365-
reconcilerVersion: "19.2.0-www-modern-bb6f0c8d-20250901"
19366+
reconcilerVersion: "19.2.0-www-modern-2805f0ed-20250903"
1936619367
};
1936719368
internals.overrideHookState = overrideHookState;
1936819369
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -19396,7 +19397,7 @@ __DEV__ &&
1939619397
exports.Shape = Shape;
1939719398
exports.Surface = Surface;
1939819399
exports.Text = Text;
19399-
exports.version = "19.2.0-www-modern-bb6f0c8d-20250901";
19400+
exports.version = "19.2.0-www-modern-2805f0ed-20250903";
1940019401
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1940119402
"function" ===
1940219403
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)