feat: capture before/after values for changed props/state/hooks during profiling
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- developer-experience, devtools
Research direction
Read issue #18 and devtools-bridge.ts:103-126 and :131 to understand changed-key profiling and inspectElement. Compare the snapshot, targeted-watch, and direct-fiber approaches, then define which approach and performance/accuracy behavior the feature will accept; the issue currently does not specify a single implementation or test.
Written by the indexing model from the issue text.
Description
Problem
Issue #18 surfaces the names of changed props/state/hooks in profiling output (e.g. props: onClick, className), but not their actual values. Knowing that className changed is useful, but knowing it changed from "btn" to "btn active" would be far more actionable for debugging.
The React DevTools profiling protocol only sends key names — values are not included by design (to keep profiling lightweight).
Possible approaches
Option A: Snapshot-based diffing (heavy, comprehensive)
During profiling, call inspectElement() after each commit for every component that changed. Store snapshots and diff consecutive ones to reconstruct before/after values.
- Pro: Uses existing infrastructure —
inspectElementalready works over the DevTools WebSocket protocol - Con:
inspectElementis async over WebSocket. Calling it for every changed component after every commit adds significant overhead and could slow profiling on busy apps - Con: "Before" values are approximated (previous snapshot), not true pre-commit values
Option B: Targeted watch mode (practical middle ground)
Let the user specify components to watch during profiling (e.g. profile-watch @c5). Only snapshot those specific components after each commit, reducing overhead.
- Pro: Practical performance trade-off — overhead scales with watched components, not total tree size
- Pro: User explicitly opts in, so the cost is expected
- Con: Requires knowing which components to watch upfront (could combine with a post-hoc "inspect the top offenders" step)
Option C: Direct fiber access (fragile, precise)
Inject custom code into the page that reads fiber.memoizedProps / fiber.pendingProps during onCommitFiberRoot to capture true before/after values at commit time.
- Pro: Would give true before/after values with no async overhead
- Con: Very fragile — fiber internals are not a public API and break across React versions
- Con: Requires forking or monkey-patching React DevTools backend code
- Con: Significant implementation complexity
Context
- Depends on #18 (surface changed key names first)
- The tool connects to React via the DevTools wire protocol over WebSocket (
devtools-bridge.ts) inspectElement()can already fetch full props/state/hooks on demand (devtools-bridge.ts:103-126)- Profiling uses
recordChangeDescriptions: truewhich only enables key name tracking (devtools-bridge.ts:131)
- Dominant language
- TypeScript
- Stars
- 251
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstackincubator/agent-react-devtools
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 5/5 Over a week Newbie friendliness 42/100
All issues in callstackincubator/agent-react-devtools
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
melgarafael/DeskcommCRM#5614 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 76/100
slackapi/slack-health-score#253 ·
Maintainers usually reply within 1 day
-
feature needs triage site
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
owid/owid-grapher#8019 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
simstudioai/sim#10710 ·
Maintainers usually reply within 1 day
-
via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day