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

[Flight Reply] Dedupe Objects and Support Cyclic References #28997

Merged
merged 1 commit into from
May 9, 2024

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented May 6, 2024

Uses the same technique as in #28996 to encode references to already emitted objects. This now means that Reply can support cyclic objects too for parity.

@sebmarkbage sebmarkbage requested a review from gnoff May 6, 2024 02:26
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels May 6, 2024
@react-sizebot
Copy link

react-sizebot commented May 6, 2024

Comparing: 7a78d03...2a83e3e

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.66 kB 6.66 kB = 1.82 kB 1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 495.02 kB 495.02 kB = 88.68 kB 88.68 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.67 kB 6.67 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 499.81 kB 499.81 kB = 89.36 kB 89.36 kB
facebook-www/ReactDOM-prod.classic.js = 592.16 kB 592.16 kB = 104.15 kB 104.15 kB
facebook-www/ReactDOM-prod.modern.js = 568.39 kB 568.39 kB = 100.55 kB 100.55 kB
oss-stable-semver/react-server-dom-esm/esm/react-server-dom-esm-client.browser.production.js +2.61% 46.62 kB 47.84 kB +3.19% 10.87 kB 11.22 kB
oss-stable/react-server-dom-esm/esm/react-server-dom-esm-client.browser.production.js +2.61% 46.62 kB 47.84 kB +3.19% 10.87 kB 11.22 kB
test_utils/ReactAllWarnings.js Deleted 64.26 kB 0.00 kB Deleted 16.02 kB 0.00 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-dom-esm/esm/react-server-dom-esm-client.browser.production.js +2.61% 46.62 kB 47.84 kB +3.19% 10.87 kB 11.22 kB
oss-stable/react-server-dom-esm/esm/react-server-dom-esm-client.browser.production.js +2.61% 46.62 kB 47.84 kB +3.19% 10.87 kB 11.22 kB
oss-stable-semver/react-client/cjs/react-client-flight.development.js +1.93% 63.10 kB 64.32 kB +2.32% 15.29 kB 15.64 kB
oss-stable/react-client/cjs/react-client-flight.development.js +1.93% 63.10 kB 64.32 kB +2.32% 15.29 kB 15.64 kB
oss-stable-semver/react-server-dom-esm/esm/react-server-dom-esm-client.browser.development.js +1.93% 63.11 kB 64.33 kB +2.38% 14.99 kB 15.35 kB
oss-stable/react-server-dom-esm/esm/react-server-dom-esm-client.browser.development.js +1.93% 63.11 kB 64.33 kB +2.38% 14.99 kB 15.35 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js +1.92% 63.35 kB 64.57 kB +2.37% 15.06 kB 15.41 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js +1.92% 63.35 kB 64.57 kB +2.37% 15.06 kB 15.41 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +1.83% 66.60 kB 67.82 kB +2.22% 16.02 kB 16.38 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +1.83% 66.60 kB 67.82 kB +2.22% 16.02 kB 16.38 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +1.81% 67.11 kB 68.33 kB +2.22% 16.19 kB 16.55 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +1.81% 67.11 kB 68.33 kB +2.22% 16.19 kB 16.55 kB
oss-experimental/react-server-dom-esm/esm/react-server-dom-esm-client.browser.production.js +1.73% 70.63 kB 71.84 kB +2.31% 15.09 kB 15.44 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-client.node.development.js +1.71% 71.03 kB 72.25 kB +2.02% 17.09 kB 17.44 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-client.node.development.js +1.71% 71.03 kB 72.25 kB +2.02% 17.09 kB 17.44 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.development.js +1.67% 72.81 kB 74.03 kB +2.02% 17.66 kB 18.01 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.development.js +1.67% 72.81 kB 74.03 kB +2.02% 17.66 kB 18.01 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +1.67% 72.85 kB 74.06 kB +2.01% 17.68 kB 18.04 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +1.67% 72.85 kB 74.06 kB +2.01% 17.68 kB 18.04 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js +1.64% 74.25 kB 75.47 kB +2.01% 18.02 kB 18.39 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js +1.64% 74.25 kB 75.47 kB +2.01% 18.02 kB 18.39 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +1.64% 74.27 kB 75.49 kB +2.03% 18.06 kB 18.43 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +1.64% 74.27 kB 75.49 kB +2.03% 18.06 kB 18.43 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js +1.62% 75.32 kB 76.54 kB +2.01% 18.23 kB 18.60 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js +1.62% 75.32 kB 76.54 kB +2.01% 18.23 kB 18.60 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +1.62% 75.34 kB 76.56 kB +2.00% 18.27 kB 18.64 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +1.62% 75.34 kB 76.56 kB +2.00% 18.27 kB 18.64 kB
oss-experimental/react-client/cjs/react-client-flight.development.js +1.38% 87.97 kB 89.19 kB +1.76% 19.71 kB 20.06 kB
oss-experimental/react-server-dom-esm/esm/react-server-dom-esm-client.browser.development.js +1.38% 87.98 kB 89.20 kB +1.81% 19.42 kB 19.77 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js +1.38% 88.22 kB 89.44 kB +1.80% 19.49 kB 19.84 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +1.33% 91.47 kB 92.69 kB +1.73% 20.46 kB 20.81 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +1.32% 91.98 kB 93.20 kB +1.74% 20.62 kB 20.98 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.node.development.js +1.27% 95.90 kB 97.11 kB +1.58% 21.52 kB 21.86 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.development.js +1.25% 97.68 kB 98.90 kB +1.55% 22.10 kB 22.44 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +1.25% 97.71 kB 98.93 kB +1.55% 22.12 kB 22.46 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js +1.23% 99.12 kB 100.33 kB +1.55% 22.47 kB 22.81 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +1.23% 99.14 kB 100.36 kB +1.55% 22.51 kB 22.86 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js +1.21% 100.19 kB 101.40 kB +1.53% 22.67 kB 23.01 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +1.21% 100.21 kB 101.43 kB +1.53% 22.71 kB 23.05 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-server.node.production.js +1.07% 62.77 kB 63.45 kB +1.17% 14.05 kB 14.21 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-server.node.production.js +1.07% 62.77 kB 63.45 kB +1.17% 14.05 kB 14.21 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +1.02% 63.99 kB 64.64 kB +1.15% 14.06 kB 14.22 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +1.02% 63.99 kB 64.64 kB +1.15% 14.06 kB 14.22 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +1.00% 64.78 kB 65.43 kB +1.10% 14.30 kB 14.45 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +1.00% 64.78 kB 65.43 kB +1.10% 14.30 kB 14.45 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +1.00% 65.07 kB 65.72 kB +1.11% 14.28 kB 14.44 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +1.00% 65.07 kB 65.72 kB +1.11% 14.28 kB 14.44 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.production.js +0.99% 67.58 kB 68.25 kB +1.12% 14.78 kB 14.94 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.production.js +0.99% 67.58 kB 68.25 kB +1.12% 14.78 kB 14.94 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +0.99% 65.52 kB 66.17 kB +1.09% 14.44 kB 14.59 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +0.99% 65.52 kB 66.17 kB +1.09% 14.44 kB 14.59 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +0.98% 68.54 kB 69.21 kB +1.12% 14.99 kB 15.15 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +0.98% 68.54 kB 69.21 kB +1.12% 14.99 kB 15.15 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0.98% 68.67 kB 69.35 kB +1.13% 14.99 kB 15.16 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0.98% 68.67 kB 69.35 kB +1.13% 14.99 kB 15.16 kB
oss-stable-semver/react-client/cjs/react-client-flight.production.js +0.97% 30.77 kB 31.07 kB +2.18% 6.60 kB 6.74 kB
oss-stable/react-client/cjs/react-client-flight.production.js +0.97% 30.77 kB 31.07 kB +2.18% 6.60 kB 6.74 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +0.97% 69.62 kB 70.29 kB +1.10% 15.21 kB 15.38 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +0.97% 69.62 kB 70.29 kB +1.10% 15.21 kB 15.38 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.production.js +0.88% 29.27 kB 29.53 kB +2.25% 6.67 kB 6.82 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.production.js +0.88% 29.27 kB 29.53 kB +2.25% 6.67 kB 6.82 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.production.js +0.84% 30.82 kB 31.08 kB +2.13% 7.05 kB 7.20 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.production.js +0.84% 30.82 kB 31.08 kB +2.13% 7.05 kB 7.20 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js +0.83% 31.15 kB 31.41 kB +2.12% 7.12 kB 7.27 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js +0.83% 31.15 kB 31.41 kB +2.12% 7.12 kB 7.27 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-server.node.production.js +0.81% 84.27 kB 84.95 kB +0.96% 17.37 kB 17.54 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +0.79% 86.26 kB 86.94 kB +0.94% 17.50 kB 17.67 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +0.78% 87.14 kB 87.82 kB +0.90% 17.76 kB 17.92 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +0.78% 87.34 kB 88.02 kB +0.94% 17.73 kB 17.90 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +0.78% 87.87 kB 88.56 kB +0.90% 17.90 kB 18.07 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-client.node.production.js +0.77% 33.46 kB 33.72 kB +1.85% 7.66 kB 7.80 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-client.node.production.js +0.77% 33.46 kB 33.72 kB +1.85% 7.66 kB 7.80 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.production.js +0.77% 89.07 kB 89.75 kB +0.94% 18.11 kB 18.28 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +0.76% 90.03 kB 90.71 kB +0.88% 18.33 kB 18.49 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0.76% 90.17 kB 90.85 kB +0.89% 18.34 kB 18.50 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +0.75% 91.12 kB 91.80 kB +0.87% 18.56 kB 18.72 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.production.js +0.74% 34.71 kB 34.97 kB +1.73% 7.93 kB 8.07 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.production.js +0.74% 34.71 kB 34.97 kB +1.73% 7.93 kB 8.07 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.js +0.74% 34.71 kB 34.97 kB +1.73% 7.94 kB 8.07 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.js +0.74% 34.71 kB 34.97 kB +1.73% 7.94 kB 8.07 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js +0.73% 35.39 kB 35.65 kB +1.74% 8.11 kB 8.25 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js +0.73% 35.39 kB 35.65 kB +1.74% 8.11 kB 8.25 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.production.js +0.73% 35.40 kB 35.66 kB +1.73% 8.10 kB 8.24 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.production.js +0.73% 35.40 kB 35.66 kB +1.73% 8.10 kB 8.24 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js +0.70% 36.63 kB 36.89 kB +1.71% 8.31 kB 8.45 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js +0.70% 36.63 kB 36.89 kB +1.71% 8.31 kB 8.45 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.production.js +0.70% 36.64 kB 36.90 kB +1.72% 8.30 kB 8.44 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.production.js +0.70% 36.64 kB 36.90 kB +1.72% 8.30 kB 8.44 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.65% 124.85 kB 125.66 kB +0.71% 28.88 kB 29.09 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.65% 124.85 kB 125.66 kB +0.71% 28.88 kB 29.09 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.62% 127.60 kB 128.39 kB +0.64% 29.42 kB 29.61 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.62% 127.60 kB 128.39 kB +0.64% 29.42 kB 29.61 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.62% 131.02 kB 131.82 kB +0.65% 29.89 kB 30.08 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.62% 131.02 kB 131.82 kB +0.65% 29.89 kB 30.08 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.61% 128.84 kB 129.63 kB +0.64% 29.70 kB 29.88 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.61% 128.84 kB 129.63 kB +0.64% 29.70 kB 29.88 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.61% 130.04 kB 130.83 kB +0.63% 30.07 kB 30.26 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.61% 130.04 kB 130.83 kB +0.63% 30.07 kB 30.26 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.60% 133.31 kB 134.11 kB +0.64% 30.46 kB 30.66 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.60% 133.31 kB 134.11 kB +0.64% 30.46 kB 30.66 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.60% 130.77 kB 131.56 kB +0.63% 30.19 kB 30.38 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.60% 130.77 kB 131.56 kB +0.63% 30.19 kB 30.38 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.60% 133.66 kB 134.46 kB +0.63% 30.68 kB 30.88 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.60% 133.66 kB 134.46 kB +0.63% 30.68 kB 30.88 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.59% 135.94 kB 136.75 kB +0.60% 31.29 kB 31.48 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.59% 135.94 kB 136.75 kB +0.60% 31.29 kB 31.48 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.48% 166.62 kB 167.43 kB +0.55% 36.59 kB 36.79 kB
oss-experimental/react-client/cjs/react-client-flight.production.js +0.48% 46.43 kB 46.65 kB +1.52% 8.95 kB 9.09 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.47% 170.26 kB 171.07 kB +0.53% 37.24 kB 37.43 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.47% 172.18 kB 172.99 kB +0.52% 37.75 kB 37.95 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.47% 172.71 kB 173.52 kB +0.53% 37.91 kB 38.11 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.47% 172.78 kB 173.59 kB +0.57% 37.57 kB 37.78 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.46% 174.11 kB 174.92 kB +0.52% 38.27 kB 38.47 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.46% 175.07 kB 175.88 kB +0.53% 38.19 kB 38.39 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.46% 175.42 kB 176.23 kB +0.50% 38.41 kB 38.60 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.45% 177.70 kB 178.51 kB +0.49% 39.03 kB 39.22 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.production.js +0.41% 43.70 kB 43.88 kB +1.57% 9.03 kB 9.17 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.production.js +0.40% 45.25 kB 45.43 kB +1.47% 9.39 kB 9.53 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js +0.40% 45.58 kB 45.76 kB +1.49% 9.48 kB 9.62 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.node.production.js +0.38% 48.09 kB 48.27 kB +1.38% 10.06 kB 10.20 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.production.js +0.37% 49.34 kB 49.52 kB +1.33% 10.34 kB 10.48 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.js +0.37% 49.34 kB 49.52 kB +1.36% 10.34 kB 10.48 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js +0.36% 50.02 kB 50.20 kB +1.32% 10.51 kB 10.65 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.production.js +0.36% 50.03 kB 50.21 kB +1.33% 10.50 kB 10.64 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js +0.35% 51.05 kB 51.24 kB +1.27% 10.71 kB 10.84 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.production.js +0.35% 51.07 kB 51.25 kB +1.29% 10.70 kB 10.83 kB
test_utils/ReactAllWarnings.js Deleted 64.26 kB 0.00 kB Deleted 16.02 kB 0.00 kB

