Skip to content

[WIP] React Profiler Experiments #2660

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

Closed
wants to merge 4 commits into from
Closed

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Jun 9, 2020

Experimenting with https://reactjs.org/docs/profiler.html

window.__REACT_DEVTOOLS_GLOBAL_HOOK__

@getsentry-bot
Copy link
Contributor

Warnings
⚠️ Please add a changelog entry for your changes.
Messages
📖

@sentry/browser bundle gzip'ed minified size: (ES5: 17.0732 kB) (ES6: 16.1367 kB)

📖 ✅ TSLint passed

Generated by 🚫 dangerJS against 219d1b2

const fake = React.createElement('div') as any;

// tslint:disable-next-line: triple-equals no-unsafe-any
if (fake._owner != null && fake._owner.actualDuration != null) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This sucks, but I can't find a better way to figure out if a user can profile or not.

@AbhiPrasad AbhiPrasad changed the title [WIP] Experiments [WIP] React Profiler Experiments Jun 9, 2020
@AbhiPrasad
Copy link
Member Author

Closing this PR with the following thoughts:

  • Supporting interaction tracing means we will have to decide on a specific scheduler and React version to support. This leads to a bunch of if statements to decide on how the Profiler has to be used. See this doc by bvaughn: https://gist.github.com/bvaughn/8de925562903afd2e7a12554adcdda16

  • Detecting a profiling bundle is very difficult. Maybe that will change in the future?

  • The Profiling API is unstable. This means that things could change at any moment. We should wait for them to announce something official before continuing work on this.

@AbhiPrasad AbhiPrasad closed this Jun 16, 2020
@AbhiPrasad AbhiPrasad deleted the abhi/profiler-experiments branch June 16, 2020 15:51
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.

2 participants