Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profiler shows which fibers scheduled an update, and why a given component rendered (do not merge) #269

Closed
wants to merge 2 commits into from

Conversation

bvaughn
Copy link
Owner

@bvaughn bvaughn commented May 12, 2019

Note that this PR is blocked by React PR 15658 and unit tests are expected to fail unless using a version of React built from from the scheduler-tracking branch.

I'm exploring how the Profiler UI might help answer a few common questions:

Why did this commit happen in the first place?

This feature requires a build of react-dom from the scheduler-tracking branch.

Here's an example that shows how batched updates will list multiple schedulers:
why-batched

And here's an example that illustrates both suspense (how the scheduler is continued across the ping) and how we could potentially handle a scheduler that is unmounted as a result of the udpate:
why-suspenseKapture 2019-05-15 at 11 17 40

Why did component X re-render as part of it?

This is an example of how we could show what changed between renders:
whatwhat

Note that hooks are tricky to handle, so for now we don't try to display what hook changed.

@bvaughn bvaughn force-pushed the scheduler-tracking branch 3 times, most recently from bdfdfd9 to 864ae74 Compare May 14, 2019 18:26
@bvaughn bvaughn changed the title Profiler POC [DO NOT MERGE] [WIP] Profiler proof of concept (do not merge) May 15, 2019
@bvaughn bvaughn changed the title [WIP] Profiler proof of concept (do not merge) [WIP] Profiler shows which fibers scheduled an update, and why a given component rendered May 16, 2019
@bvaughn bvaughn force-pushed the scheduler-tracking branch from ac7f6cf to ed7a328 Compare May 16, 2019 20:39
@bvaughn bvaughn requested a review from gaearon May 16, 2019 20:40
@bvaughn bvaughn changed the title [WIP] Profiler shows which fibers scheduled an update, and why a given component rendered Profiler shows which fibers scheduled an update, and why a given component rendered May 16, 2019
@@ -1308,7 +1401,14 @@ export function attach(
timestamp: interaction.timestamp - profilingStartTime,
})
),
updaters:
Copy link
Owner Author

Choose a reason for hiding this comment

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

Note to self: We should probably respect filtering preferences here. Otherwise we may end up showing "an unmounted component" when it was really just a filtered-out component.

@bvaughn bvaughn changed the title Profiler shows which fibers scheduled an update, and why a given component rendered Profiler shows which fibers scheduled an update, and why a given component rendered (do not merge) May 19, 2019
@bvaughn
Copy link
Owner Author

bvaughn commented Jun 7, 2019

I'm going to split off the change tracking from the updater tracking, since the former is not blocked by a React PR.

#310

@bvaughn
Copy link
Owner Author

bvaughn commented Aug 17, 2019

Closing all PRs at this repo as part of migrating to github.com/facebook/react

@bvaughn bvaughn closed this Aug 17, 2019
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