Skip to content

Import React Concurrent Mode Profiler (#19634) Co-authored-by: Brian Vaughn <bvaughn@fb.com> Co-authored-by: Kartik Choudhary <kartikc.918@gmail.com> - #7

Open
Menkalian wants to merge 1 commit into
ne_35-fromfrom
ne_35-to
Open

Import React Concurrent Mode Profiler (#19634) Co-authored-by: Brian Vaughn <bvaughn@fb.com> Co-authored-by: Kartik Choudhary <kartikc.918@gmail.com>#7
Menkalian wants to merge 1 commit into
ne_35-fromfrom
ne_35-to

Conversation

@Menkalian

Copy link
Copy Markdown
Owner

No description provided.

Co-authored-by: Brian Vaughn <bvaughn@fb.com>
Co-authored-by: Kartik Choudhary <kartikc.918@gmail.com>
Copilot AI review requested due to automatic review settings December 25, 2025 18:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR imports a React Concurrent Mode Profiler, a comprehensive tool for visualizing and analyzing React performance data from Chrome DevTools timelines. The profiler provides visualization of React's scheduling, rendering, commits, and other lifecycle events.

Key Changes:

  • Adds new react-devtools-scheduling-profiler package with complete profiling visualization capabilities
  • Integrates speedscope for flamechart visualization
  • Implements custom canvas-based view system for performance visualization
  • Adds multiple dependencies including webpack loaders, babel, and React packages

Reviewed changes

Copilot reviewed 53 out of 58 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
yarn.lock Adds numerous new dependencies for the profiler including webpack loaders, babel plugins, type definitions, and the @elg/speedscope package
webpack.config.js Complete webpack configuration for building the profiler with babel, CSS modules, and file loaders
src/view-base/* Custom canvas-based view system for rendering profiler UI with geometry utilities, layout system, and interaction handling
src/utils/* Utility functions for data preprocessing, file reading, and UI helpers
src/types.js Flow type definitions for profiler data structures
src/context/* Context menu implementation for the profiler UI
src/content-views/* Visualization components for different profiler data types
src/index.js Application entry point using React's unstable_createRoot
CSS files Styling for profiler UI components

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +21 to +40
if (element !== null) {
if (pageY + element.offsetHeight >= ownerWindow.innerHeight) {
if (pageY - element.offsetHeight > 0) {
element.style.top = `${pageY - element.offsetHeight}px`;
} else {
element.style.top = '0px';
}
} else {
element.style.top = `${pageY}px`;
}

if (pageX + element.offsetWidth >= ownerWindow.innerWidth) {
if (pageX - element.offsetWidth > 0) {
element.style.left = `${pageX - element.offsetWidth}px`;
} else {
element.style.left = '0px';
}
} else {
element.style.left = `${pageX}px`;
}

Copilot AI Dec 25, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This guard always evaluates to true.

Suggested change
if (element !== null) {
if (pageY + element.offsetHeight >= ownerWindow.innerHeight) {
if (pageY - element.offsetHeight > 0) {
element.style.top = `${pageY - element.offsetHeight}px`;
} else {
element.style.top = '0px';
}
} else {
element.style.top = `${pageY}px`;
}
if (pageX + element.offsetWidth >= ownerWindow.innerWidth) {
if (pageX - element.offsetWidth > 0) {
element.style.left = `${pageX - element.offsetWidth}px`;
} else {
element.style.left = '0px';
}
} else {
element.style.left = `${pageX}px`;
}
if (pageY + element.offsetHeight >= ownerWindow.innerHeight) {
if (pageY - element.offsetHeight > 0) {
element.style.top = `${pageY - element.offsetHeight}px`;
} else {
element.style.top = '0px';
}
} else {
element.style.top = `${pageY}px`;
}
if (pageX + element.offsetWidth >= ownerWindow.innerWidth) {
if (pageX - element.offsetWidth > 0) {
element.style.left = `${pageX - element.offsetWidth}px`;
} else {
element.style.left = '0px';
}
} else {
element.style.left = `${pageX}px`;

Copilot uses AI. Check for mistakes.
} from './types';

import * as React from 'react';
import {Fragment, useRef} from 'react';

Copilot AI Dec 25, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import useRef.

Suggested change
import {Fragment, useRef} from 'react';
import {Fragment} from 'react';

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +27
import {
ColorView,
Surface,
View,
layeredLayout,
rectContainsPoint,
rectEqualToRect,
intersectionOfRects,
rectIntersectsRect,
verticallyStackedLayout,
} from '../view-base';

Copilot AI Dec 25, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import Surface.

Copilot uses AI. Check for mistakes.
Comment on lines +19 to +25
import {
View,
Surface,
rectContainsPoint,
rectIntersectsRect,
intersectionOfRects,
} from '../view-base';

Copilot AI Dec 25, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import Surface.

Copilot uses AI. Check for mistakes.
Comment on lines +19 to +25
import {
View,
Surface,
rectContainsPoint,
rectIntersectsRect,
intersectionOfRects,
} from '../view-base';

Copilot AI Dec 25, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import Surface.

Copilot uses AI. Check for mistakes.
} from './useCanvasInteraction';
import type {Rect} from './geometry';

import {Surface} from './Surface';

Copilot AI Dec 25, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import Surface.

Copilot uses AI. Check for mistakes.
import type {Rect, Size} from './geometry';

import nullthrows from 'nullthrows';
import {Surface} from './Surface';

Copilot AI Dec 25, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import Surface.

Copilot uses AI. Check for mistakes.

import memoize from 'memoize-one';

import {View} from './View';

Copilot AI Dec 25, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import View.

Copilot uses AI. Check for mistakes.
} from './useCanvasInteraction';
import type {Rect} from './geometry';

import {Surface} from './Surface';

Copilot AI Dec 25, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import Surface.

Copilot uses AI. Check for mistakes.
import type {Rect, Size} from './geometry';
import type {Layouter} from './layouter';

import {Surface} from './Surface';

Copilot AI Dec 25, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused import Surface.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants