dillon1000/react

Commit

[react-devtools-facade] 3/ implement profiler tools (#36598)

Adds the profiler building blocks to `createTools` — per-commit render
timing on top of the component-tree tools from commit 2.

### Tools

- **`startProfiling(traceName?)`** → `{status: 'started', trace}`.
Begins a session that records timing on every commit. Errors if a
session is already active.
- **`stopProfiling()`** → `{status: 'stopped', traceName, commits}`
(commit count). Errors if no session is active.
- **`getTraceOverview(traceName)`** → one row per commit: `{commit,
committedAt, renderDuration, layoutDuration, passiveDuration,
componentsChanged}`.
- **`getCommitReport(traceName, commitIndex)`** → one commit's detail:
`{committedAt, priority, renderDuration, layoutDuration,
passiveDuration,
components}`, where `components` is `{label, name, type, actualDuration,
  selfDuration}` sorted by `actualDuration` descending.

Durations are in milliseconds, or `null` when the build does not collect
profiler
timing. `passiveDuration` is attributed per root via the hook's
post-commit pass.
Browse files
Changed paths4 files
First-parent comparison
A packages/react-devtools-facade/src/DevToolsFacadeProfilerTools.js AddedM packages/react-devtools-facade/src/DevToolsFacadeTools.js ModifiedM packages/react-devtools-facade/src/DevToolsFacadeTreeTools.js ModifiedM packages/react-devtools-facade/src/__tests__/DevToolsFacade-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…