Generated by 🚫 dangerJS against 2a83e3e

Supports cyclic objects.
@sebmarkbage sebmarkbage merged commit 38d9f15 into facebook:main May 9, 2024
38 checks passed
sebmarkbage added a commit that referenced this pull request May 10, 2024
…9010)

Stacked on #28997.

We can use the technique of referencing an object by its row + property
name path for temporary references - like we do for deduping. That way
we don't need to generate an ID for temporary references. Instead, they
can just be an opaque marker in the slot and it has the implicit ID of
the row + path.

Then we can stash all objects, even the ones that are actually available
to read on the server, as temporary references. Without adding anything
to the payload since the IDs are implicit. If the same object is
returned to the client, it can be referenced by reference instead of
serializing it back to the client. This also helps preserve object
identity.

We assume that the objects are immutable when they pass the boundary.

I'm not sure if this is worth it but with this mechanism, if you return
the `FormData` payload from a `useActionState` it doesn't have to be
serialized on the way back to the client. This is a common pattern for
having access to the last submission as "default value" to the form
fields. However you can still control it by replacing it with another
object if you want. In MPA mode, the temporary references are not
configured and so it needs to be serialized in that case. That's
required anyway for hydration purposes.

I'm not sure if people will actually use this in practice though or if
FormData will always be destructured into some other object like with a
library that turns it into typed data, and back. If so, the object
identity is lost.
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