Skip to content

Conversation

gnoff
Copy link
Collaborator

@gnoff gnoff commented Jul 8, 2025

We unnecessarily render the preamble in a task. This updates the implementation to perform this render inline.

Testing this is tricky because one of the only ways you could assert this was even happening is based on how things error if you abort while rendering the root.

While adding a test for this I discovered that not all abortable tasks report errors when aborted during a normal render. I've asserted the current behavior and will address the other issue at another time and updated the assertion later as necessary

We unecessarily render the preamble in a task. This updates the implementation to perform this render inline.
@gnoff gnoff requested a review from sebmarkbage July 8, 2025 06:13
@gnoff gnoff requested a review from eps1lon July 8, 2025 06:13
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Jul 8, 2025
@react-sizebot
Copy link

Comparing: b44a99b...f7473d5

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 +0.05% 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 530.70 kB 530.70 kB = 93.70 kB 93.70 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 = 655.25 kB 655.25 kB = 115.40 kB 115.40 kB
facebook-www/ReactDOM-prod.classic.js = 675.13 kB 675.13 kB = 118.75 kB 118.75 kB
facebook-www/ReactDOM-prod.modern.js = 665.56 kB 665.56 kB = 117.12 kB 117.12 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable-semver/react-server/cjs/react-server.production.js = 135.61 kB 135.31 kB +0.03% 23.92 kB 23.93 kB
oss-stable/react-server/cjs/react-server.production.js = 135.61 kB 135.31 kB +0.03% 23.92 kB 23.93 kB

Generated by 🚫 dangerJS against f7473d5

@gnoff gnoff merged commit befc124 into facebook:main Jul 8, 2025
247 checks passed
@gnoff gnoff deleted the render-preamble-eagerly branch July 8, 2025 15:20
github-actions bot pushed a commit that referenced this pull request Jul 8, 2025
We unnecessarily render the preamble in a task. This updates the
implementation to perform this render inline.

Testing this is tricky because one of the only ways you could assert
this was even happening is based on how things error if you abort while
rendering the root.

While adding a test for this I discovered that not all abortable tasks
report errors when aborted during a normal render. I've asserted the
current behavior and will address the other issue at another time and
updated the assertion later as necessary

DiffTrain build for [befc124](befc124)
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.

5 participants