Skip to content

feat(react-devtools): drill into the saved React profile by component and commit - #3618

Merged
thymikee merged 1 commit into
feat/react-devtools-profilerfrom
feat/react-devtools-profile-views
Oct 14, 2026
Merged

thymikee merged 1 commit into
feat/react-devtools-profilerfrom
feat/react-devtools-profile-views

Conversation

@thymikee

@thymikee thymikee commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds drill-down views over the profile that react-devtools profile stop (#3613) saves for the session:

agent-device react-devtools profile report ContactRow   # causes, changed props and their kinds, owners, costliest commits
agent-device react-devtools profile commit 6            # one commit's components, grouped, by self time
agent-device react-devtools profile slow --limit 5
agent-device react-devtools profile rerenders --limit 5
agent-device react-devtools profile timeline --limit 20 --sort duration

stop now ends with a More: line naming these commands. Tables say how many rows they omit. report takes a component name and commit takes a whole index (6 or #6). A malformed saved profile fails with a hint to record a new one. Touches 9 files (378 lines).

Validation

At 54120679f8, check:affected --run and check:production-exports pass.

Live on Android RN 0.88-rc, on this build, after the memo-defeated scenario: profile report ContactRow printed its causes, the changed prop kinds, and "its costliest commits (self time of commit duration): #0 136ms of 170ms, …".

On the RN 0.83 iOS simulator, profile report ProductTile printed both of its findings.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 8 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread src/cli/react-profiler/react-profile-command.ts Outdated
Comment thread src/cli/react-profiler/react-profile-command.ts
Comment thread src/cli/react-profiler/react-profile-format.ts Outdated
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.27 MB 5.27 MB +6.3 kB
Package (unpacked) 5.26 MB 5.27 MB +6.3 kB
Package (download) 1.58 MB 1.59 MB +1.9 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.8 ms 26.2 ms -0.7 ms
CLI --help 71.9 ms 71.6 ms -0.3 ms

@thymikee

Copy link
Copy Markdown
Member Author

The drill-down code in b11b5ad looks good, and I found nothing that blocks it. CI is still running: 18 of 21 checks are queued or in progress and none has failed. No conflicts. Two of the open Cubic threads still need a fix, and then the queued checks need to go green before merge.

Not blocking: PROFILE_OPTIONS in react-profile-command.ts is one flat set for every subcommand, so profile slow --sort duration succeeds and the flag does nothing (--limit on report and --app/--metro-* on the drill-downs behave the same way). Declaring the allowed flags per subcommand next to SUBCOMMANDS_WITH_TARGET and rejecting the rest with INVALID_ARGS would fix it. Take it or leave it.

On the open threads: the commit --json thread still applies, because commit --json ignores --limit for top while the text output and the other drill-downs honor it. The blank cause thread also still applies, because formatCommit prints an empty cause when change data is unrecorded, and causeSummary already prints "unrecorded" for that case. The inner entry validation thread does not apply: writeSavedProfile is the only writer of the file, and the version gate already checks the format, so you can resolve it.

I did not run the tests. The new tests call subcommands that do not exist on the base, so they would fail there. The simulator and Android runs are described in the PR body only. The drill-downs read just a local file, so I did not need live device evidence.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-14 17:58 UTC

@thymikee
thymikee force-pushed the feat/react-devtools-profile-views branch from b11b5ad to 546beae Compare October 14, 2026 17:01
@thymikee
thymikee force-pushed the feat/react-devtools-profile-views branch from 546beae to ef6f1e5 Compare October 14, 2026 17:11
@thymikee
thymikee force-pushed the feat/react-devtools-profile-views branch from ef6f1e5 to d627d11 Compare October 14, 2026 17:12
@thymikee
thymikee force-pushed the feat/react-devtools-profile-views branch from d627d11 to e82d0ab Compare October 14, 2026 17:18
@thymikee
thymikee force-pushed the feat/react-devtools-profile-views branch from e82d0ab to 5412067 Compare October 14, 2026 17:29
@thymikee

Copy link
Copy Markdown
Member Author

At 54120679f8, rebased onto the updated #3613:

  • commit --json (r4273389122): top now follows --limit, the same as the text view.
  • Blank cause (r4273389164): an entry without change data now prints unrecorded.
  • Per-subcommand flags (not blocking): taken. Each subcommand declares the options it reads, and any other option fails with INVALID_ARGS (for example, slow --sort, report --limit, and start --limit on feat(react-devtools): profile React renders through the Metro inspector #3613).
  • r4273389153: resolved as you suggested.

Tests cover each fix. check:affected --run and check:production-exports pass locally.

@thymikee
thymikee merged commit 5412067 into main Oct 14, 2026
24 of 26 checks passed
@thymikee
thymikee deleted the feat/react-devtools-profile-views branch October 14, 2026 17:39
@thymikee

thymikee commented Oct 14, 2026 •

Copy link
Copy Markdown
Member Author

Folded into #3613 to save CI runners. feat/react-devtools-profiler now points at 54120679f8, which contains this commit, so GitHub marked this PR merged into that branch. Review continues on #3613.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant