8000 [Fizz] Always load the external runtime if one is provided by sebmarkbage · Pull Request #33091 · facebook/react · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Fizz] Always load the external runtime if one is provided #33091

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

Merged
merged 1 commit into from
May 1, 2025

Conversation

sebmarkbage
Copy link
Collaborator
@sebmarkbage sebmarkbage commented May 1, 2025

Because we now decided whether to outline in the flushing phase, when we're writing the preamble we don't yet know if we will make that decision so we don't know if it's safe to omit the external runtime.

However, if you are providing an external runtime it's probably a pretty safe bet you're streaming something dynamically that's likely to need it so we can always include it.

The main thing is that this makes it hard to test it because it affects our tests in ways it wouldn't otherwise so we have to add a bunch of conditions.

@sebmarkbage sebmarkbage requested a review from gnoff May 1, 2025 20:15
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label May 1, 2025
@react-sizebot
Copy link
react-sizebot commented May 1, 2025

Comparing: 0ed6ceb...db624e8

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.11% 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 528.27 kB 527.81 kB = 93.14 kB 93.08 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.11% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 633.90 kB 633.44 kB = 111.33 kB 111.27 kB
facebook-www/ReactDOM-prod.classic.js = 671.68 kB 671.22 kB = 117.77 kB 117.71 kB
facebook-www/ReactDOM-prod.modern.js = 661.96 kB 661.50 kB = 116.21 kB 116.15 kB
oss-experimental/react-dom/unstable_server-external-runtime.js = 9.60 kB 9.36 kB = 2.54 kB 2.51 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/react-dom/unstable_server-external-runtime.js = 9.60 kB 9.36 kB = 2.54 kB 2.51 kB

Generated by 🚫 dangerJS against db624e8

Comment on lines 704 to 706
(gate(flags => flags.shouldUseFizzExternalRuntime)
? '<script src="react-dom-bindings/src/server/ReactDOMServerExternalRuntime.js" async=""></script>'
: '') +
Copy link
Collaborator

Choose a reason for hiding this comment

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

script src should be react-dom/unstable_server-external-runtime

@sebmarkbage
Copy link
Collaborator Author

One thing we could do is maybe make it conditional if there are no eligible Suspense boundaries rendered. Which if if you set progressiveChunkSize to Infinity would be always.

@sebmarkbage sebmarkbage merged commit f739642 into facebook:main May 1, 2025
239 checks passed
github-actions bot pushed a commit that referenced this pull request May 1, 2025
Because we now decided whether to outline in the flushing phase, when
we're writing the preamble we don't yet know if we will make that
decision so we don't know if it's safe to omit the external runtime.

However, if you are providing an external runtime it's probably a pretty
safe bet you're streaming something dynamically that's likely to need it
so we can always include it.

The main thing is that this makes it hard to test it because it affects
our tests in ways it wouldn't otherwise so we have to add a bunch of
conditions.

DiffTrain build for [f739642](f739642)
github-actions bot pushed a commit to code/lib-react that referenced this pull request May 2, 2025
…33091)

Because we now decided whether to outline in the flushing phase, when
we're writing the preamble we don't yet know if we will make that
decision so we don't know if it's safe to omit the external runtime.

However, if you are providing an external runtime it's probably a pretty
safe bet you're streaming something dynamically that's likely to need it
so we can always include it.

The main thing is that this makes it hard to test it because it affects
our tests in ways it wouldn't otherwise so we have to add a bunch of
conditions.

DiffTrain build for [f739642](facebook@f739642)
github-actions bot pushed a commit to code/lib-react that referenced this pull request May 2, 2025
…33091)

Because we now decided whether to outline in the flushing phase, when
we're writing the preamble we don't yet know if we will make that
decision so we don't know if it's safe to omit the external runtime.

However, if you are providing an external runtime it's probably a pretty
safe bet you're streaming something dynamically that's likely to need it
so we can always include it.

The main thing is that this makes it hard to test it because it affects
our tests in ways it wouldn't otherwise so we have to add a bunch of
conditions.

DiffTrain build for [f739642](facebook@f739642)
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
0