Skip to content

Conversation

sebmarkbage
Copy link
Collaborator

We never emit any inline functions when we use external runtime so this global shouldn't be needed.

@sebmarkbage sebmarkbage requested review from gnoff and mofeiZ April 30, 2025 16:09
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Apr 30, 2025
@react-sizebot
Copy link

Comparing: 408d055...2005386

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 = 527.81 kB 527.81 kB = 93.08 kB 93.08 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 = 633.44 kB 633.44 kB = 111.27 kB 111.27 kB
facebook-www/ReactDOM-prod.classic.js = 671.22 kB 671.22 kB = 117.71 kB 117.71 kB
facebook-www/ReactDOM-prod.modern.js = 661.50 kB 661.50 kB = 116.15 kB 116.15 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-markup/cjs/react-markup.react-server.development.js = 538.35 kB 536.83 kB = 96.25 kB 96.07 kB
react-native/implementations/ReactNativeRenderer-dev.fb.js = 678.74 kB 676.47 kB = 110.05 kB 109.79 kB
oss-experimental/react-server-dom-esm/esm/react-server-dom-esm-client.browser.development.js = 145.63 kB 145.05 kB = 34.24 kB 34.19 kB
react-native/implementations/ReactNativeRenderer-profiling.fb.js = 415.48 kB 413.74 kB = 70.94 kB 70.64 kB
react-native/implementations/ReactNativeRenderer-prod.fb.js = 387.37 kB 385.62 kB = 66.78 kB 66.54 kB
facebook-www/ReactDOMTesting-dev.classic.js = 1,231.98 kB 1,225.56 kB = 204.26 kB 203.43 kB
facebook-www/ReactDOMTesting-dev.modern.js = 1,222.84 kB 1,216.42 kB = 202.57 kB 201.72 kB
facebook-www/ReactDOM-dev.classic.js = 1,215.44 kB 1,209.03 kB = 200.60 kB 199.68 kB
facebook-www/ReactDOM-dev.modern.js = 1,206.30 kB 1,199.89 kB = 198.82 kB 197.95 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.development.js = 1,170.01 kB 1,163.73 kB = 195.23 kB 194.33 kB
oss-experimental/react-dom/cjs/react-dom-profiling.development.js = 1,169.86 kB 1,163.58 kB = 194.39 kB 193.49 kB
oss-experimental/react-dom/cjs/react-dom-client.development.js = 1,153.46 kB 1,147.18 kB = 191.53 kB 190.64 kB
react-native/implementations/ReactFabric-dev.fb.js = 675.04 kB 670.34 kB = 109.54 kB 108.79 kB
facebook-www/ReactReconciler-dev.classic.js = 845.48 kB 839.04 kB = 131.15 kB 130.25 kB
facebook-www/ReactReconciler-dev.modern.js = 836.27 kB 829.84 kB = 129.40 kB 128.53 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js = 794.41 kB 788.11 kB = 123.56 kB 122.73 kB
oss-experimental/react-dom/unstable_server-external-runtime.js = 8.80 kB 8.72 kB = 2.28 kB 2.25 kB
facebook-www/ReactART-dev.classic.js = 729.19 kB 722.64 kB = 113.36 kB 112.48 kB
react-native/implementations/ReactFabric-profiling.fb.js = 413.77 kB 410.00 kB = 70.70 kB 70.02 kB
facebook-www/ReactART-dev.modern.js = 719.70 kB 713.14 kB = 111.63 kB 110.76 kB
oss-experimental/react-art/cjs/react-art.development.js = 666.30 kB 659.91 kB = 104.76 kB 103.92 kB
react-native/implementations/ReactFabric-prod.fb.js = 385.59 kB 381.82 kB = 66.56 kB 65.91 kB
facebook-react-native/react-dom/cjs/ReactDOMProfiling-dev.js = 1,036.93 kB 1,024.11 kB = 173.85 kB 171.73 kB
facebook-react-native/react-dom/cjs/ReactDOMClient-dev.js = 1,020.60 kB 1,007.79 kB = 171.02 kB 168.88 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js = 118.67 kB 117.15 kB = 22.16 kB 22.03 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js = 117.34 kB 115.82 kB = 21.91 kB 21.78 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js = 116.43 kB 114.91 kB = 22.03 kB 21.89 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js = 116.34 kB 114.82 kB = 21.99 kB 21.85 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js = 114.59 kB 113.07 kB = 21.64 kB 21.50 kB
oss-experimental/react-server-dom-parcel/cjs/react-server-dom-parcel-client.edge.development.js = 113.24 kB 111.72 kB = 21.49 kB 21.35 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.node.development.js = 111.96 kB 110.44 kB = 21.16 kB 21.02 kB
oss-experimental/react-server-dom-parcel/cjs/react-server-dom-parcel-client.node.development.js = 111.44 kB 109.92 kB = 21.13 kB 21.00 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js = 110.10 kB 108.58 kB = 20.91 kB 20.77 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js = 109.54 kB 108.02 kB = 20.78 kB 20.64 kB
oss-experimental/react-client/cjs/react-client-flight.development.js = 109.01 kB 107.49 kB = 20.17 kB 20.00 kB
oss-experimental/react-server-dom-parcel/cjs/react-server-dom-parcel-client.browser.development.js = 107.72 kB 106.20 kB = 20.33 kB 20.19 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js = 107.36 kB 105.84 kB = 20.39 kB 20.24 kB
facebook-react-native/react-dom/cjs/ReactDOMProfiling-profiling.js = 597.18 kB 586.14 kB = 104.23 kB 102.24 kB
facebook-react-native/react-dom/cjs/ReactDOMClient-profiling.js = 591.24 kB 580.20 kB = 103.07 kB 101.08 kB
facebook-react-native/react-dom/cjs/ReactDOMProfiling-prod.js = 568.52 kB 557.48 kB = 100.14 kB 98.19 kB
facebook-react-native/react-dom/cjs/ReactDOMClient-prod.js = 563.02 kB 551.98 kB = 99.05 kB 97.10 kB

