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

Add measurement of React tree size #42

Merged
merged 5 commits into from
Jul 6, 2020

Conversation

jacklorusso
Copy link

This change adds a new static task to measure the React tree size.

In React 16^, the virtual DOM consists of both React elements and internal objects called “fibers” to hold additional information about the component tree. This task currently treats all of these the same and returns a count of all of all of them.

I'm sure there are some improvements that could be made to the TypeScript pieces of the code here, I'm not super experienced with TS and felt very uncomfortable with the piece extending the HTMLElement type, but otherwise the _reactRootContainer property couldn't be accessed. I'm sure there is a better way!

image

src/tasks/preset/client.tsx Outdated Show resolved Hide resolved
@jacklorusso jacklorusso requested a review from alexreardon June 25, 2020 04:21
src/types.ts Outdated Show resolved Hide resolved
@alexreardon
Copy link
Collaborator

I’m keen to get this in 😍

@jacklorusso jacklorusso requested a review from alexreardon June 30, 2020 08:41
@alexreardon alexreardon merged commit ce3807a into atlassian-labs:master Jul 6, 2020
@jacklorusso jacklorusso deleted the add-react-tree-size branch July 6, 2020 01:26
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