Skip to content

Commit 2cce761

Browse files
committed
Gate on enableAsyncDebugInfo flag and not just enableComponentPerformanceTrack
We rely on enableComponentPerformanceTrack flag for the timing tracking in general but then we additionally need the async debug info flag to use the async tracking.
1 parent 27855af commit 2cce761

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/react-server/src/ReactFlightServer.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
enableTaint,
2020
enableProfilerTimer,
2121
enableComponentPerformanceTrack,
22+
enableAsyncDebugInfo,
2223
} from 'shared/ReactFeatureFlags';
2324

2425
import {
@@ -1950,7 +1951,11 @@ function emitAsyncSequence(
19501951
}
19511952

19521953
function pingTask(request: Request, task: Task): void {
1953-
if (enableProfilerTimer && enableComponentPerformanceTrack) {
1954+
if (
1955+
enableProfilerTimer &&
1956+
enableComponentPerformanceTrack &&
1957+
enableAsyncDebugInfo
1958+
) {
19541959
// If this was async we need to emit the time when it completes.
19551960
task.timed = true;
19561961
const sequence = getCurrentAsyncSequence();

packages/react-server/src/__tests__/ReactFlightAsyncDebugInfo-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ describe('ReactFlightAsyncDebugInfo', () => {
149149
expect(await result).toBe('hi');
150150
getDebugInfo(result);
151151
/*
152-
if (__DEV__ && gate(flags => flags.enableComponentPerformanceTrack)) {
152+
if (__DEV__ && gate(flags => flags.enableComponentPerformanceTrack && flags.enableAsyncDebugInfo)) {
153153
expect(getDebugInfo(result)).toMatchInlineSnapshot(`
154154
[
155155
{
@@ -307,7 +307,7 @@ describe('ReactFlightAsyncDebugInfo', () => {
307307
expect(await result).toBe('hi');
308308
getDebugInfo(result);
309309
/*
310-
if (__DEV__ && gate(flags => flags.enableComponentPerformanceTrack)) {
310+
if (__DEV__ && gate(flags => flags.enableComponentPerformanceTrack && flags.enableAsyncDebugInfo)) {
311311
expect().toMatchInlineSnapshot(`
312312
[
313313
{

0 commit comments

Comments
 (0)