-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Problem
During profiling, the ChangeDescription from React DevTools contains the specific prop names, state keys, and hook indices that changed per commit. But describeCauses() in profiler.ts collapses this into generic labels like "props-changed" or "state-changed", discarding the useful detail.
What we have (in ChangeDescription)
props: ["onClick", "className"] // which prop names changed
state: ["isOpen", "count"] // which state key names changed
hooks: [0, 2] // which hook indices changed
What we currently output
causes: props-changed, state-changed
What we should output
@c5 [fn] "TodoItem" 2.1ms props: onClick, className
@c8 [fn] "Counter" 0.3ms state: count hooks: #0
Proposed solution
- Extend
RenderCauseor add a parallel field to carry the specific keys alongside the cause type - Update
describeCauses()to preserve key names and hook indices - Update formatters (
formatProfileReport,formatSlowest,formatRerenders,formatCommitDetail) to display the specific keys - Keep the data compact β just key names, not values (values aren't available from the profiling protocol)
Files to change
src/types.tsβ extendChangeDescriptionflow orComponentRenderReportto carry key detailssrc/profiler.tsβ updatedescribeCauses()and report generationsrc/formatters.tsβ update profiling formatters to show key namessrc/__tests__/profiler.test.tsβ update testssrc/__tests__/formatters.test.tsβ update tests
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels