Skip to content

Avoid double logging component render time - #32749

Merged
sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:doublelogcomponent
Mar 26, 2025
Merged

sebmarkbage merged 1 commit into
react:mainfrom
sebmarkbage:doublelogcomponent

Conversation

@sebmarkbage

Copy link
Copy Markdown
Contributor

This got moved into the functional component and class component case statements here: 0de1233. So that we could separate the error case for class components.

However, due to a faulty rebase this got restored at the top as well. Leading to double component renders being logged.

In the other offscreen reconnect passes we don't do this in each case statement but still once at the top. The reason this doesn't matter is because use the PerformedWork flag and that is only set for function and class components. Although maybe it should be set for expensive DOM components too and then we have to remember this.

@react-sizebot

Copy link
Copy Markdown

Comparing: 4845e16...fbd62e7

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 515.14 kB 515.14 kB = 91.74 kB 91.74 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 614.35 kB 614.35 kB = 108.76 kB 108.76 kB
facebook-www/ReactDOM-prod.classic.js = 650.34 kB 650.34 kB = 114.79 kB 114.79 kB
facebook-www/ReactDOM-prod.modern.js = 640.62 kB 640.62 kB = 113.23 kB 113.23 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against fbd62e7

@sebmarkbage
sebmarkbage merged commit f9e1b16 into react:main Mar 26, 2025
github-actions Bot pushed a commit that referenced this pull request Mar 26, 2025
This got moved into the functional component and class component case
statements here:
0de1233.
So that we could separate the error case for class components.

However, due to a faulty rebase this got restored at the top as well.
Leading to double component renders being logged.

In the other offscreen reconnect passes we don't do this in each case
statement but still once at the top. The reason this doesn't matter is
because use the PerformedWork flag and that is only set for function and
class components. Although maybe it should be set for expensive DOM
components too and then we have to remember this.

DiffTrain build for [f9e1b16](f9e1b16)
eps1lon pushed a commit to vercel/next.js that referenced this pull request Mar 26, 2025
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
This got moved into the functional component and class component case
statements here:
react@ba37997.
So that we could separate the error case for class components.

However, due to a faulty rebase this got restored at the top as well.
Leading to double component renders being logged.

In the other offscreen reconnect passes we don't do this in each case
statement but still once at the top. The reason this doesn't matter is
because use the PerformedWork flag and that is only set for function and
class components. Although maybe it should be set for expensive DOM
components too and then we have to remember this.

This branch was successfully deployed

1 active deployment
Preview — fbd62e77 Deployed Mar 25, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants