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] Update stale blocked values in createModelResolver #28669

Merged
merged 6 commits into from
Apr 1, 2024

Conversation

unstubbable
Copy link
Collaborator

@unstubbable unstubbable commented Mar 29, 2024

Alternative to #28620.

Instead of emitting lazy references to not-yet-emitted models in the Flight Server, this fixes the observed issue in unstubbable/ai-rsc-test#1 by adjusting the lazy model resolution in the Flight Client to update stale blocked root models, before assigning them as chunk values. In addition, the element props are not outlined anymore in the Flight Server to avoid having to also handle their staleness in blocked elements.

fixes #28595

@react-sizebot
Copy link

react-sizebot commented Mar 29, 2024

Comparing: f269074...32c5b0b

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.min.js = 177.00 kB 177.00 kB = 55.02 kB 55.01 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 173.10 kB 173.10 kB = 53.96 kB 53.95 kB
facebook-www/ReactDOM-prod.classic.js = 592.91 kB 592.91 kB = 104.01 kB 104.01 kB
facebook-www/ReactDOM-prod.modern.js = 574.60 kB 574.60 kB = 101.03 kB 101.03 kB
test_utils/ReactAllWarnings.js Deleted 65.05 kB 0.00 kB Deleted 16.26 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
facebook-www/ReactFlightDOMClient-dev.modern.js +0.59% 40.98 kB 41.22 kB +0.87% 9.53 kB 9.61 kB
oss-stable-semver/react-server-dom-esm/esm/react-server-dom-esm-client.browser.production.min.js +0.51% 44.86 kB 45.09 kB +0.71% 10.60 kB 10.67 kB
oss-stable/react-server-dom-esm/esm/react-server-dom-esm-client.browser.production.min.js +0.51% 44.86 kB 45.09 kB +0.71% 10.60 kB 10.67 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.production.js +0.50% 45.02 kB 45.24 kB +0.72% 10.63 kB 10.71 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.production.js +0.50% 45.02 kB 45.24 kB +0.72% 10.63 kB 10.71 kB
oss-stable-semver/react-client/cjs/react-client-flight.production.js +0.50% 45.10 kB 45.33 kB +0.64% 11.01 kB 11.08 kB
oss-stable/react-client/cjs/react-client-flight.production.js +0.50% 45.10 kB 45.33 kB +0.64% 11.01 kB 11.08 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.production.js +0.47% 48.27 kB 48.50 kB +0.67% 11.57 kB 11.64 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.production.js +0.47% 48.27 kB 48.50 kB +0.67% 11.57 kB 11.64 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js +0.47% 48.79 kB 49.02 kB +0.67% 11.73 kB 11.81 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js +0.47% 48.79 kB 49.02 kB +0.67% 11.73 kB 11.81 kB
oss-experimental/react-server-dom-esm/esm/react-server-dom-esm-client.browser.production.min.js +0.45% 49.95 kB 50.18 kB +0.72% 11.59 kB 11.68 kB
oss-experimental/react-client/cjs/react-client-flight.production.js +0.45% 50.10 kB 50.32 kB +0.58% 12.00 kB 12.07 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.production.js +0.45% 50.11 kB 50.33 kB +0.73% 11.62 kB 11.71 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-client.node.production.js +0.44% 52.10 kB 52.33 kB +0.60% 12.42 kB 12.50 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-client.node.production.js +0.44% 52.10 kB 52.33 kB +0.60% 12.42 kB 12.50 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.production.js +0.43% 53.36 kB 53.59 kB +0.69% 12.56 kB 12.64 kB
oss-stable-semver/react-server/cjs/react-server-flight.production.js +0.42% 59.30 kB 59.55 kB +0.45% 14.46 kB 14.52 kB
oss-stable/react-server/cjs/react-server-flight.production.js +0.42% 59.30 kB 59.55 kB +0.45% 14.46 kB 14.52 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js +0.42% 53.88 kB 54.11 kB +0.67% 12.72 kB 12.81 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.production.js +0.42% 53.89 kB 54.11 kB +0.58% 12.97 kB 13.05 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.production.js +0.42% 53.89 kB 54.11 kB +0.58% 12.97 kB 13.05 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.js +0.42% 53.92 kB 54.15 kB +0.58% 13.00 kB 13.07 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.js +0.42% 53.92 kB 54.15 kB +0.58% 13.00 kB 13.07 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.production.js +0.41% 55.32 kB 55.55 kB +0.55% 13.35 kB 13.42 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.production.js +0.41% 55.32 kB 55.55 kB +0.55% 13.35 kB 13.42 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js +0.41% 55.35 kB 55.58 kB +0.56% 13.39 kB 13.47 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js +0.41% 55.35 kB 55.58 kB +0.56% 13.39 kB 13.47 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.production.js +0.40% 56.43 kB 56.66 kB +0.58% 13.56 kB 13.64 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.production.js +0.40% 56.43 kB 56.66 kB +0.58% 13.56 kB 13.64 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js +0.40% 56.46 kB 56.69 kB +0.58% 13.61 kB 13.68 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js +0.40% 56.46 kB 56.69 kB +0.58% 13.61 kB 13.68 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.node.production.js +0.40% 57.19 kB 57.42 kB +0.54% 13.43 kB 13.50 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.production.js +0.38% 58.98 kB 59.20 kB +0.53% 13.98 kB 14.05 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.js +0.38% 59.01 kB 59.24 kB +0.54% 14.00 kB 14.08 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.production.js +0.38% 60.41 kB 60.64 kB +0.52% 14.35 kB 14.43 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js +0.38% 60.44 kB 60.67 kB +0.52% 14.39 kB 14.47 kB
oss-stable-semver/react-server-dom-esm/esm/react-server-dom-esm-client.browser.development.js +0.37% 61.26 kB 61.49 kB +0.51% 14.65 kB 14.73 kB
oss-stable/react-server-dom-esm/esm/react-server-dom-esm-client.browser.development.js +0.37% 61.26 kB 61.49 kB +0.51% 14.65 kB 14.73 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js +0.37% 61.50 kB 61.73 kB +0.52% 14.72 kB 14.80 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js +0.37% 61.50 kB 61.73 kB +0.52% 14.72 kB 14.80 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.production.js +0.37% 61.52 kB 61.75 kB +0.51% 14.56 kB 14.63 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js +0.37% 61.55 kB 61.78 kB +0.51% 14.60 kB 14.68 kB
oss-stable-semver/react-client/cjs/react-client-flight.development.js +0.37% 61.58 kB 61.81 kB +0.51% 14.97 kB 15.05 kB
oss-stable/react-client/cjs/react-client-flight.development.js +0.37% 61.58 kB 61.81 kB +0.51% 14.97 kB 15.05 kB
oss-experimental/react-server/cjs/react-server-flight.production.js +0.36% 69.23 kB 69.48 kB +0.42% 16.55 kB 16.62 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +0.35% 64.75 kB 64.98 kB +0.49% 15.69 kB 15.76 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +0.35% 64.75 kB 64.98 kB +0.49% 15.69 kB 15.76 kB
facebook-www/ReactFlightDOMClient-prod.modern.js +0.35% 19.74 kB 19.81 kB +0.42% 4.73 kB 4.75 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +0.35% 65.26 kB 65.49 kB +0.49% 15.86 kB 15.94 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +0.35% 65.26 kB 65.49 kB +0.49% 15.86 kB 15.94 kB
oss-stable-semver/react-server/cjs/react-server-flight.development.js +0.34% 72.35 kB 72.60 kB +0.38% 17.23 kB 17.29 kB
oss-stable/react-server/cjs/react-server-flight.development.js +0.34% 72.35 kB 72.60 kB +0.38% 17.23 kB 17.29 kB
oss-experimental/react-server-dom-esm/esm/react-server-dom-esm-client.browser.development.js +0.34% 66.30 kB 66.53 kB +0.49% 15.63 kB 15.71 kB
oss-stable-semver/react-server-dom-turbopack/umd/react-server-dom-turbopack-client.browser.development.js +0.34% 68.71 kB 68.95 kB +0.48% 15.93 kB 16.00 kB
oss-stable/react-server-dom-turbopack/umd/react-server-dom-turbopack-client.browser.development.js +0.34% 68.71 kB 68.95 kB +0.48% 15.93 kB 16.00 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js +0.34% 66.54 kB 66.77 kB +0.49% 15.70 kB 15.78 kB
oss-experimental/react-client/cjs/react-client-flight.development.js +0.34% 66.62 kB 66.85 kB +0.50% 15.95 kB 16.03 kB
oss-stable-semver/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.development.js +0.34% 69.25 kB 69.49 kB +0.47% 16.11 kB 16.19 kB
oss-stable/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.development.js +0.34% 69.25 kB 69.49 kB +0.47% 16.11 kB 16.19 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-client.node.development.js +0.33% 69.20 kB 69.43 kB +0.47% 16.73 kB 16.81 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-client.node.development.js +0.33% 69.20 kB 69.43 kB +0.47% 16.73 kB 16.81 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +0.33% 69.79 kB 70.02 kB +0.46% 16.66 kB 16.74 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +0.32% 70.30 kB 70.53 kB +0.46% 16.84 kB 16.91 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.development.js +0.32% 70.99 kB 71.21 kB +0.47% 17.30 kB 17.39 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.development.js +0.32% 70.99 kB 71.21 kB +0.47% 17.30 kB 17.39 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +0.32% 71.02 kB 71.25 kB +0.47% 17.33 kB 17.41 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +0.32% 71.02 kB 71.25 kB +0.47% 17.33 kB 17.41 kB
oss-stable-semver/react-client/cjs/react-client-flight.production.min.js +0.32% 11.27 kB 11.30 kB +0.31% 4.16 kB 4.18 kB
oss-stable/react-client/cjs/react-client-flight.production.min.js +0.32% 11.27 kB 11.30 kB +0.31% 4.16 kB 4.18 kB
oss-experimental/react-server-dom-turbopack/umd/react-server-dom-turbopack-client.browser.development.js +0.32% 74.07 kB 74.30 kB +0.46% 16.93 kB 17.01 kB
oss-experimental/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.development.js +0.31% 74.61 kB 74.85 kB +0.46% 17.11 kB 17.19 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js +0.31% 72.42 kB 72.65 kB +0.46% 17.67 kB 17.75 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js +0.31% 72.42 kB 72.65 kB +0.46% 17.67 kB 17.75 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +0.31% 72.45 kB 72.68 kB +0.46% 17.71 kB 17.79 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +0.31% 72.45 kB 72.68 kB +0.46% 17.71 kB 17.79 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js +0.31% 73.49 kB 73.72 kB +0.46% 17.88 kB 17.96 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js +0.31% 73.49 kB 73.72 kB +0.46% 17.88 kB 17.96 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +0.31% 73.52 kB 73.75 kB +0.45% 17.92 kB 18.00 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +0.31% 73.52 kB 73.75 kB +0.45% 17.92 kB 18.00 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.node.development.js +0.31% 74.24 kB 74.47 kB +0.42% 17.71 kB 17.79 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.production.min.js +0.30% 12.02 kB 12.06 kB +0.36% 4.41 kB 4.43 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.production.min.js +0.30% 12.02 kB 12.06 kB +0.36% 4.41 kB 4.43 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.development.js +0.30% 76.03 kB 76.25 kB +0.41% 18.29 kB 18.36 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +0.30% 76.06 kB 76.29 kB +0.41% 18.31 kB 18.39 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js +0.29% 77.46 kB 77.69 kB +0.40% 18.65 kB 18.73 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +0.29% 77.49 kB 77.71 kB +0.41% 18.69 kB 18.77 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js +0.29% 78.53 kB 78.76 kB +0.40% 18.86 kB 18.94 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +0.29% 78.56 kB 78.78 kB +0.40% 18.91 kB 18.98 kB
oss-experimental/react-client/cjs/react-client-flight.production.min.js +0.29% 12.46 kB 12.50 kB +0.31% 4.51 kB 4.52 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.production.min.js +0.28% 12.69 kB 12.73 kB +0.34% 4.69 kB 4.70 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.production.min.js +0.28% 12.69 kB 12.73 kB +0.34% 4.69 kB 4.70 kB
facebook-www/ReactFlightDOMServer-prod.modern.js +0.28% 39.51 kB 39.62 kB +0.30% 8.98 kB 9.01 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.min.js +0.28% 12.82 kB 12.85 kB +0.34% 4.73 kB 4.74 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.min.js +0.28% 12.82 kB 12.85 kB +0.34% 4.73 kB 4.74 kB
oss-stable-semver/react-server-dom-turbopack/umd/react-server-dom-turbopack-client.browser.production.min.js +0.28% 12.88 kB 12.92 kB +0.36% 4.78 kB 4.80 kB
oss-stable/react-server-dom-turbopack/umd/react-server-dom-turbopack-client.browser.production.min.js +0.28% 12.88 kB 12.92 kB +0.36% 4.78 kB 4.80 kB
oss-stable-semver/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.production.min.js +0.28% 13.00 kB 13.04 kB +0.42% 4.81 kB 4.83 kB
oss-stable/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.production.min.js +0.28% 13.00 kB 13.04 kB +0.42% 4.81 kB 4.83 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.production.min.js +0.27% 13.33 kB 13.37 kB +0.29% 4.77 kB 4.79 kB
oss-experimental/react-server/cjs/react-server-flight.development.js +0.26% 93.16 kB 93.41 kB +0.47% 21.15 kB 21.25 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-server.node.production.js +0.26% 95.48 kB 95.73 kB +0.30% 22.63 kB 22.70 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-server.node.production.js +0.26% 95.48 kB 95.73 kB +0.30% 22.63 kB 22.70 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.production.min.js +0.26% 14.01 kB 14.04 kB +0.30% 5.04 kB 5.06 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.min.js +0.25% 14.13 kB 14.16 kB +0.30% 5.08 kB 5.10 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-client.node.production.min.js +0.25% 14.13 kB 14.17 kB +0.22% 5.11 kB 5.12 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-client.node.production.min.js +0.25% 14.13 kB 14.17 kB +0.22% 5.11 kB 5.12 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +0.25% 98.16 kB 98.41 kB +0.31% 23.21 kB 23.28 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +0.25% 98.16 kB 98.41 kB +0.31% 23.21 kB 23.28 kB
oss-experimental/react-server-dom-turbopack/umd/react-server-dom-turbopack-client.browser.production.min.js +0.25% 14.19 kB 14.23 kB +0.33% 5.14 kB 5.16 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +0.25% 99.00 kB 99.25 kB +0.29% 23.44 kB 23.50 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +0.25% 99.00 kB 99.25 kB +0.29% 23.44 kB 23.50 kB
oss-experimental/react-server-dom-webpack/umd/react-server-dom-webpack-client.browser.production.min.js +0.25% 14.31 kB 14.35 kB +0.33% 5.17 kB 5.19 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +0.25% 100.41 kB 100.66 kB +0.29% 23.81 kB 23.88 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +0.25% 100.41 kB 100.66 kB +0.29% 23.81 kB 23.88 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +0.25% 100.73 kB 100.98 kB +0.29% 23.87 kB 23.94 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +0.25% 100.73 kB 100.98 kB +0.29% 23.87 kB 23.94 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js +0.25% 14.53 kB 14.56 kB +0.23% 5.28 kB 5.29 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js +0.25% 14.53 kB 14.56 kB +0.23% 5.28 kB 5.29 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.production.min.js +0.25% 14.53 kB 14.57 kB +0.23% 5.28 kB 5.29 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.production.min.js +0.25% 14.53 kB 14.57 kB +0.23% 5.28 kB 5.29 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.production.js +0.25% 101.63 kB 101.88 kB +0.28% 23.61 kB 23.68 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.production.js +0.25% 101.63 kB 101.88 kB +0.28% 23.61 kB 23.68 kB
facebook-www/ReactFlightDOMServer-dev.modern.js +0.24% 101.48 kB 101.73 kB +0.34% 21.15 kB 21.22 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.production.min.js +0.24% 14.84 kB 14.88 kB +0.22% 5.40 kB 5.41 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.production.min.js +0.24% 14.84 kB 14.88 kB +0.22% 5.40 kB 5.41 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.min.js +0.24% 14.85 kB 14.89 kB +0.22% 5.41 kB 5.42 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.min.js +0.24% 14.85 kB 14.89 kB +0.22% 5.41 kB 5.42 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0.24% 103.71 kB 103.96 kB +0.28% 24.11 kB 24.17 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0.24% 103.71 kB 103.96 kB +0.28% 24.11 kB 24.17 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +0.24% 104.29 kB 104.54 kB +0.29% 24.45 kB 24.52 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +0.24% 104.29 kB 104.54 kB +0.29% 24.45 kB 24.52 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-server.node.production.js +0.24% 105.64 kB 105.89 kB +0.28% 24.80 kB 24.87 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.production.min.js +0.24% 15.29 kB 15.33 kB +0.25% 5.52 kB 5.53 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.production.min.js +0.24% 15.29 kB 15.33 kB +0.25% 5.52 kB 5.53 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.min.js +0.24% 15.30 kB 15.34 kB +0.27% 5.53 kB 5.55 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.min.js +0.24% 15.30 kB 15.34 kB +0.27% 5.53 kB 5.55 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +0.24% 106.36 kB 106.61 kB +0.28% 24.99 kB 25.07 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +0.24% 106.36 kB 106.61 kB +0.28% 24.99 kB 25.07 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.node.production.min.js +0.23% 15.46 kB 15.49 kB +0.20% 5.47 kB 5.48 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +0.23% 108.77 kB 109.02 kB +0.31% 25.56 kB 25.64 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +0.23% 109.61 kB 109.86 kB +0.27% 25.80 kB 25.87 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.23% 108.78 kB 109.03 kB +0.25% 25.47 kB 25.54 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.23% 108.78 kB 109.03 kB +0.25% 25.47 kB 25.54 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.min.js +0.23% 15.85 kB 15.89 kB +0.23% 5.65 kB 5.66 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.production.min.js +0.23% 15.86 kB 15.89 kB +0.23% 5.65 kB 5.66 kB
oss-stable-semver/react-server/cjs/react-server-flight.production.min.js +0.23% 16.34 kB 16.38 kB +0.45% 6.06 kB 6.08 kB
oss-stable/react-server/cjs/react-server-flight.production.min.js +0.23% 16.34 kB 16.38 kB +0.45% 6.06 kB 6.08 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +0.23% 111.02 kB 111.27 kB +0.29% 26.17 kB 26.24 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +0.22% 111.34 kB 111.59 kB +0.25% 26.24 kB 26.31 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.production.js +0.22% 111.79 kB 112.04 kB +0.26% 25.81 kB 25.87 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.production.min.js +0.22% 16.17 kB 16.20 kB +0.21% 5.75 kB 5.77 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.min.js +0.22% 16.17 kB 16.21 kB +0.21% 5.77 kB 5.78 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.22% 111.69 kB 111.94 kB +0.25% 26.06 kB 26.12 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.22% 111.69 kB 111.94 kB +0.25% 26.06 kB 26.12 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.22% 112.58 kB 112.83 kB +0.28% 26.29 kB 26.36 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.22% 112.58 kB 112.83 kB +0.28% 26.29 kB 26.36 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +0.22% 113.86 kB 114.11 kB +0.25% 26.30 kB 26.37 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +0.22% 114.45 kB 114.70 kB +0.26% 26.64 kB 26.71 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.22% 114.14 kB 114.39 kB +0.24% 26.73 kB 26.79 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.22% 114.14 kB 114.39 kB +0.24% 26.73 kB 26.79 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.production.min.js +0.22% 16.61 kB 16.65 kB +0.24% 5.88 kB 5.89 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.min.js +0.22% 16.62 kB 16.65 kB +0.20% 5.89 kB 5.90 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.22% 114.51 kB 114.76 kB +0.28% 26.79 kB 26.87 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.22% 114.51 kB 114.76 kB +0.28% 26.79 kB 26.87 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.22% 114.94 kB 115.19 kB +0.23% 26.44 kB 26.50 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.22% 114.94 kB 115.19 kB +0.23% 26.44 kB 26.50 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +0.21% 116.52 kB 116.77 kB +0.25% 27.19 kB 27.26 kB
oss-stable-semver/react-server-dom-turbopack/umd/react-server-dom-turbopack-server.browser.development.js +0.21% 117.89 kB 118.14 kB +0.29% 26.38 kB 26.46 kB
oss-stable/react-server-dom-turbopack/umd/react-server-dom-turbopack-server.browser.development.js +0.21% 117.89 kB 118.14 kB +0.29% 26.38 kB 26.46 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.21% 117.23 kB 117.48 kB +0.23% 27.00 kB 27.06 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.21% 117.23 kB 117.48 kB +0.23% 27.00 kB 27.06 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.21% 117.58 kB 117.83 kB +0.22% 27.28 kB 27.34 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.21% 117.58 kB 117.83 kB +0.22% 27.28 kB 27.34 kB
oss-stable-semver/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js +0.21% 120.46 kB 120.71 kB +0.24% 27.07 kB 27.13 kB
oss-stable/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js +0.21% 120.46 kB 120.71 kB +0.24% 27.07 kB 27.13 kB
oss-experimental/react-server/cjs/react-server-flight.production.min.js +0.21% 18.80 kB 18.83 kB +0.45% 6.72 kB 6.75 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.21% 119.87 kB 120.11 kB +0.25% 27.89 kB 27.96 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.21% 119.87 kB 120.11 kB +0.25% 27.89 kB 27.96 kB
test_utils/ReactAllWarnings.js Deleted 65.05 kB 0.00 kB Deleted 16.26 kB 0.00 kB

