KEMBAR78
[Tracks]: display method name and component name for updates in DEV by hoxyq · Pull Request #34463 · facebook/react · GitHub
Skip to content

Conversation

@hoxyq
Copy link
Contributor

@hoxyq hoxyq commented Sep 10, 2025

For every "Update" entry we are going to add properties that will be displayed when the user clicks on that entry: name of the method that caused this first update and name of the component where this update happened.

We could use the name of the component as a deeplink to React DevTools components panel in the future, once we support stable identificators on Fibers.

Screenshot 2025-09-10 at 18 31 10 Screenshot 2025-09-10 at 18 24 21 Screenshot 2025-09-10 at 18 26 04

@hoxyq hoxyq requested a review from sebmarkbage September 10, 2025 18:03
@meta-cla meta-cla bot added the CLA Signed label Sep 10, 2025
@react-sizebot
Copy link

react-sizebot commented Sep 10, 2025

Comparing: a9ad64c...21b4372

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 530.65 kB 530.65 kB = 93.49 kB 93.49 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 658.20 kB 658.20 kB = 115.79 kB 115.79 kB
facebook-www/ReactDOM-prod.classic.js = 682.36 kB 682.36 kB = 119.83 kB 119.83 kB
facebook-www/ReactDOM-prod.modern.js = 672.79 kB 672.79 kB = 118.14 kB 118.14 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 21b4372

export function startUpdateTimerByLane(
lane: Lane,
method: string,
componentName: string | null,
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could just accept a Fiber and call getComponentName in here instead. That way you have the option of doing it lazily too and don't have to repeat it.

We deal with Fibers here anyway. E.g. this is what startHostActionTimer already does.

@hoxyq hoxyq force-pushed the tracks/display-additional-fields-for-updates-in-dev branch from 2d49182 to e6a43f5 Compare September 12, 2025 10:25
@hoxyq hoxyq force-pushed the tracks/display-additional-fields-for-updates-in-dev branch from e6a43f5 to 21b4372 Compare September 12, 2025 10:27
@hoxyq hoxyq merged commit 0c813c5 into facebook:main Sep 12, 2025
241 checks passed
@hoxyq hoxyq deleted the tracks/display-additional-fields-for-updates-in-dev branch September 12, 2025 10:34
github-actions bot pushed a commit that referenced this pull request Sep 12, 2025
…34463)

For every "Update" entry we are going to add properties that will be
displayed when the user clicks on that entry: name of the method that
caused this first update and name of the component where this update
happened.

We could use the name of the component as a deeplink to React DevTools
components panel in the future, once we support stable identificators on
Fibers.

<img width="1444" height="530" alt="Screenshot 2025-09-10 at 18 31 10"
src="https://github.com/user-attachments/assets/7f9af037-2e7f-4e7b-9b7e-bf9f7d5a6e72"
/>
<img width="2088" height="530" alt="Screenshot 2025-09-10 at 18 24 21"
src="https://github.com/user-attachments/assets/f557a173-bd9b-43f7-9333-74066f433ced"
/>
<img width="2088" height="530" alt="Screenshot 2025-09-10 at 18 26 04"
src="https://github.com/user-attachments/assets/ff37d13f-bbe3-4f85-800e-81aa3aed7833"
/>

DiffTrain build for [0c813c5](0c813c5)
github-actions bot pushed a commit that referenced this pull request Sep 12, 2025
…34463)

For every "Update" entry we are going to add properties that will be
displayed when the user clicks on that entry: name of the method that
caused this first update and name of the component where this update
happened.

We could use the name of the component as a deeplink to React DevTools
components panel in the future, once we support stable identificators on
Fibers.

<img width="1444" height="530" alt="Screenshot 2025-09-10 at 18 31 10"
src="https://github.com/user-attachments/assets/7f9af037-2e7f-4e7b-9b7e-bf9f7d5a6e72"
/>
<img width="2088" height="530" alt="Screenshot 2025-09-10 at 18 24 21"
src="https://github.com/user-attachments/assets/f557a173-bd9b-43f7-9333-74066f433ced"
/>
<img width="2088" height="530" alt="Screenshot 2025-09-10 at 18 26 04"
src="https://github.com/user-attachments/assets/ff37d13f-bbe3-4f85-800e-81aa3aed7833"
/>

DiffTrain build for [0c813c5](0c813c5)
@rickhanlonii
Copy link
Member

Oh hell yes

@sebmarkbage
Copy link
Collaborator

Something in here has broken how updates are logged. They don't show up for me at all.

Or worse, I've been able to get them to overlap into two rows sometimes now. However that's so hard to repro I'm not sure if that was an existing issue.

blockingUpdateMethodName = method;
if (__DEV__ && fiber != null) {
blockingUpdateComponentName = getComponentNameFromFiber(fiber);
}
Copy link
Collaborator

@sebmarkbage sebmarkbage Sep 17, 2025

Choose a reason for hiding this comment

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

We should always set the component name even if it's null because otherwise we can show the wrong component name for the next call that is null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants