feat: capture before/after values for changed props/state/hooks during profiling
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 30/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- react, typescript
調査の方向性
変更されたキーのプロファイリングとinspectElementを理解するために、issue #18とdevtools-bridge.ts:103-126および:131を読んでください。snapshot、targeted-watch、direct-fiberの各アプローチを比較し、そのうえで、この機能が受け入れるアプローチとパフォーマンス/精度の挙動を定義してください。このissueでは現在、単一の実装もテストも指定されていません。
索引モデルが issue の本文から書いたものです。
説明
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)
- 主要言語
- TypeScript
- スター
- 243
- フォーク
- 12
- 平均マージ
- 11時間 22分
- マージ済み PR(30日)
- 2
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
callstackincubator/agent-react-devtools のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 42/100
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
callstackincubator/agent-react-devtools#56 · コメント 1 件 ·
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
callstackincubator/agent-react-devtools の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
vercel-labs/just-bash#464 ·
-
looksLikeSlug() is ASCII-only, so non-Latin entity slugs (e.g. Korean) skip exact match and collapse オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
TanStack/tanstack.com#1293 ·