Skip to content

[pull] main from facebook:main #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions packages/react-client/src/ReactFlightClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -3647,7 +3647,7 @@ function initializeIOInfo(response: Response, ioInfo: ReactIOInfo): void {
// $FlowFixMe[cannot-write]
ioInfo.end += response._timeOrigin;

if (response._replayConsole) {
if (enableComponentPerformanceTrack && response._replayConsole) {
const env = response._rootEnvironmentName;
const promise = ioInfo.value;
if (promise) {
Expand Down Expand Up @@ -4149,7 +4149,10 @@ function processFullStringRow(
return;
}
case 78 /* "N" */: {
if (enableProfilerTimer && enableComponentPerformanceTrack) {
if (
enableProfilerTimer &&
(enableComponentPerformanceTrack || enableAsyncDebugInfo)
) {
// Track the time origin for future debug info. We track it relative
// to the current environment's time space.
const timeOrigin: number = +row;
Expand All @@ -4169,11 +4172,7 @@ function processFullStringRow(
// Fallthrough to share the error with Console entries.
}
case 74 /* "J" */: {
if (
enableProfilerTimer &&
enableComponentPerformanceTrack &&
enableAsyncDebugInfo
) {
if (enableProfilerTimer && enableAsyncDebugInfo) {
resolveIOInfo(response, id, row);
return;
}
Expand Down
12 changes: 6 additions & 6 deletions packages/react-client/src/ReactFlightPerformanceTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function logComponentRender(
}
debugTask.run(
// $FlowFixMe[method-unbinding]
performance.measure.bind(performance, entryName, {
performance.measure.bind(performance, '\u200b' + entryName, {
start: startTime < 0 ? 0 : startTime,
end: childrenEndTime,
detail: {
Expand All @@ -125,7 +125,7 @@ export function logComponentRender(
);
} else {
console.timeStamp(
entryName,
'\u200b' + entryName,
startTime < 0 ? 0 : startTime,
childrenEndTime,
trackNames[trackIdx],
Expand Down Expand Up @@ -163,7 +163,7 @@ export function logComponentAborted(
if (componentInfo.props != null) {
addObjectToProperties(componentInfo.props, properties, 0, '');
}
performance.measure(entryName, {
performance.measure('\u200b' + entryName, {
start: startTime < 0 ? 0 : startTime,
end: childrenEndTime,
detail: {
Expand Down Expand Up @@ -220,7 +220,7 @@ export function logComponentErrored(
if (componentInfo.props != null) {
addObjectToProperties(componentInfo.props, properties, 0, '');
}
performance.measure(entryName, {
performance.measure('\u200b' + entryName, {
start: startTime < 0 ? 0 : startTime,
end: childrenEndTime,
detail: {
Expand Down Expand Up @@ -614,7 +614,7 @@ export function logIOInfoErrored(
getIOLongName(ioInfo, description, ioInfo.env, rootEnv) + ' Rejected';
debugTask.run(
// $FlowFixMe[method-unbinding]
performance.measure.bind(performance, entryName, {
performance.measure.bind(performance, '\u200b' + entryName, {
start: startTime < 0 ? 0 : startTime,
end: endTime,
detail: {
Expand Down Expand Up @@ -667,7 +667,7 @@ export function logIOInfo(
);
debugTask.run(
// $FlowFixMe[method-unbinding]
performance.measure.bind(performance, entryName, {
performance.measure.bind(performance, '\u200b' + entryName, {
start: startTime < 0 ? 0 : startTime,
end: endTime,
detail: {
Expand Down
4 changes: 2 additions & 2 deletions packages/react-client/src/__tests__/ReactFlight-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2898,7 +2898,7 @@ describe('ReactFlight', () => {
);
});

// @gate enableAsyncIterableChildren
// @gate enableAsyncIterableChildren && enableComponentPerformanceTrack
it('preserves debug info for server-to-server pass through of async iterables', async () => {
let resolve;
const iteratorPromise = new Promise(r => (resolve = r));
Expand Down Expand Up @@ -3727,7 +3727,7 @@ describe('ReactFlight', () => {
expect(caughtError.digest).toBe('digest("my-error")');
});

// @gate __DEV__ && enableComponentPerformanceTrack
// @gate __DEV__ && enableComponentPerformanceTrack
it('can render deep but cut off JSX in debug info', async () => {
function createDeepJSX(n) {
if (n <= 0) {
Expand Down
10 changes: 5 additions & 5 deletions packages/react-reconciler/src/ReactFiberPerformanceTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export function logComponentRender(
// $FlowFixMe[method-unbinding]
performance.measure.bind(
performance,
name,
'\u200b' + name,
reusableComponentOptions,
),
);
Expand Down Expand Up @@ -369,10 +369,10 @@ export function logComponentErrored(
if (__DEV__ && debugTask) {
debugTask.run(
// $FlowFixMe[method-unbinding]
performance.measure.bind(performance, name, options),
performance.measure.bind(performance, '\u200b' + name, options),
);
} else {
performance.measure(name, options);
performance.measure('\u200b' + name, options);
}
} else {
console.timeStamp(
Expand Down Expand Up @@ -436,10 +436,10 @@ function logComponentEffectErrored(
if (debugTask) {
debugTask.run(
// $FlowFixMe[method-unbinding]
performance.measure.bind(performance, name, options),
performance.measure.bind(performance, '\u200b' + name, options),
);
} else {
performance.measure(name, options);
performance.measure('\u200b' + name, options);
}
} else {
console.timeStamp(
Expand Down
Loading
Loading