Generated by 🚫 dangerJS against 2005386

@sebmarkbage sebmarkbage merged commit 9a52ad9 into facebook:main Apr 30, 2025
245 checks passed
sebmarkbage added a commit that referenced this pull request May 1, 2025
Stacked on #33065.

The runtime is about to be a lot more complicated so we need to start
sharing some more code.

The problem with sharing code is that we want the inline runtime to as
much as possible be isolated in its scope using only a few global
variables to refer across runtimes.

A problem with Closure Compiler is that it refuses to inline functions
if they have closures inside of them. Which makes sense because of how
VMs work it can cause memory leaks. However, in our cases this doesn't
matter and code size matters more. So we can't use many clever tricks.

So this just favors writing the source in the inline form. Then we add
an extra compiler pass to turn those global variables into local
variables in the external runtime.
github-actions bot pushed a commit that referenced this pull request May 1, 2025
Stacked on #33065.

The runtime is about to be a lot more complicated so we need to start
sharing some more code.

The problem with sharing code is that we want the inline runtime to as
much as possible be isolated in its scope using only a few global
variables to refer across runtimes.

A problem with Closure Compiler is that it refuses to inline functions
if they have closures inside of them. Which makes sense because of how
VMs work it can cause memory leaks. However, in our cases this doesn't
matter and code size matters more. So we can't use many clever tricks.

So this just favors writing the source in the inline form. Then we add
an extra compiler pass to turn those global variables into local
variables in the external runtime.

DiffTrain build for [bb57fa7](bb57fa7)
github-actions bot pushed a commit to code/lib-react that referenced this pull request May 1, 2025
Stacked on facebook#33065.

The runtime is about to be a lot more complicated so we need to start
sharing some more code.

The problem with sharing code is that we want the inline runtime to as
much as possible be isolated in its scope using only a few global
variables to refer across runtimes.

A problem with Closure Compiler is that it refuses to inline functions
if they have closures inside of them. Which makes sense because of how
VMs work it can cause memory leaks. However, in our cases this doesn't
matter and code size matters more. So we can't use many clever tricks.

So this just favors writing the source in the inline form. Then we add
an extra compiler pass to turn those global variables into local
variables in the external runtime.

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