Skip to content

Commit cc06404

Browse files
committed
Log Performance Track Entries for View Transitions (facebook#34510)
Stacked on facebook#34509. View Transitions introduces a bunch of new types of gaps in the commit phase which needs to be logged differently in the performance track. One thing that can happen is that a `flushSync` update forces the View Transition to abort before it has started if it happens in the gap before the transition is ready. In that case we log "Interrupted View Transition". Otherwise, when we're done in `startViewTransition` there's some work to finalize the animations before the `ready` calllback. This is logged as "Starting Animation". Then there's a gap before the passive effects fire which we log as "Animating". This can be long unless they're forced to flush early e.g. due to another lane updating. The "Animating" track should then pick up which doesn't do yet. This one is tricky because this is after the actual commit phase and needs to be interrupted by new renders which themselves can be suspended on the animation finshing. This PR is just a subset of all the cases. Will need a lot more work. <img width="679" height="161" alt="Screenshot 2025-09-16 at 10 19 06 PM" src="https://github.com/user-attachments/assets/0407372d-aaed-41f5-a262-059b2686ae87" /> DiffTrain build for [84af908](facebook@84af908)
1 parent 38c06f7 commit cc06404

35 files changed

+3251
-2299
lines changed

compiled/eslint-plugin-react-hooks/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32155,6 +32155,7 @@ const EnvironmentConfigSchema = zod.z.object({
3215532155
enableCustomTypeDefinitionForReanimated: zod.z.boolean().default(false),
3215632156
hookPattern: zod.z.string().nullable().default(null),
3215732157
enableTreatRefLikeIdentifiersAsRefs: zod.z.boolean().default(true),
32158+
enableTreatSetIdentifiersAsStateSetters: zod.z.boolean().default(false),
3215832159
lowerContextAccess: ExternalFunctionSchema.nullable().default(null),
3215932160
validateNoVoidUseMemo: zod.z.boolean().default(false),
3216032161
validateNoDynamicallyCreatedComponentsOrHooks: zod.z.boolean().default(false),
@@ -48008,9 +48009,16 @@ function* generateInstructionTypes(env, names, instr) {
4800848009
}
4800948010
case 'CallExpression': {
4801048011
const returnType = makeType();
48012+
let shapeId = null;
48013+
if (env.config.enableTreatSetIdentifiersAsStateSetters) {
48014+
const name = getName(names, value.callee.identifier.id);
48015+
if (name.startsWith('set')) {
48016+
shapeId = BuiltInSetStateId;
48017+
}
48018+
}
4801148019
yield equation(value.callee.identifier.type, {
4801248020
kind: 'Function',
48013-
shapeId: null,
48021+
shapeId,
4801448022
return: returnType,
4801548023
isConstructor: false,
4801648024
});

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a51f925217e7c2a92fe4df707487acb29cb12b1e
1+
84af9085c11411e44cc5e5aee6cf00c02a78986e
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a51f925217e7c2a92fe4df707487acb29cb12b1e
1+
84af9085c11411e44cc5e5aee6cf00c02a78986e

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,7 @@ __DEV__ &&
14191419
exports.useTransition = function () {
14201420
return resolveDispatcher().useTransition();
14211421
};
1422-
exports.version = "19.2.0-www-classic-a51f9252-20250916";
1422+
exports.version = "19.2.0-www-classic-84af9085-20250917";
14231423
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
14241424
"function" ===
14251425
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
@@ -1419,7 +1419,7 @@ __DEV__ &&
14191419
exports.useTransition = function () {
14201420
return resolveDispatcher().useTransition();
14211421
};
1422-
exports.version = "19.2.0-www-modern-a51f9252-20250916";
1422+
exports.version = "19.2.0-www-modern-84af9085-20250917";
14231423
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
14241424
"function" ===
14251425
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
@@ -602,4 +602,4 @@ exports.useSyncExternalStore = function (
602602
exports.useTransition = function () {
603603
return ReactSharedInternals.H.useTransition();
604604
};
605-
exports.version = "19.2.0-www-classic-a51f9252-20250916";
605+
exports.version = "19.2.0-www-classic-84af9085-20250917";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,4 +602,4 @@ exports.useSyncExternalStore = function (
602602
exports.useTransition = function () {
603603
return ReactSharedInternals.H.useTransition();
604604
};
605-
exports.version = "19.2.0-www-modern-a51f9252-20250916";
605+
exports.version = "19.2.0-www-modern-84af9085-20250917";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ exports.useSyncExternalStore = function (
606606
exports.useTransition = function () {
607607
return ReactSharedInternals.H.useTransition();
608608
};
609-
exports.version = "19.2.0-www-classic-a51f9252-20250916";
609+
exports.version = "19.2.0-www-classic-84af9085-20250917";
610610
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
611611
"function" ===
612612
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
@@ -606,7 +606,7 @@ exports.useSyncExternalStore = function (
606606
exports.useTransition = function () {
607607
return ReactSharedInternals.H.useTransition();
608608
};
609-
exports.version = "19.2.0-www-modern-a51f9252-20250916";
609+
exports.version = "19.2.0-www-modern-84af9085-20250917";
610610
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
611611
"function" ===
612612
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)