react icon indicating copy to clipboard operation
react copied to clipboard

[DevTools] Show which hooks (names) changed in the Profiler

Open bvaughn opened this issue 4 years ago • 12 comments

Hooks are the preferred way for writing stateful React components, but there are a few things about them that still lag behind the class component API: profiling (since DevTools just shows “hooks changed” rather than which ones changed).

Building on top of the initial named hooks release and the experimental enableProfilerChangedHookIndices feature flag, the Profiler should show the “names” of hooks that changed between renders. (Because this would be expensive to eagerly calculate, we would need to add a post-processing phase to the profiler, like Chrome has, where we loaded and parsed names1.)

Note that this issue will also resolve #16477.

1 We may only want to do this for components that are still mounted in the Fiber tree.

bvaughn avatar Jul 12 '21 21:07 bvaughn

You're welcome to take a pass at this, @Fahme.

It's a pretty large task and it would need to be self-guided (minimal support from me), but if you're interested- that's awesome.

bvaughn avatar Jul 21 '21 17:07 bvaughn

You're welcome to take a pass at this, @Fahme.

It's a pretty large task and it would need to be self-guided (minimal support from me), but if you're interested- that's awesome.

I've actually commented before going through the previous discussions and the challenges you guys were facing to get this to work so i took my comment out before your reply.

Anyways It would be a really nice feature to have i'll give it a shot and see if i can tackle it.

Fahme avatar Jul 21 '21 17:07 Fahme

Sounds good. Keep me posted!

bvaughn avatar Jul 21 '21 19:07 bvaughn

Super excited for this, godspeed @Fahme!

dustinlacewell avatar Jul 31 '21 19:07 dustinlacewell

Any updates on this?

msalahz avatar Oct 10 '21 09:10 msalahz

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

stale[bot] avatar Jan 08 '22 23:01 stale[bot]

bump

arsinclair avatar Jan 09 '22 16:01 arsinclair

bump

piotrpawlik avatar Jan 26 '22 16:01 piotrpawlik

There's no need to bump this. We know the feature would be useful. We just don't have the bandwidth for it.

bvaughn avatar Jan 26 '22 16:01 bvaughn

@bvaughn if not bumped, looks like it will be automatically closed.

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open

arsinclair avatar Jan 26 '22 22:01 arsinclair

@arsinclair The stale comment only applies to issues not tagged as being opened by core team, which this one now has been. The bump from this morning didn't really do anything other than notify people on this thread.

bvaughn avatar Jan 26 '22 22:01 bvaughn

Like @bvaughn said, I will also name my first child "React" if this gets implemented!

dukeeagle avatar Feb 26 '24 16:02 dukeeagle