Generated by 🚫 dangerJS against 32c5b0b

The added test, intended to fail and reproduce the [reported
issue](facebook#28595), unexpectedly
passes in its current state. I see three possible reasons:

1. The bug report could be invalid.
2. How I've structured the test might be insufficient to replicate what
   `ai/rsc` is doing.
3. Something in the test setup could be masking the actual error.
   (Maybe related to fake timers?)

If the problem lies in reason 2 or 3, this test could possibly serve as
a foundation for further investigation.

// If this is the root object for a model reference, where `blocked.value`
// is a stale `null`, the resolved value can be used directly.
if (key === '' && blocked.value === null) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is clever. I think this hold true because if the root is blocked, there can't be any other objects that are also blocked. At least for now. Might not hold in the future but should be ok for now at least.

// were resolved (4th item, key '3'), the props of `blocked.value` must be
// updated.
if (
Array.isArray(parentObject) &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is an interesting observation. For any parentObject where we later might replace it with another object, this problem occurs. I guess that can really just be React Elements for now.

https://github.com/facebook/react/blob/main/packages/react-client/src/ReactFlightClient.js#L1440-L1442

It seems like in principle it could happen to any of the keys inside of it though. Not just the props.

Also, it seems like in theory it should be able to happen even even if the element is not at the root. I think it's problematic to assume that if the parent object is representing the object that's blocked at the root. If the blocked object is an element that itself has further objects below which itself happens to have an array as the parent object then this would incorrectly match that case. So this doesn't seem safe.

At first, I was confused how this could happen but it's really an artifact of the other problem that the props get outlined separately from the element because when we start outlining an object we've seen everything inside of it before which causes us to outline everything inside of it too which is inefficient because we might not ever see them again outside of this particular object. Which happens to props and elements.

This should ideally have some more clever strategy.

However, one thing we could do is mark props objects inside elements in the outlining as never outlined. E.g. give it id -2 or something. That way they're never outline independently from the element that they're apart of. That way this particular scenario doesn't happen. (Although ideally the parser would be resilient to it.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I like the idea of not outlining the props. The condition for updating them in the blocked element felt brittle to me. I've implemented the suggested change in 7d5ad2e.

Copy link
Collaborator Author

@unstubbable unstubbable Mar 30, 2024

Choose a reason for hiding this comment

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

What this doesn't do (yet), is prevent the objects inside of the props from being outlined. Is this something you would want to see being done too? To fix the issue, this wouldn't be needed. It might maybe be useful to keep outlining them when the same object is passed to different elements as part of the props. Although it would of course be even better to detect exactly this case, and only then outline them. Not sure if we want to add more complexity for this though.

This avoids having to handle stale blocked elements (with `null` props)
in the Flight Client.
Because of the `$$typeof` check above, we know that this is a react
element.
@unstubbable unstubbable requested a review from sebmarkbage March 30, 2024 18:36
@sebmarkbage
Copy link
Collaborator

This is a good start so I'll merge the fix. I think ideally we'd have three things:

  1. Ideally we'd have some way to not outline any object that's inside another outlined object, until they appear again as the "root" or in another tree. E.g. while writing an outlined tree, we don't outline again. However, in theory this doesn't guarantee that props don't get outlined.
  2. We should ideally fix the client parsing too so that outlined props (or types) in elements don't break the parsing if they end up outlined - somehow.
  3. Ideally we should mark deduped elements as lazy when they're not yet resolved like your first PR did but perhaps with another algorithm.

@sebmarkbage sebmarkbage merged commit 93f9179 into facebook:main Apr 1, 2024
38 checks passed
github-actions bot pushed a commit that referenced this pull request Apr 1, 2024
Alternative to #28620.

Instead of emitting lazy references to not-yet-emitted models in the
Flight Server, this fixes the observed issue in
unstubbable/ai-rsc-test#1 by adjusting the lazy
model resolution in the Flight Client to update stale blocked root
models, before assigning them as chunk values. In addition, the element
props are not outlined anymore in the Flight Server to avoid having to
also handle their staleness in blocked elements.

fixes #28595

DiffTrain build for [93f9179](93f9179)
@unstubbable unstubbable deleted the fix-28595-client-3 branch April 2, 2024 08:08
unstubbable added a commit to unstubbable/mfng-ai-demo that referenced this pull request Apr 4, 2024
sebmarkbage added a commit that referenced this pull request Apr 8, 2024
We used to assume that outlined models are emitted before the reference
(which was true before Blobs). However, it still wasn't safe to assume
that all the data will be available because an "import" (client
reference) can be async and therefore if it's directly a child of an
outlined model, it won't be able to update in place.

This is a similar problem as the one hit by @unstubbable in #28669 with
elements, but a little different since these don't follow the same way
of wrapping.

I don't love the structuring of this code which now needs to pass a
first class mapper instead of just being known code. It also shares the
host path which is just an identity function. It wouldn't necessarily
pass my own review but I don't have a better one for now. I'd really
prefer if this was done at a "row" level but that ends up creating even
more code.

Add test for Blob in FormData and async modules in Maps.
github-actions bot pushed a commit that referenced this pull request Apr 8, 2024
We used to assume that outlined models are emitted before the reference
(which was true before Blobs). However, it still wasn't safe to assume
that all the data will be available because an "import" (client
reference) can be async and therefore if it's directly a child of an
outlined model, it won't be able to update in place.

This is a similar problem as the one hit by @unstubbable in #28669 with
elements, but a little different since these don't follow the same way
of wrapping.

I don't love the structuring of this code which now needs to pass a
first class mapper instead of just being known code. It also shares the
host path which is just an identity function. It wouldn't necessarily
pass my own review but I don't have a better one for now. I'd really
prefer if this was done at a "row" level but that ends up creating even
more code.

Add test for Blob in FormData and async modules in Maps.

DiffTrain build for [14f50ad](14f50ad)
rickhanlonii pushed a commit that referenced this pull request Apr 11, 2024
We used to assume that outlined models are emitted before the reference
(which was true before Blobs). However, it still wasn't safe to assume
that all the data will be available because an "import" (client
reference) can be async and therefore if it's directly a child of an
outlined model, it won't be able to update in place.

This is a similar problem as the one hit by @unstubbable in #28669 with
elements, but a little different since these don't follow the same way
of wrapping.

I don't love the structuring of this code which now needs to pass a
first class mapper instead of just being known code. It also shares the
host path which is just an identity function. It wouldn't necessarily
pass my own review but I don't have a better one for now. I'd really
prefer if this was done at a "row" level but that ends up creating even
more code.

Add test for Blob in FormData and async modules in Maps.
rickhanlonii pushed a commit that referenced this pull request Apr 11, 2024
We used to assume that outlined models are emitted before the reference
(which was true before Blobs). However, it still wasn't safe to assume
that all the data will be available because an "import" (client
reference) can be async and therefore if it's directly a child of an
outlined model, it won't be able to update in place.

This is a similar problem as the one hit by @unstubbable in #28669 with
elements, but a little different since these don't follow the same way
of wrapping.

I don't love the structuring of this code which now needs to pass a
first class mapper instead of just being known code. It also shares the
host path which is just an identity function. It wouldn't necessarily
pass my own review but I don't have a better one for now. I'd really
prefer if this was done at a "row" level but that ends up creating even
more code.

Add test for Blob in FormData and async modules in Maps.
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
…ok#28669)

Alternative to facebook#28620.

Instead of emitting lazy references to not-yet-emitted models in the
Flight Server, this fixes the observed issue in
unstubbable/ai-rsc-test#1 by adjusting the lazy
model resolution in the Flight Client to update stale blocked root
models, before assigning them as chunk values. In addition, the element
props are not outlined anymore in the Flight Server to avoid having to
also handle their staleness in blocked elements.

fixes facebook#28595
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
We used to assume that outlined models are emitted before the reference
(which was true before Blobs). However, it still wasn't safe to assume
that all the data will be available because an "import" (client
reference) can be async and therefore if it's directly a child of an
outlined model, it won't be able to update in place.

This is a similar problem as the one hit by @unstubbable in facebook#28669 with
elements, but a little different since these don't follow the same way
of wrapping.

I don't love the structuring of this code which now needs to pass a
first class mapper instead of just being known code. It also shares the
host path which is just an identity function. It wouldn't necessarily
pass my own review but I don't have a better one for now. I'd really
prefer if this was done at a "row" level but that ends up creating even
more code.

Add test for Blob in FormData and async modules in Maps.
ztanner added a commit to vercel/next.js that referenced this pull request Apr 17, 2024
…64271)

### What
When rendering a parallel slot multiple times in a single layout, in
conjunction with using an error boundary, the following TypeError is
thrown:

> Cannot destructure property 'parallelRouterKey' of 'param' as it is
null

### Why
I'm not 100% sure of the reason, but I believe this is because of how
React attempts to dededupe (more specifically, "detriplficate") objects
that it sees getting passed across the RSC -> client component boundary
(and an error boundary is necessarily a client component). When React
sees the same object twice, it'll create a reference to that object and
then use that reference in future places where it sees the object. My
assumption is that there's a bug somewhere here, as the `LayoutRouter`
component for the subsequent duplicated parallel slots (after the first
one) have no props, hence the TypeError.

### How
Rather than passing the error component as a prop to `LayoutRouter`,
this puts it as part of the `CacheNodeSeedData` data structure. This is
more aligned with other properties anyway (such as `loading` and `rsc`
for each segment), and seems to work around this bug as the
`initialSeedData` prop is only passed from RSC->client once.

EDIT: Confirmed this is also fixed after syncing the latest React, due
to facebook/react#28669

Fixes #58485
Closes NEXT-2095
unstubbable added a commit to unstubbable/react that referenced this pull request Jul 30, 2024
When an element is used multiple times as shown in facebook#30526, its props
might be deduped. When resolving the reference to the deduped props, we
were only updating the React element tuple, which at this point has
already been parsed into a React element object, using `null` as
placeholder props. Therefore, updating the element tuple doesn't help
much, and we need to make sure that the element object's props are
updated as well.

This is a similar fix as facebook#28669, see the code lines above, and thus
feels similarly hacky. Maybe there's a better way to fix this? @eps1lon
was mentioning offline that solving [this
TODO](https://github.com/facebook/react/blob/33e54fa252b9dbe7553ef42a2287c3dbbd4f035d/packages/react-client/src/ReactFlightClient.js#L1327)
would probably fix it properly, since we wouldn't need to deal with
stale tuples then. But that's a way heavier lift.
unstubbable added a commit to unstubbable/react that referenced this pull request Jul 30, 2024
When an element is used multiple times as shown in facebook#30526, its props
might be deduped. When resolving the reference to the deduped props, we
were only updating the React element tuple, which at this point has
already been parsed into a React element object, using `null` as
placeholder props. Therefore, updating the element tuple doesn't help
much, and we need to make sure that the element object's props are
updated as well.

This is a similar fix as facebook#28669, see the code lines above, and thus
feels similarly hacky. Maybe there's a better way to fix this? @eps1lon
was mentioning offline that solving [this
TODO](https://github.com/facebook/react/blob/33e54fa252b9dbe7553ef42a2287c3dbbd4f035d/packages/react-client/src/ReactFlightClient.js#L1327)
would probably fix it properly, since we wouldn't need to deal with
stale tuples then. But that's a way heavier lift.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: [Flight] Async server components in ai/rsc not rendered correctly
4 participants