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

experimental_use(promise) #25084

Merged
merged 5 commits into from
Aug 25, 2022
Merged

experimental_use(promise) #25084

merged 5 commits into from
Aug 25, 2022

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Aug 11, 2022

Adds experimental support to Fiber for unwrapping the value of a promise inside a component. It is not yet implemented for Server Components, but that is planned.

If promise has already resolved, the value can be unwrapped "immediately" without showing a fallback. The trick we use to implement this is to yield to the main thread (literally suspending the work loop), wait for the microtask queue to drain, then check if the promise resolved in the meantime. If so, we can resume the last attempted fiber without unwinding the stack. This functionality was implemented in previous commits.

Another feature is that the promises do not need to be cached between attempts. Because we assume idempotent execution of components, React will track the promises that were used during the previous attempt and reuse the result. You shouldn't rely on this property, but during initial render it mostly just works. Updates are trickier, though, because if you used an uncached promise, we have no way of knowing whether the underlying data has changed, so we have to unwrap the promise every time. It will still work, but it's inefficient and can lead to unnecessary fallbacks if it happens during a discrete update.

When we implement this for Server Components, this will be less of an issue because there are no updates in that environment. However, it's still better for performance to cache data requests, so the same principles largely apply.

The intention is that this will eventually be the only supported way to suspend on arbitrary promises. Throwing a promise directly will be deprecated.

Todo

  • This can currently infinite loop if you use an uncached promise outside of a Suspense boundary. It's because this is an edge case where there's no fallback we can display, so it never switches to concurrent rendering. Might need to special case this.

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Aug 11, 2022
@sizebot
Copy link

sizebot commented Aug 11, 2022

Comparing: d0f3966...7cc1620

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 +0.50% 134.31 kB 134.98 kB +0.66% 42.95 kB 43.23 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js +0.83% 140.48 kB 141.64 kB +0.95% 44.78 kB 45.20 kB
facebook-www/ReactDOM-prod.classic.js +0.93% 474.75 kB 479.17 kB +0.84% 84.93 kB 85.64 kB
facebook-www/ReactDOM-prod.modern.js +0.96% 459.99 kB 464.43 kB +0.87% 82.68 kB 83.40 kB
facebook-www/ReactDOMForked-prod.classic.js +0.93% 474.75 kB 479.17 kB +0.83% 84.93 kB 85.64 kB
oss-experimental/jest-react/cjs/jest-react.development.js +6.33% 9.93 kB 10.56 kB +7.96% 3.46 kB 3.73 kB
oss-stable-semver/jest-react/cjs/jest-react.development.js +6.33% 9.93 kB 10.56 kB +7.96% 3.46 kB 3.73 kB
oss-stable/jest-react/cjs/jest-react.development.js +6.33% 9.93 kB 10.56 kB +7.96% 3.46 kB 3.73 kB
oss-experimental/jest-react/cjs/jest-react.production.min.js +2.89% 2.35 kB 2.42 kB +2.63% 1.14 kB 1.17 kB
oss-stable-semver/jest-react/cjs/jest-react.production.min.js +2.89% 2.35 kB 2.42 kB +2.63% 1.14 kB 1.17 kB
oss-stable/jest-react/cjs/jest-react.production.min.js +2.89% 2.35 kB 2.42 kB +2.63% 1.14 kB 1.17 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/jest-react/cjs/jest-react.development.js +6.33% 9.93 kB 10.56 kB +7.96% 3.46 kB 3.73 kB
oss-stable-semver/jest-react/cjs/jest-react.development.js +6.33% 9.93 kB 10.56 kB +7.96% 3.46 kB 3.73 kB
oss-stable/jest-react/cjs/jest-react.development.js +6.33% 9.93 kB 10.56 kB +7.96% 3.46 kB 3.73 kB
oss-experimental/jest-react/cjs/jest-react.production.min.js +2.89% 2.35 kB 2.42 kB +2.63% 1.14 kB 1.17 kB
oss-stable-semver/jest-react/cjs/jest-react.production.min.js +2.89% 2.35 kB 2.42 kB +2.63% 1.14 kB 1.17 kB
oss-stable/jest-react/cjs/jest-react.production.min.js +2.89% 2.35 kB 2.42 kB +2.63% 1.14 kB 1.17 kB
oss-experimental/scheduler/cjs/scheduler-unstable_mock.production.min.js +1.41% 4.83 kB 4.89 kB +1.13% 1.95 kB 1.97 kB
oss-stable-semver/scheduler/cjs/scheduler-unstable_mock.production.min.js +1.41% 4.83 kB 4.89 kB +1.13% 1.95 kB 1.97 kB
oss-stable/scheduler/cjs/scheduler-unstable_mock.production.min.js +1.41% 4.83 kB 4.89 kB +1.13% 1.95 kB 1.97 kB
oss-experimental/scheduler/umd/scheduler-unstable_mock.production.min.js +1.27% 4.87 kB 4.93 kB +1.17% 2.05 kB 2.07 kB
oss-stable-semver/scheduler/umd/scheduler-unstable_mock.production.min.js +1.27% 4.87 kB 4.93 kB +1.17% 2.05 kB 2.07 kB
oss-stable/scheduler/umd/scheduler-unstable_mock.production.min.js +1.27% 4.87 kB 4.93 kB +1.17% 2.05 kB 2.07 kB
oss-experimental/react-art/cjs/react-art.production.min.js +1.22% 89.45 kB 90.54 kB +0.98% 27.63 kB 27.91 kB
facebook-www/ReactART-prod.modern.js +1.18% 303.40 kB 306.98 kB +1.11% 52.24 kB 52.82 kB
oss-experimental/react-reconciler/cjs/react-reconciler.production.min.js +1.16% 101.00 kB 102.17 kB +1.41% 30.84 kB 31.27 kB
facebook-www/ReactART-prod.classic.js +1.13% 314.24 kB 317.79 kB +1.04% 54.07 kB 54.64 kB
oss-experimental/react-art/cjs/react-art.development.js +1.12% 736.50 kB 744.76 kB +1.37% 158.32 kB 160.49 kB
oss-experimental/react-art/umd/react-art.development.js +1.03% 842.42 kB 851.10 kB +1.24% 176.48 kB 178.67 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js +1.03% 804.15 kB 812.41 kB +1.24% 170.61 kB 172.73 kB
facebook-www/ReactART-dev.modern.js +1.01% 820.82 kB 829.13 kB +1.27% 173.20 kB 175.40 kB
facebook-www/ReactART-dev.classic.js +1.00% 831.04 kB 839.35 kB +1.25% 175.29 kB 177.48 kB
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.min.js +1.00% 109.93 kB 111.02 kB +1.18% 33.00 kB 33.39 kB
facebook-www/ReactDOM-prod.modern.js +0.96% 459.99 kB 464.43 kB +0.87% 82.68 kB 83.40 kB
facebook-www/ReactDOMForked-prod.modern.js +0.96% 459.99 kB 464.43 kB +0.88% 82.68 kB 83.40 kB
facebook-www/ReactDOM-prod.classic.js +0.93% 474.75 kB 479.17 kB +0.84% 84.93 kB 85.64 kB
facebook-www/ReactDOMForked-prod.classic.js +0.93% 474.75 kB 479.17 kB +0.83% 84.93 kB 85.64 kB
oss-experimental/react-art/umd/react-art.production.min.js +0.88% 125.29 kB 126.39 kB +1.00% 38.84 kB 39.22 kB
oss-experimental/scheduler/cjs/scheduler-unstable_mock.development.js +0.86% 17.75 kB 17.90 kB +0.73% 4.27 kB 4.30 kB
oss-stable-semver/scheduler/cjs/scheduler-unstable_mock.development.js +0.86% 17.75 kB 17.90 kB +0.73% 4.27 kB 4.30 kB
oss-stable/scheduler/cjs/scheduler-unstable_mock.development.js +0.86% 17.75 kB 17.90 kB +0.73% 4.27 kB 4.30 kB
facebook-react-native/scheduler/cjs/SchedulerMock-dev.js +0.86% 17.80 kB 17.95 kB +0.73% 4.27 kB 4.30 kB
oss-experimental/scheduler/umd/scheduler-unstable_mock.development.js +0.85% 19.08 kB 19.24 kB +0.71% 4.38 kB 4.41 kB
oss-stable-semver/scheduler/umd/scheduler-unstable_mock.development.js +0.85% 19.08 kB 19.24 kB +0.71% 4.38 kB 4.41 kB
oss-stable/scheduler/umd/scheduler-unstable_mock.development.js +0.85% 19.08 kB 19.24 kB +0.71% 4.38 kB 4.41 kB
oss-experimental/react-dom/umd/react-dom.production.min.js +0.85% 140.51 kB 141.70 kB +1.03% 45.42 kB 45.89 kB
facebook-www/ReactDOM-profiling.modern.js +0.84% 490.14 kB 494.24 kB +0.86% 87.09 kB 87.84 kB
facebook-www/ReactDOMForked-profiling.modern.js +0.84% 490.14 kB 494.24 kB +0.85% 87.09 kB 87.84 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js +0.83% 140.48 kB 141.64 kB +0.95% 44.78 kB 45.20 kB
facebook-react-native/scheduler/cjs/SchedulerMock-prod.js +0.82% 12.18 kB 12.28 kB +0.59% 2.86 kB 2.88 kB
facebook-www/ReactDOM-profiling.classic.js +0.81% 504.96 kB 509.04 kB +0.83% 89.41 kB 90.16 kB
facebook-www/ReactDOMForked-profiling.classic.js +0.81% 504.96 kB 509.04 kB +0.83% 89.41 kB 90.16 kB
facebook-www/SchedulerMock-prod.classic.js +0.80% 12.46 kB 12.56 kB +0.61% 2.95 kB 2.96 kB
facebook-www/SchedulerMock-prod.modern.js +0.80% 12.46 kB 12.56 kB +0.61% 2.95 kB 2.96 kB
oss-experimental/react/cjs/react.production.min.js +0.77% 8.07 kB 8.13 kB +0.46% 3.02 kB 3.03 kB
oss-experimental/react-dom/umd/react-dom.development.js +0.76% 1,140.73 kB 1,149.41 kB +0.89% 245.45 kB 247.63 kB
oss-experimental/react-dom/cjs/react-dom.development.js +0.76% 1,087.52 kB 1,095.78 kB +0.89% 242.77 kB 244.92 kB
oss-experimental/react-dom/umd/react-dom.profiling.min.js +0.75% 149.38 kB 150.51 kB +0.84% 47.74 kB 48.15 kB
oss-experimental/react-dom/cjs/react-dom.profiling.min.js +0.73% 150.02 kB 151.12 kB +0.87% 47.18 kB 47.59 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.production.min.js +0.71% 95.47 kB 96.15 kB +0.97% 29.28 kB 29.56 kB
oss-stable/react-reconciler/cjs/react-reconciler.production.min.js +0.71% 95.49 kB 96.17 kB +0.98% 29.30 kB 29.59 kB
oss-stable-semver/react-art/cjs/react-art.production.min.js +0.70% 84.24 kB 84.84 kB +0.68% 26.19 kB 26.37 kB
oss-stable/react-art/cjs/react-art.production.min.js +0.70% 84.27 kB 84.86 kB +0.66% 26.20 kB 26.37 kB
facebook-www/ReactDOMTesting-prod.modern.js +0.70% 433.37 kB 436.40 kB +0.53% 80.16 kB 80.59 kB
facebook-www/ReactDOMForked-dev.modern.js +0.70% 1,192.43 kB 1,200.73 kB +0.85% 261.16 kB 263.38 kB
facebook-www/ReactDOM-dev.modern.js +0.70% 1,192.43 kB 1,200.73 kB +0.85% 261.16 kB 263.38 kB
facebook-www/ReactDOMForked-dev.classic.js +0.68% 1,216.04 kB 1,224.34 kB +0.83% 265.65 kB 267.86 kB
facebook-www/ReactDOM-dev.classic.js +0.68% 1,216.04 kB 1,224.34 kB +0.83% 265.65 kB 267.86 kB
facebook-www/ReactDOMTesting-prod.classic.js +0.67% 449.37 kB 452.37 kB +0.50% 82.59 kB 83.00 kB
facebook-www/SchedulerMock-dev.classic.js +0.67% 22.99 kB 23.15 kB +0.55% 5.45 kB 5.48 kB
facebook-www/SchedulerMock-dev.modern.js +0.67% 22.99 kB 23.15 kB +0.55% 5.45 kB 5.48 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.production.min.js +0.65% 91.51 kB 92.11 kB +0.56% 28.26 kB 28.41 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.min.js +0.65% 91.54 kB 92.13 kB +0.55% 28.26 kB 28.41 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.production.min.js +0.65% 91.76 kB 92.36 kB +0.78% 28.69 kB 28.91 kB
oss-stable/react-test-renderer/umd/react-test-renderer.production.min.js +0.65% 91.79 kB 92.38 kB +0.77% 28.69 kB 28.91 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.production.min.js +0.61% 96.26 kB 96.85 kB +0.49% 29.59 kB 29.73 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.production.min.js +0.61% 96.50 kB 97.09 kB +0.56% 29.94 kB 30.11 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-prod.js +0.61% 277.70 kB 279.38 kB +0.48% 49.33 kB 49.57 kB
oss-stable-semver/react-art/cjs/react-art.development.js +0.59% 704.94 kB 709.13 kB +0.86% 151.98 kB 153.30 kB
oss-stable/react-art/cjs/react-art.development.js +0.59% 704.96 kB 709.15 kB +0.86% 152.01 kB 153.32 kB
facebook-react-native/react/cjs/React-prod.js +0.59% 17.20 kB 17.30 kB +0.52% 4.39 kB 4.41 kB
facebook-react-native/react/cjs/React-profiling.js +0.57% 17.81 kB 17.91 kB +0.55% 4.52 kB 4.54 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.profiling.min.js +0.57% 104.38 kB 104.97 kB +0.74% 31.52 kB 31.75 kB
oss-stable/react-reconciler/cjs/react-reconciler.profiling.min.js +0.57% 104.40 kB 104.99 kB +0.74% 31.54 kB 31.78 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-profiling.js +0.57% 293.30 kB 294.96 kB +0.43% 51.72 kB 51.94 kB
react-native/implementations/ReactFabric-prod.js +0.56% 305.87 kB 307.58 kB +0.56% 54.28 kB 54.58 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.development.js +0.55% 680.75 kB 684.52 kB +0.83% 147.43 kB 148.66 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.development.js +0.55% 680.77 kB 684.55 kB +0.83% 147.46 kB 148.68 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.development.js +0.55% 713.14 kB 717.05 kB +0.82% 149.04 kB 150.26 kB
oss-stable/react-test-renderer/umd/react-test-renderer.development.js +0.55% 713.16 kB 717.08 kB +0.82% 149.06 kB 150.29 kB
react-native/implementations/ReactNativeRenderer-prod.js +0.55% 312.65 kB 314.36 kB +0.49% 55.32 kB 55.59 kB
react-native/implementations/ReactFabric-prod.fb.js +0.54% 314.22 kB 315.93 kB +0.55% 55.91 kB 56.22 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.development.js +0.54% 771.58 kB 775.77 kB +0.77% 164.10 kB 165.37 kB
oss-stable/react-reconciler/cjs/react-reconciler.development.js +0.54% 771.61 kB 775.79 kB +0.77% 164.13 kB 165.39 kB
oss-stable-semver/react-art/umd/react-art.development.js +0.54% 809.31 kB 813.67 kB +0.76% 170.18 kB 171.47 kB
oss-stable/react-art/umd/react-art.development.js +0.54% 809.34 kB 813.70 kB +0.76% 170.20 kB 171.49 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-dev.js +0.54% 723.60 kB 727.48 kB +0.79% 154.65 kB 155.88 kB
react-native/implementations/ReactNativeRenderer-prod.fb.js +0.53% 320.99 kB 322.70 kB +0.52% 56.96 kB 57.25 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.development.js +0.53% 709.59 kB 713.37 kB +0.80% 153.09 kB 154.31 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.development.js +0.53% 743.42 kB 747.34 kB +0.78% 154.76 kB 155.97 kB
facebook-www/React-prod.modern.js +0.52% 19.45 kB 19.55 kB +0.47% 4.86 kB 4.89 kB
facebook-www/ReactTestRenderer-dev.modern.js +0.52% 742.88 kB 746.76 kB +0.79% 158.45 kB 159.70 kB
facebook-www/ReactTestRenderer-dev.classic.js +0.52% 742.89 kB 746.76 kB +0.79% 158.45 kB 159.70 kB
react-native/implementations/ReactFabric-dev.fb.js +0.52% 835.24 kB 839.60 kB +0.74% 179.70 kB 181.03 kB
oss-stable-semver/react-dom/umd/react-dom.production.min.js +0.52% 134.38 kB 135.07 kB +0.71% 43.66 kB 43.97 kB
oss-stable/react-dom/umd/react-dom.production.min.js +0.52% 134.40 kB 135.10 kB +0.72% 43.66 kB 43.97 kB
facebook-www/React-prod.classic.js +0.52% 19.77 kB 19.87 kB +0.46% 4.96 kB 4.98 kB
react-native/implementations/ReactNativeRenderer-dev.fb.js +0.52% 844.89 kB 849.24 kB +0.72% 182.34 kB 183.65 kB
facebook-www/React-profiling.modern.js +0.51% 20.05 kB 20.16 kB +0.42% 4.99 kB 5.01 kB
oss-stable-semver/react-art/umd/react-art.production.min.js +0.51% 120.11 kB 120.72 kB +0.55% 37.39 kB 37.59 kB
oss-stable/react-art/umd/react-art.production.min.js +0.51% 120.14 kB 120.75 kB +0.55% 37.39 kB 37.59 kB
facebook-www/React-profiling.classic.js +0.50% 20.37 kB 20.47 kB +0.47% 5.08 kB 5.10 kB
oss-stable-semver/react-dom/cjs/react-dom.production.min.js +0.50% 134.28 kB 134.95 kB +0.66% 42.95 kB 43.23 kB
oss-stable/react-dom/cjs/react-dom.production.min.js +0.50% 134.31 kB 134.98 kB +0.66% 42.95 kB 43.23 kB
react-native/implementations/ReactFabric-dev.js +0.48% 801.02 kB 804.90 kB +0.73% 173.29 kB 174.56 kB
react-native/implementations/ReactFabric-profiling.js +0.48% 325.10 kB 326.67 kB +0.45% 57.47 kB 57.73 kB
react-native/implementations/ReactNativeRenderer-dev.js +0.48% 810.68 kB 814.56 kB +0.71% 175.91 kB 177.16 kB
react-native/implementations/ReactNativeRenderer-profiling.js +0.47% 331.96 kB 333.53 kB +0.41% 58.53 kB 58.76 kB
oss-experimental/react/umd/react.profiling.min.js +0.47% 11.86 kB 11.91 kB +0.31% 4.57 kB 4.58 kB
oss-experimental/react/umd/react.production.min.js +0.47% 11.86 kB 11.91 kB +0.35% 4.57 kB 4.58 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.production.min.js +0.46% 145.12 kB 145.79 kB +0.58% 46.60 kB 46.87 kB
oss-stable-semver/react-dom/umd/react-dom.profiling.min.js +0.44% 143.25 kB 143.88 kB +0.48% 45.95 kB 46.17 kB
oss-stable/react-dom/umd/react-dom.profiling.min.js +0.44% 143.28 kB 143.90 kB +0.48% 45.95 kB 46.17 kB
oss-stable-semver/react-dom/cjs/react-dom.profiling.min.js +0.42% 143.82 kB 144.43 kB +0.44% 45.46 kB 45.66 kB
oss-stable/react-dom/cjs/react-dom.profiling.min.js +0.42% 143.85 kB 144.45 kB +0.44% 45.46 kB 45.66 kB
oss-stable-semver/react-dom/cjs/react-dom.development.js +0.40% 1,051.72 kB 1,055.91 kB +0.55% 235.25 kB 236.53 kB
oss-stable/react-dom/cjs/react-dom.development.js +0.40% 1,051.75 kB 1,055.93 kB +0.55% 235.27 kB 236.56 kB
oss-stable-semver/react-dom/umd/react-dom.development.js +0.39% 1,103.19 kB 1,107.55 kB +0.54% 237.87 kB 239.15 kB
oss-stable/react-dom/umd/react-dom.development.js +0.39% 1,103.21 kB 1,107.57 kB +0.54% 237.89 kB 239.17 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.development.js +0.39% 1,079.62 kB 1,083.80 kB +0.53% 240.99 kB 242.27 kB
react-native/implementations/ReactFabric-profiling.fb.js +0.32% 341.48 kB 342.58 kB +0.23% 60.20 kB 60.34 kB
facebook-www/ReactDOMTesting-dev.modern.js +0.32% 1,078.34 kB 1,081.80 kB +0.44% 240.41 kB 241.46 kB
react-native/implementations/ReactNativeRenderer-profiling.fb.js +0.32% 348.33 kB 349.43 kB +0.23% 61.27 kB 61.41 kB
facebook-www/ReactDOMTesting-dev.classic.js +0.31% 1,106.96 kB 1,110.43 kB +0.43% 246.24 kB 247.29 kB

Generated by 🚫 dangerJS against 7cc1620

@acdlite acdlite marked this pull request as ready for review August 11, 2022 20:40
},
);
}
throw thenable;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we add ping listeners directly here and instead throw a placeholder value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I can do that

if (suspendedThenables === null) {
suspendedThenables = [];
}
suspendedThenables[index] = thenable;
Copy link
Collaborator

Choose a reason for hiding this comment

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

So this is a holey array which is pretty deopted. I wonder if it might be worth just setting it to null for every use() call even if nothing suspends. Perhaps reusing the same array every time and filling it with null each time. Maybe that's worse.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe @gsathya would know which is best

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this got replaced by expandos? Expandos will cause hidden class transition leading to a potential deopt. Curious if WeakMap works for you? Or is too slow?

I guess, the tradeoff here is between slow lookup in WeakMaps or a deopt in other parts that use this thenable -- I don't know which is the more common workload.

As an aside, if looking up the Promise value synchronously is the common case, then we could champion a Promise.prototype.inspect proposal to add this to the Promise API.

Copy link
Collaborator Author

@acdlite acdlite Aug 16, 2022

Choose a reason for hiding this comment

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

Promise.prototype.inspect wouldn't help in this particular case because this array is for tracking thenables that aren't cached. We use it when we know two thenables represent the same data even though they are different objects. For example:

const helloPromise = Promise.resolve('Hello');

function HelloWorld() {
  // This component uses different promises on every render attempt,
  // but if no React state has changed we know that the underlying value
  // can be reused.
  return
    // This promise is the same every time, so we can read the value
    // from the expando (a la Promise.prototype.inspect)
    use(helloPromise) +
    // This promise is new every time, but we know it represents the
    // same thing, so we reuse the previous value from the array.
    use(Promise.resolve('World');
}

In the current implementation, this example would produce a sparse array with a value at index 1 and a hole at index 0.

The reason index 0 is a hole is because if the promise can be inspected, there's no reason to track it. So Seb's suggestion is that it might be better to push to the array even if it's not needed.

There are other solutions to avoid a holey array, like only advancing the thenableIndex if the promise hasn't resolved. I think that would require one additional null check to each read of an inspectable promise, but it might be worth it to prevent a deopt.

default: {
// The thenable still hasn't resolved. Suspend with the same
// thenable as last time to avoid redundant listeners.
throw prevThenableAtIndex;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems like it should be an error case - e.g. you used something mutable conditionally.

We shouldn't bother retrying immediately unless lastUsedThenable was pinged. There's no point in retrying due to anything else because that can no longer be blocking. Anything preceding lastUsedThenable must have already been resolved or we wouldn't have gotten that far.

If something else pings maybe we need to reset the suspended thenables anyway - e.g. if we want to treat it as a restart.

So if we have anything in the slot from before, it must've been resolved. Otherwise something went wrong.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah that seems reasonable. I started a list of a warning cases but maybe this one should be an actual error

Copy link
Collaborator Author

@acdlite acdlite Aug 12, 2022

Choose a reason for hiding this comment

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

We shouldn't bother retrying immediately unless lastUsedThenable was pinged. There's no point in retrying due to anything else because that can no longer be blocking. Anything preceding lastUsedThenable must have already been resolved or we wouldn't have gotten that far.

Yeah that is how it currently works. It's a different variable though because it also works for ad hoc wakeables (ones that aren't use-d), but the same logic you're describing:

if (wakeable === suspendedWakeable) {
// This ping is from the wakeable that just suspended. Mark it as pinged.
// When the work loop resumes, we'll immediately try rendering the fiber
// again instead of unwinding the stack.
wasPinged = true;
return true;
}

@acdlite acdlite force-pushed the use-promise branch 7 times, most recently from 1d4f742 to 71c74d5 Compare August 19, 2022 00:47
This update our internal implementation of `act` to support React's new
behavior for unwrapping promises. Like we did with Scheduler, when 
something suspends, it will yield to the main thread so the microtasks
can run, then continue in a new task.

I need to implement the same behavior in the public version of `act`,
but there are some additional considerations so I'll do that in a
separate commit.
throwException is the function that finds the nearest boundary and
schedules it for a second render pass. We should only call it right 
before we unwind the stack — not if we receive an immediate ping and
render the fiber again.

This was an oversight in 8ef3a7c that I didn't notice because it happens
to mostly work, anyway. What made me notice the mistake is that
throwException also marks the entire render phase as suspended
(RootDidSuspend or RootDidSuspendWithDelay), which is only supposed to
be happen if we show a fallback. One consequence was that, in the 
RootDidSuspendWithDelay case, the entire commit phase was blocked,
because that's the exit status we use to block a bad fallback
from appearing.
Add a `status` expando to a thrown thenable to track when its value has
resolved.

In a later step, we'll also use `value` and `reason` expandos to track
the resolved value.

This is not part of the official JavaScript spec — think of
it as an extension of the Promise API, or a custom interface that is a
superset of Thenable. However, it's inspired by the terminology used
by `Promise.allSettled`.

The intent is that this will be a public API — Suspense implementations
can set these expandos to allow React to unwrap the value synchronously
without waiting a microtask.
Sets up a new experimental hook behind a feature flag, but does not
implement it yet.
@rickhanlonii
Copy link
Member

@nl0 this API is experimental and still in research so there's no target for release yet.

GrinZero added a commit to GrinZero/react that referenced this pull request Aug 31, 2022
* 'main' of ssh://github.com/GrinZero/react: (26 commits)
  [devtools][easy] Fix flow type (facebook#25147)
  Remove Symbol Polyfill (again) (facebook#25144)
  Remove ReactFiberFlags MountLayoutDev and MountPassiveDev (facebook#25091)
  experimental_use(promise) (facebook#25084)
  [Transition Tracing] onMarkerIncomplete - Tracing Marker/Suspense Boundary Deletions (facebook#24885)
  [Flight] Add support for Webpack Async Modules (facebook#25138)
  Fix typo: supportsMicrotask -> supportsMicrotasks (facebook#25142)
  Allow functions to be used as module references (facebook#25137)
  Test the node-register hooks in unit tests (facebook#25132)
  Return closestInstance in `getInspectorDataForViewAtPoint` (facebook#25118)
  [DevTools] Highlight RN elements on hover (facebook#25106)
  Update fixtures/flight to webpack 5 (facebook#25115)
  Align StrictMode behaviour with production (facebook#25049)
  Scaffolding for useMemoCache hook (facebook#25123)
  devtools: Fix typo from directores to directories (facebook#25124)
  fixture: Fix typo from perfomrance to performance (facebook#25100)
  [DevTools] Add events necessary for click to inspect on RN (facebook#25111)
  Add missing createServerContext for experimental shared subset (facebook#25114)
  support subresource integrity for bootstrapScripts and bootstrapModules (facebook#25104)
  make preamble and postamble types explicit and fix typo (facebook#25102)
  ...
acdlite added a commit to acdlite/react that referenced this pull request Sep 7, 2022
Follow up to facebook#25084. Implements experimental_use(promise) API in 
the Server Components runtime (Flight).

The implementation is much simpler than in Fiber because there is no
state. Even the "state" added in this PR — to track the result of each
promise across attempts — is reset as soon as a component 
successfully renders without suspending.

There are also fewer caveats around neglecting to cache a promise
because the state of the promises is preserved even if we switch to a
different task.

Server Components is the primary runtime where this API is intended to
be used.

The last runtime where we need to implement this is the server renderer
(Fizz).
acdlite added a commit to acdlite/react that referenced this pull request Sep 7, 2022
Follow up to facebook#25084. Implements experimental_use(promise) API in 
the Server Components runtime (Flight).

The implementation is much simpler than in Fiber because there is no
state. Even the "state" added in this PR — to track the result of each
promise across attempts — is reset as soon as a component 
successfully renders without suspending.

There are also fewer caveats around neglecting to cache a promise
because the state of the promises is preserved even if we switch to a
different task.

Server Components is the primary runtime where this API is intended to
be used.

The last runtime where we need to implement this is the server renderer
(Fizz).
acdlite added a commit to acdlite/react that referenced this pull request Sep 7, 2022
Follow up to facebook#25084. Implements experimental_use(promise) API in 
the Server Components runtime (Flight).

The implementation is much simpler than in Fiber because there is no
state. Even the "state" added in this PR — to track the result of each
promise across attempts — is reset as soon as a component 
successfully renders without suspending.

There are also fewer caveats around neglecting to cache a promise
because the state of the promises is preserved even if we switch to a
different task.

Server Components is the primary runtime where this API is intended to
be used.

The last runtime where we need to implement this is the server renderer
(Fizz).
acdlite added a commit to acdlite/react that referenced this pull request Sep 8, 2022
Follow up to facebook#25084. Implements experimental_use(promise) API in 
the Server Components runtime (Flight).

The implementation is much simpler than in Fiber because there is no
state. Even the "state" added in this PR — to track the result of each
promise across attempts — is reset as soon as a component 
successfully renders without suspending.

There are also fewer caveats around neglecting to cache a promise
because the state of the promises is preserved even if we switch to a
different task.

Server Components is the primary runtime where this API is intended to
be used.

The last runtime where we need to implement this is the server renderer
(Fizz).
acdlite added a commit that referenced this pull request Sep 8, 2022
Follow up to #25084. Implements experimental_use(promise) API in 
the Server Components runtime (Flight).

The implementation is much simpler than in Fiber because there is no
state. Even the "state" added in this PR — to track the result of each
promise across attempts — is reset as soon as a component 
successfully renders without suspending.

There are also fewer caveats around neglecting to cache a promise
because the state of the promises is preserved even if we switch to a
different task.

Server Components is the primary runtime where this API is intended to
be used.

The last runtime where we need to implement this is the server renderer
(Fizz).
acdlite added a commit to acdlite/react that referenced this pull request Sep 9, 2022
Follow up to facebook#25084. Implements experimental_use(promise) API in the
SSR runtime (Fizz).

This is largely a copy-paste of the Flight implementation. I have
intentionally tried to keep both as close as possible.
acdlite added a commit to acdlite/react that referenced this pull request Sep 9, 2022
Follow up to facebook#25084 and facebook#25207. Implements experimental_use(promise) API
in the SSR runtime (Fizz).

This is largely a copy-paste of the Flight implementation. I have
intentionally tried to keep both as close as possible.
acdlite added a commit to acdlite/react that referenced this pull request Sep 9, 2022
Follow up to facebook#25084 and facebook#25207. Implements experimental_use(promise) API
in the SSR runtime (Fizz).

This is largely a copy-paste of the Flight implementation. I have
intentionally tried to keep both as close as possible.
acdlite added a commit that referenced this pull request Sep 9, 2022
Follow up to #25084 and #25207. Implements experimental_use(promise) API
in the SSR runtime (Fizz).

This is largely a copy-paste of the Flight implementation. I have
intentionally tried to keep both as close as possible.
eps1lon added a commit to eps1lon/DefinitelyTyped that referenced this pull request Sep 10, 2022
eps1lon added a commit to eps1lon/DefinitelyTyped that referenced this pull request Sep 10, 2022
johnnyreilly pushed a commit to DefinitelyTyped/DefinitelyTyped that referenced this pull request Sep 10, 2022
sammy-SC pushed a commit that referenced this pull request Sep 11, 2022
Follow up to #25084. Implements experimental_use(promise) API in 
the Server Components runtime (Flight).

The implementation is much simpler than in Fiber because there is no
state. Even the "state" added in this PR — to track the result of each
promise across attempts — is reset as soon as a component 
successfully renders without suspending.

There are also fewer caveats around neglecting to cache a promise
because the state of the promises is preserved even if we switch to a
different task.

Server Components is the primary runtime where this API is intended to
be used.

The last runtime where we need to implement this is the server renderer
(Fizz).
sammy-SC pushed a commit that referenced this pull request Sep 11, 2022
Follow up to #25084 and #25207. Implements experimental_use(promise) API
in the SSR runtime (Fizz).

This is largely a copy-paste of the Flight implementation. I have
intentionally tried to keep both as close as possible.
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Sep 12, 2022
Summary:
This sync includes the following changes:
- **[c28f313e6](facebook/react@c28f313e6 )**: experimental_use(promise) for SSR ([#25214](facebook/react#25214)) //<Andrew Clark>//
- **[d6f9628a8](facebook/react@d6f9628a8 )**: Remove some RSC subset entry points that were removed in the main entry point ([#25209](facebook/react#25209)) //<Sebastian Markbåge>//
- **[a473d08fc](facebook/react@a473d08fc )**: Update to Flow from 0.97 to 0.122 ([#25204](facebook/react#25204)) //<Jan Kassens>//
- **[7028ce745](facebook/react@7028ce745 )**: experimental_use(promise) for Server Components ([#25207](facebook/react#25207)) //<Andrew Clark>//
- **[bfb65681e](facebook/react@bfb65681e )**: experimental_use(context)([#25202](facebook/react#25202)) //<mofeiZ>//
- **[f0efa1164](facebook/react@f0efa1164 )**: [flow] remove custom suppress comment config ([#25170](facebook/react#25170)) //<Jan Kassens>//
- **[2e7f422fe](facebook/react@2e7f422fe )**: Refactor: its type is Container ([#25153](facebook/react#25153)) //<bubucuo>//
- **[2c2d9a1df](facebook/react@2c2d9a1df )**: [eslint-plugin-react-hooks] only allow capitalized component names ([#25162](facebook/react#25162)) //<Jan Kassens>//
- **[36c908a6c](facebook/react@36c908a6c )**: Don't use the Flight terminology in public error messages ([#25166](facebook/react#25166)) //<Sebastian Markbåge>//
- **[8d1b057ec](facebook/react@8d1b057ec )**: [Flight] Minor error handling fixes ([#25151](facebook/react#25151)) //<Sebastian Markbåge>//
- **[9ff738f53](facebook/react@9ff738f53 )**: [devtools][easy] Fix flow type ([#25147](facebook/react#25147)) //<Tianyu Yao>//
- **[0de3ddf56](facebook/react@0de3ddf56 )**: Remove Symbol Polyfill (again) ([#25144](facebook/react#25144)) //<Ricky>//
- **[b36f72235](facebook/react@b36f72235 )**: Remove ReactFiberFlags MountLayoutDev and MountPassiveDev ([#25091](facebook/react#25091)) //<Samuel Susla>//
- **[b6978bc38](facebook/react@b6978bc38 )**: experimental_use(promise) ([#25084](facebook/react#25084)) //<Andrew Clark>//
- **[11ed7010c](facebook/react@11ed7010c )**: [Transition Tracing] onMarkerIncomplete - Tracing Marker/Suspense Boundary Deletions ([#24885](facebook/react#24885)) //<Luna Ruan>//
- **[b79894259](facebook/react@b79894259 )**: [Flight] Add support for Webpack Async Modules ([#25138](facebook/react#25138)) //<Sebastian Markbåge>//
- **[c8b778b7f](facebook/react@c8b778b7f )**: Fix typo: supportsMicrotask -> supportsMicrotasks ([#25142](facebook/react#25142)) //<kwzr>//
- **[d0f396651](facebook/react@d0f396651 )**: Allow functions to be used as module references ([#25137](facebook/react#25137)) //<Sebastian Markbåge>//
- **[38c5d8a03](facebook/react@38c5d8a03 )**: Test the node-register hooks in unit tests ([#25132](facebook/react#25132)) //<Sebastian Markbåge>//
- **[3f70e68ce](facebook/react@3f70e68ce )**: Return closestInstance in `getInspectorDataForViewAtPoint` ([#25118](facebook/react#25118)) //<Tianyu Yao>//
- **[3d443cad7](facebook/react@3d443cad7 )**: Update fixtures/flight to webpack 5 ([#25115](facebook/react#25115)) //<Tim Neutkens>//
- **[5d1ce6513](facebook/react@5d1ce6513 )**: Align StrictMode behaviour with production ([#25049](facebook/react#25049)) //<Samuel Susla>//
- **[9e67e7a31](facebook/react@9e67e7a31 )**: Scaffolding for useMemoCache hook ([#25123](facebook/react#25123)) //<Joseph Savona>//
- **[19e9a4c68](facebook/react@19e9a4c68 )**: Add missing createServerContext for experimental shared subset ([#25114](facebook/react#25114)) //<Jiachi Liu>//
- **[6ef466c68](facebook/react@6ef466c68 )**: make preamble and postamble types explicit and fix typo ([#25102](facebook/react#25102)) //<Josh Story>//
- **[796d31809](facebook/react@796d31809 )**: Implement basic stylesheet Resources for react-dom ([#25060](facebook/react#25060)) //<Josh Story>//
- **[32baab38f](facebook/react@32baab38f )**: [Transition Tracing] Add Tag Field to Marker Instance ([#25085](facebook/react#25085)) //<Luna Ruan>//
- **[8ef3a7c08](facebook/react@8ef3a7c08 )**: Resume immediately pinged fiber without unwinding ([#25074](facebook/react#25074)) //<Andrew Clark>//
- **[7bcc68772](facebook/react@7bcc68772 )**: Remove argument committedLanes from reappearLayoutEffects and recursivelyTraverseReappearLayoutEffects ([#25080](facebook/react#25080)) //<Samuel Susla>//
- **[ca990e9a7](facebook/react@ca990e9a7 )**: Add API to force Scheduler to yield for macrotask ([#25044](facebook/react#25044)) //<Andrew Clark>//
- **[b4204ede6](facebook/react@b4204ede6 )**: Clean up unused Deletion flag ([#24992](facebook/react#24992)) //<Andrew Clark>//
- **[e193be87e](facebook/react@e193be87e )**: [Transition Tracing] Add Offscreen Test ([#25035](facebook/react#25035)) //<Luna Ruan>//
- **[9fcaf88d5](facebook/react@9fcaf88d5 )**: Remove rootContainerInstance from unnecessary places ([#25024](facebook/react#25024)) //<Sebastian Markbåge>//
- **[80f3d8819](facebook/react@80f3d8819 )**: Mount/unmount passive effects when Offscreen visibility changes ([#24977](facebook/react#24977)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 4ea064e...c28f313

Reviewed By: rickhanlonii

Differential Revision: D39384898

fbshipit-source-id: 20b080a53851d6dd9d522c8468dd02aab9ba76db
rickhanlonii pushed a commit that referenced this pull request Oct 5, 2022
* Internal `act`: Unwrapping resolved promises

This update our internal implementation of `act` to support React's new
behavior for unwrapping promises. Like we did with Scheduler, when 
something suspends, it will yield to the main thread so the microtasks
can run, then continue in a new task.

I need to implement the same behavior in the public version of `act`,
but there are some additional considerations so I'll do that in a
separate commit.

* Move throwException to after work loop resumes

throwException is the function that finds the nearest boundary and
schedules it for a second render pass. We should only call it right 
before we unwind the stack — not if we receive an immediate ping and
render the fiber again.

This was an oversight in 8ef3a7c that I didn't notice because it happens
to mostly work, anyway. What made me notice the mistake is that
throwException also marks the entire render phase as suspended
(RootDidSuspend or RootDidSuspendWithDelay), which is only supposed to
be happen if we show a fallback. One consequence was that, in the 
RootDidSuspendWithDelay case, the entire commit phase was blocked,
because that's the exit status we use to block a bad fallback
from appearing.

* Use expando to check whether promise has resolved

Add a `status` expando to a thrown thenable to track when its value has
resolved.

In a later step, we'll also use `value` and `reason` expandos to track
the resolved value.

This is not part of the official JavaScript spec — think of
it as an extension of the Promise API, or a custom interface that is a
superset of Thenable. However, it's inspired by the terminology used
by `Promise.allSettled`.

The intent is that this will be a public API — Suspense implementations
can set these expandos to allow React to unwrap the value synchronously
without waiting a microtask.

* Scaffolding for `experimental_use` hook

Sets up a new experimental hook behind a feature flag, but does not
implement it yet.

* use(promise)

Adds experimental support to Fiber for unwrapping the value of a promise
inside a component. It is not yet implemented for Server Components, 
but that is planned.

If promise has already resolved, the value can be unwrapped
"immediately" without showing a fallback. The trick we use to implement
this is to yield to the main thread (literally suspending the work
loop), wait for the microtask queue to drain, then check if the promise
resolved in the meantime. If so, we can resume the last attempted fiber
without unwinding the stack. This functionality was implemented in 
previous commits.

Another feature is that the promises do not need to be cached between
attempts. Because we assume idempotent execution of components, React
will track the promises that were used during the previous attempt and
reuse the result. You shouldn't rely on this property, but during
initial render it mostly just works. Updates are trickier, though,
because if you used an uncached promise, we have no way of knowing 
whether the underlying data has changed, so we have to unwrap the
promise every time. It will still work, but it's inefficient and can
lead to unnecessary fallbacks if it happens during a discrete update.

When we implement this for Server Components, this will be less of an
issue because there are no updates in that environment. However, it's
still better for performance to cache data requests, so the same
principles largely apply.

The intention is that this will eventually be the only supported way to
suspend on arbitrary promises. Throwing a promise directly will
be deprecated.
rickhanlonii pushed a commit that referenced this pull request Oct 5, 2022
Follow up to #25084. Implements experimental_use(promise) API in 
the Server Components runtime (Flight).

The implementation is much simpler than in Fiber because there is no
state. Even the "state" added in this PR — to track the result of each
promise across attempts — is reset as soon as a component 
successfully renders without suspending.

There are also fewer caveats around neglecting to cache a promise
because the state of the promises is preserved even if we switch to a
different task.

Server Components is the primary runtime where this API is intended to
be used.

The last runtime where we need to implement this is the server renderer
(Fizz).
rickhanlonii pushed a commit that referenced this pull request Oct 5, 2022
Follow up to #25084 and #25207. Implements experimental_use(promise) API
in the SSR runtime (Fizz).

This is largely a copy-paste of the Flight implementation. I have
intentionally tried to keep both as close as possible.
rickhanlonii pushed a commit that referenced this pull request Oct 5, 2022
Follow up to #25084 and #25207. Implements experimental_use(promise) API
in the SSR runtime (Fizz).

This is largely a copy-paste of the Flight implementation. I have
intentionally tried to keep both as close as possible.
acdlite added a commit to acdlite/react that referenced this pull request Dec 5, 2022
This reverts commit c28f313.

Follow up to facebook#25084 and facebook#25207. Implements experimental_use(promise) API
in the SSR runtime (Fizz).

This is largely a copy-paste of the Flight implementation. I have
intentionally tried to keep both as close as possible.
acdlite added a commit to acdlite/react that referenced this pull request Dec 5, 2022
This reverts commit dedfeff.

This reverts commit c28f313.

Follow up to facebook#25084 and facebook#25207. Implements experimental_use(promise) API
in the SSR runtime (Fizz).

This is largely a copy-paste of the Flight implementation. I have
intentionally tried to keep both as close as possible.
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
This sync includes the following changes:
- **[c28f313e6](facebook/react@c28f313e6 )**: experimental_use(promise) for SSR ([facebook#25214](facebook/react#25214)) //<Andrew Clark>//
- **[d6f9628a8](facebook/react@d6f9628a8 )**: Remove some RSC subset entry points that were removed in the main entry point ([facebook#25209](facebook/react#25209)) //<Sebastian Markbåge>//
- **[a473d08fc](facebook/react@a473d08fc )**: Update to Flow from 0.97 to 0.122 ([facebook#25204](facebook/react#25204)) //<Jan Kassens>//
- **[7028ce745](facebook/react@7028ce745 )**: experimental_use(promise) for Server Components ([facebook#25207](facebook/react#25207)) //<Andrew Clark>//
- **[bfb65681e](facebook/react@bfb65681e )**: experimental_use(context)([facebook#25202](facebook/react#25202)) //<mofeiZ>//
- **[f0efa1164](facebook/react@f0efa1164 )**: [flow] remove custom suppress comment config ([facebook#25170](facebook/react#25170)) //<Jan Kassens>//
- **[2e7f422fe](facebook/react@2e7f422fe )**: Refactor: its type is Container ([facebook#25153](facebook/react#25153)) //<bubucuo>//
- **[2c2d9a1df](facebook/react@2c2d9a1df )**: [eslint-plugin-react-hooks] only allow capitalized component names ([facebook#25162](facebook/react#25162)) //<Jan Kassens>//
- **[36c908a6c](facebook/react@36c908a6c )**: Don't use the Flight terminology in public error messages ([facebook#25166](facebook/react#25166)) //<Sebastian Markbåge>//
- **[8d1b057ec](facebook/react@8d1b057ec )**: [Flight] Minor error handling fixes ([facebook#25151](facebook/react#25151)) //<Sebastian Markbåge>//
- **[9ff738f53](facebook/react@9ff738f53 )**: [devtools][easy] Fix flow type ([facebook#25147](facebook/react#25147)) //<Tianyu Yao>//
- **[0de3ddf56](facebook/react@0de3ddf56 )**: Remove Symbol Polyfill (again) ([facebook#25144](facebook/react#25144)) //<Ricky>//
- **[b36f72235](facebook/react@b36f72235 )**: Remove ReactFiberFlags MountLayoutDev and MountPassiveDev ([facebook#25091](facebook/react#25091)) //<Samuel Susla>//
- **[b6978bc38](facebook/react@b6978bc38 )**: experimental_use(promise) ([facebook#25084](facebook/react#25084)) //<Andrew Clark>//
- **[11ed7010c](facebook/react@11ed7010c )**: [Transition Tracing] onMarkerIncomplete - Tracing Marker/Suspense Boundary Deletions ([facebook#24885](facebook/react#24885)) //<Luna Ruan>//
- **[b79894259](facebook/react@b79894259 )**: [Flight] Add support for Webpack Async Modules ([facebook#25138](facebook/react#25138)) //<Sebastian Markbåge>//
- **[c8b778b7f](facebook/react@c8b778b7f )**: Fix typo: supportsMicrotask -> supportsMicrotasks ([facebook#25142](facebook/react#25142)) //<kwzr>//
- **[d0f396651](facebook/react@d0f396651 )**: Allow functions to be used as module references ([facebook#25137](facebook/react#25137)) //<Sebastian Markbåge>//
- **[38c5d8a03](facebook/react@38c5d8a03 )**: Test the node-register hooks in unit tests ([facebook#25132](facebook/react#25132)) //<Sebastian Markbåge>//
- **[3f70e68ce](facebook/react@3f70e68ce )**: Return closestInstance in `getInspectorDataForViewAtPoint` ([facebook#25118](facebook/react#25118)) //<Tianyu Yao>//
- **[3d443cad7](facebook/react@3d443cad7 )**: Update fixtures/flight to webpack 5 ([facebook#25115](facebook/react#25115)) //<Tim Neutkens>//
- **[5d1ce6513](facebook/react@5d1ce6513 )**: Align StrictMode behaviour with production ([facebook#25049](facebook/react#25049)) //<Samuel Susla>//
- **[9e67e7a31](facebook/react@9e67e7a31 )**: Scaffolding for useMemoCache hook ([facebook#25123](facebook/react#25123)) //<Joseph Savona>//
- **[19e9a4c68](facebook/react@19e9a4c68 )**: Add missing createServerContext for experimental shared subset ([facebook#25114](facebook/react#25114)) //<Jiachi Liu>//
- **[6ef466c68](facebook/react@6ef466c68 )**: make preamble and postamble types explicit and fix typo ([facebook#25102](facebook/react#25102)) //<Josh Story>//
- **[796d31809](facebook/react@796d31809 )**: Implement basic stylesheet Resources for react-dom ([facebook#25060](facebook/react#25060)) //<Josh Story>//
- **[32baab38f](facebook/react@32baab38f )**: [Transition Tracing] Add Tag Field to Marker Instance ([facebook#25085](facebook/react#25085)) //<Luna Ruan>//
- **[8ef3a7c08](facebook/react@8ef3a7c08 )**: Resume immediately pinged fiber without unwinding ([facebook#25074](facebook/react#25074)) //<Andrew Clark>//
- **[7bcc68772](facebook/react@7bcc68772 )**: Remove argument committedLanes from reappearLayoutEffects and recursivelyTraverseReappearLayoutEffects ([facebook#25080](facebook/react#25080)) //<Samuel Susla>//
- **[ca990e9a7](facebook/react@ca990e9a7 )**: Add API to force Scheduler to yield for macrotask ([facebook#25044](facebook/react#25044)) //<Andrew Clark>//
- **[b4204ede6](facebook/react@b4204ede6 )**: Clean up unused Deletion flag ([facebook#24992](facebook/react#24992)) //<Andrew Clark>//
- **[e193be87e](facebook/react@e193be87e )**: [Transition Tracing] Add Offscreen Test ([facebook#25035](facebook/react#25035)) //<Luna Ruan>//
- **[9fcaf88d5](facebook/react@9fcaf88d5 )**: Remove rootContainerInstance from unnecessary places ([facebook#25024](facebook/react#25024)) //<Sebastian Markbåge>//
- **[80f3d8819](facebook/react@80f3d8819 )**: Mount/unmount passive effects when Offscreen visibility changes ([facebook#24977](facebook/react#24977)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 4ea064e...c28f313

Reviewed By: rickhanlonii

Differential Revision: D39384898

fbshipit-source-id: 20b080a53851d6dd9d522c8468dd02aab9ba76db
alexandresoro pushed a commit to alexandresoro/ouca-web that referenced this pull request Jan 17, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react) ([source](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react)) | devDependencies | major | [`18.3.18` -> `19.0.7`](https://renovatebot.com/diffs/npm/@types%2freact/18.3.18/19.0.7) |
| [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-dom) ([source](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom)) | devDependencies | major | [`18.3.5` -> `19.0.3`](https://renovatebot.com/diffs/npm/@types%2freact-dom/18.3.5/19.0.3) |
| [react](https://react.dev/) ([source](https://github.com/facebook/react/tree/HEAD/packages/react)) | dependencies | major | [`18.3.1` -> `19.0.0`](https://renovatebot.com/diffs/npm/react/18.3.1/19.0.0) |
| [react-dom](https://react.dev/) ([source](https://github.com/facebook/react/tree/HEAD/packages/react-dom)) | dependencies | major | [`18.3.1` -> `19.0.0`](https://renovatebot.com/diffs/npm/react-dom/18.3.1/19.0.0) |

---

### Release Notes

<details>
<summary>facebook/react (react)</summary>

### [`v19.0.0`](https://github.com/facebook/react/blob/HEAD/CHANGELOG.md#1900-December-5-2024)

[Compare Source](https://github.com/facebook/react/compare/v18.3.1...v19.0.0)

Below is a list of all new features, APIs, deprecations, and breaking changes. Read [React 19 release post](https://react.dev/blog/2024/04/25/react-19) and [React 19 upgrade guide](https://react.dev/blog/2024/04/25/react-19-upgrade-guide) for more information.

> Note: To help make the upgrade to React 19 easier, we’ve published a [email protected] release that is identical to 18.2 but adds warnings for deprecated APIs and other changes that are needed for React 19. We recommend upgrading to React 18.3.1 first to help identify any issues before upgrading to React 19.

##### New Features

##### React

-   Actions: `startTransition` can now accept async functions. Functions passed to `startTransition` are called “Actions”. A given Transition can include one or more Actions which update state in the background and update the UI with one commit. In addition to updating state, Actions can now perform side effects including async requests, and the Action will wait for the work to finish before finishing the Transition. This feature allows Transitions to include side effects like `fetch()` in the pending state, and provides support for error handling, and optimistic updates.
-   `useActionState`: is a new hook to order Actions inside of a Transition with access to the state of the action, and the pending state. It accepts a reducer that can call Actions, and the initial state used for first render. It also accepts an optional string that is used if the action is passed to a form `action` prop to support progressive enhancement in forms.
-   `useOptimistic`: is a new hook to update state while a Transition is in progress. It returns the state, and a set function that can be called inside a transition to “optimistically” update the state to expected final value immediately while the Transition completes in the background. When the transition finishes, the state is updated to the new value.
-   `use`: is a new API that allows reading resources in render. In React 19, `use` accepts a promise or Context. If provided a promise, `use` will suspend until a value is resolved. `use` can only be used in render but can be called conditionally.
-   `ref` as a prop: Refs can now be used as props, removing the need for `forwardRef`.
-   **Suspense sibling pre-warming**: When a component suspends, React will immediately commit the fallback of the nearest Suspense boundary, without waiting for the entire sibling tree to render. After the fallback commits, React will schedule another render for the suspended siblings to “pre-warm” lazy requests.

##### React DOM Client

-   `<form> action` prop: Form Actions allow you to manage forms automatically and integrate with `useFormStatus`. When a `<form> action` succeeds, React will automatically reset the form for uncontrolled components. The form can be reset manually with the new `requestFormReset` API.
-   `<button> and <input> formAction` prop: Actions can be passed to the `formAction` prop to configure form submission behavior. This allows using different Actions depending on the input.
-   `useFormStatus`: is a new hook that provides the status of the parent `<form> action`, as if the form was a Context provider. The hook returns the values: `pending`, `data`, `method`, and `action`.
-   Support for Document Metadata: We’ve added support for rendering document metadata tags in components natively. React will automatically hoist them into the `<head>` section of the document.
-   Support for Stylesheets: React 19 will ensure stylesheets are inserted into the `<head>` on the client before revealing the content of a Suspense boundary that depends on that stylesheet.
-   Support for async scripts: Async scripts can be rendered anywhere in the component tree and React will handle ordering and deduplication.
-   Support for preloading resources: React 19 ships with `preinit`, `preload`, `prefetchDNS`, and `preconnect` APIs to optimize initial page loads by moving discovery of additional resources like fonts out of stylesheet loading. They can also be used to prefetch resources used by an anticipated navigation.

##### React DOM Server

-   Added `prerender` and `prerenderToNodeStream` APIs for static site generation. They are designed to work with streaming environments like Node.js Streams and Web Streams. Unlike `renderToString`, they wait for data to load for HTML generation.

##### React Server Components

-   RSC features such as directives, server components, and server functions are now stable. This means libraries that ship with Server Components can now target React 19 as a peer dependency with a react-server export condition for use in frameworks that support the Full-stack React Architecture. The underlying APIs used to implement a React Server Components bundler or framework do not follow semver and may break between minors in React 19.x. See [docs](https://19.react.dev/reference/rsc/server-components) for how to support React Server Components.

##### Deprecations

-   Deprecated: `element.ref` access: React 19 supports ref as a prop, so we’re deprecating `element.ref` in favor of `element.props.ref`. Accessing will result in a warning.
-   `react-test-renderer`: In React 19, react-test-renderer logs a deprecation warning and has switched to concurrent rendering for web usage. We recommend migrating your tests to  [@&#8203;testing-library/react](https://testing-library.com/docs/react-testing-library/intro/) or [@&#8203;testing-library/react-native](https://testing-library.com/docs/react-native-testing-library/intro)

##### Breaking Changes

React 19 brings in a number of breaking changes, including the removals of long-deprecated APIs. We recommend first upgrading to `18.3.1`, where we've added additional deprecation warnings. Check out the [upgrade guide](https://19.react.dev/blog/2024/04/25/react-19-upgrade-guide) for more details and guidance on codemodding.

##### React

-   New JSX Transform is now required: We introduced [a new JSX transform](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) in 2020 to improve bundle size and use JSX without importing React. In React 19, we’re adding additional improvements like using ref as a prop and JSX speed improvements that require the new transform.
-   Errors in render are not re-thrown: Errors that are not caught by an Error Boundary are now reported to window.reportError. Errors that are caught by an Error Boundary are reported to console.error. We’ve introduced `onUncaughtError` and `onCaughtError` methods to `createRoot` and `hydrateRoot` to customize this error handling.
-   Removed: `propTypes`: Using `propTypes` will now be silently ignored. If required, we recommend migrating to TypeScript or another type-checking solution.
-   Removed: `defaultProps` for functions: ES6 default parameters can be used in place. Class components continue to support `defaultProps` since there is no ES6 alternative.
-   Removed: `contextTypes` and `getChildContext`: Legacy Context for class components has been removed in favor of the `contextType` API.
-   Removed: string refs: Any usage of string refs need to be migrated to ref callbacks.
-   Removed: Module pattern factories: A rarely used pattern that can be migrated to regular functions.
-   Removed: `React.createFactory`: Now that JSX is broadly supported, all `createFactory` usage can be migrated to JSX components.
-   Removed: `react-test-renderer/shallow`: This has been a re-export of [react-shallow-renderer](https://github.com/enzymejs/react-shallow-renderer) since React 18. If needed, you can continue to use the third-party package directly. We recommend using [@&#8203;testing-library/react](https://testing-library.com/docs/react-testing-library/intro/) or [@&#8203;testing-library/react-native](https://testing-library.com/docs/react-native-testing-library/intro) instead.

##### React DOM

-   Removed: `react-dom/test-utils`: We’ve moved `act` from `react-dom/test-utils` to react. All other utilities have been removed.
-   Removed: `ReactDOM`.`render`, `ReactDOM`.`hydrate`: These have been removed in favor of the concurrent equivalents: `ReactDOM`.`createRoot` and `ReactDOM.hydrateRoot`.
-   Removed: `unmountComponentAtNode`: Removed in favor of `root.unmount()`.
-   Removed: `ReactDOM`.`findDOMNode`: You can replace `ReactDOM`.`findDOMNode` with DOM Refs.

##### Notable Changes

##### React

-   `<Context>` as a provider: You can now render `<Context>` as a provider instead of `<Context.Provider>`.
-   Cleanup functions for refs: When the component unmounts, React will call the cleanup function returned from the ref callback.
-   `useDeferredValue` initial value argument: When provided, `useDeferredValue` will return the initial value for the initial render of a component, then schedule a re-render in the background with the `deferredValue` returned.
-   Support for Custom Elements: React 19 now passes all tests on [Custom Elements Everywhere](https://custom-elements-everywhere.com/).
-   StrictMode changes: `useMemo` and `useCallback` will now reuse the memoized results from the first render, during the second render. Additionally, StrictMode will now double-invoke ref callback functions on initial mount.
-   UMD builds removed: To load React 19 with a script tag, we recommend using an ESM-based CDN such as [esm.sh](http://esm.sh).

##### React DOM

-   Diffs for hydration errors: In the case of a mismatch, React 19 logs a single error with a diff of the mismatched content.
-   Compatibility with third-party scripts and extensions: React will now force a client re-render to fix up any mismatched content caused by elements inserted by third-party JS.

##### TypeScript Changes

The most common changes can be codemodded with `npx types-react-codemod@latest preset-19 ./path-to-your-react-ts-files`.

-   Removed deprecated TypeScript types:
    -   `ReactChild` (replacement: `React.ReactElement | number | string)`
    -   `ReactFragment` (replacement: `Iterable<React.ReactNode>`)
    -   `ReactNodeArray` (replacement: `ReadonlyArray<React.ReactNode>`)
    -   `ReactText` (replacement: `number | string`)
    -   `VoidFunctionComponent` (replacement: `FunctionComponent`)
    -   `VFC` (replacement: `FC`)
    -   Moved to `prop-types`: `Requireable`, `ValidationMap`, `Validator`, `WeakValidationMap`
    -   Moved to `create-react-class`: `ClassicComponentClass`, `ClassicComponent`, `ClassicElement`, `ComponentSpec`, `Mixin`, `ReactChildren`, `ReactHTML`, `ReactSVG`, `SFCFactory`
-   Disallow implicit return in refs: refs can now accept cleanup functions. When you return something else, we can’t tell if you intentionally returned something not meant to clean up or returned the wrong value. Implicit returns of anything but functions will now error.
-   Require initial argument to `useRef`: The initial argument is now required to match `useState`, `createContext` etc
-   Refs are mutable by default: Ref objects returned from `useRef()` are now always mutable instead of sometimes being immutable. This feature was too confusing for users and conflicted with legit cases where refs were managed by React and manually written to.
-   Strict `ReactElement` typing: The props of React elements now default to `unknown` instead of `any` if the element is typed as `ReactElement`
-   JSX namespace in TypeScript: The global `JSX` namespace is removed to improve interoperability with other libraries using JSX. Instead, the JSX namespace is available from the React package: `import { JSX } from 'react'`
-   Better `useReducer` typings: Most `useReducer` usage should not require explicit type arguments.\
    For example,
    ```diff
    -useReducer<React.Reducer<State, Action>>(reducer)
    +useReducer(reducer)
    ```
    or
    ```diff
    -useReducer<React.Reducer<State, Action>>(reducer)
    +useReducer<State, Action>(reducer)
    ```

##### All Changes

##### React

-   Add support for async Actions ([#&#8203;26621](https://github.com/facebook/react/pull/26621), [#&#8203;26726](https://github.com/facebook/react/pull/26726), [#&#8203;28078](https://github.com/facebook/react/pull/28078), [#&#8203;28097](https://github.com/facebook/react/pull/28097), [#&#8203;29226](https://github.com/facebook/react/pull/29226), [#&#8203;29618](https://github.com/facebook/react/pull/29618), [#&#8203;29670](https://github.com/facebook/react/pull/29670), [#&#8203;26716](https://github.com/facebook/react/pull/26716) by [@&#8203;acdlite](https://github.com/acdlite) and [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
-   Add `useActionState()` hook to update state based on the result of a Form Action ([#&#8203;27270](https://github.com/facebook/react/pull/27270), [#&#8203;27278](https://github.com/facebook/react/pull/27278), [#&#8203;27309](https://github.com/facebook/react/pull/27309), [#&#8203;27302](https://github.com/facebook/react/pull/27302), [#&#8203;27307](https://github.com/facebook/react/pull/27307), [#&#8203;27366](https://github.com/facebook/react/pull/27366), [#&#8203;27370](https://github.com/facebook/react/pull/27370), [#&#8203;27321](https://github.com/facebook/react/pull/27321), [#&#8203;27374](https://github.com/facebook/react/pull/27374), [#&#8203;27372](https://github.com/facebook/react/pull/27372), [#&#8203;27397](https://github.com/facebook/react/pull/27397), [#&#8203;27399](https://github.com/facebook/react/pull/27399), [#&#8203;27460](https://github.com/facebook/react/pull/27460), [#&#8203;28557](https://github.com/facebook/react/pull/28557), [#&#8203;27570](https://github.com/facebook/react/pull/27570), [#&#8203;27571](https://github.com/facebook/react/pull/27571), [#&#8203;28631](https://github.com/facebook/react/pull/28631), [#&#8203;28788](https://github.com/facebook/react/pull/28788), [#&#8203;29694](https://github.com/facebook/react/pull/29694), [#&#8203;29695](https://github.com/facebook/react/pull/29695), [#&#8203;29694](https://github.com/facebook/react/pull/29694), [#&#8203;29665](https://github.com/facebook/react/pull/29665), [#&#8203;28232](https://github.com/facebook/react/pull/28232), [#&#8203;28319](https://github.com/facebook/react/pull/28319) by [@&#8203;acdlite](https://github.com/acdlite), [@&#8203;eps1lon](https://github.com/eps1lon), and [@&#8203;rickhanlonii](https://github.com/rickhanlonii))
-   Add `use()` API to read resources in render ([#&#8203;25084](https://github.com/facebook/react/pull/25084), [#&#8203;25202](https://github.com/facebook/react/pull/25202), [#&#8203;25207](https://github.com/facebook/react/pull/25207), [#&#8203;25214](https://github.com/facebook/react/pull/25214), [#&#8203;25226](https://github.com/facebook/react/pull/25226), [#&#8203;25247](https://github.com/facebook/react/pull/25247), [#&#8203;25539](https://github.com/facebook/react/pull/25539), [#&#8203;25538](https://github.com/facebook/react/pull/25538), [#&#8203;25537](https://github.com/facebook/react/pull/25537), [#&#8203;25543](https://github.com/facebook/react/pull/25543), [#&#8203;25561](https://github.com/facebook/react/pull/25561), [#&#8203;25620](https://github.com/facebook/react/pull/25620), [#&#8203;25615](https://github.com/facebook/react/pull/25615), [#&#8203;25922](https://github.com/facebook/react/pull/25922), [#&#8203;25641](https://github.com/facebook/react/pull/25641), [#&#8203;25634](https://github.com/facebook/react/pull/25634), [#&#8203;26232](https://github.com/facebook/react/pull/26232), [#&#8203;26536](https://github.com/facebook/react/pull/26535), [#&#8203;26739](https://github.com/facebook/react/pull/26739), [#&#8203;28233](https://github.com/facebook/react/pull/28233) by [@&#8203;acdlite](https://github.com/acdlite), [@&#8203;MofeiZ](https://github.com/mofeiZ), [@&#8203;sebmarkbage](https://github.com/sebmarkbage), [@&#8203;sophiebits](https://github.com/sophiebits), [@&#8203;eps1lon](https://github.com/eps1lon), and [@&#8203;hansottowirtz](https://github.com/hansottowirtz))
-   Add `useOptimistic()` hook to display mutated state optimistically during an async mutation ([#&#8203;26740](https://github.com/facebook/react/pull/26740), [#&#8203;26772](https://github.com/facebook/react/pull/26772), [#&#8203;27277](https://github.com/facebook/react/pull/27277), [#&#8203;27453](https://github.com/facebook/react/pull/27453), [#&#8203;27454](https://github.com/facebook/react/pull/27454), [#&#8203;27936](https://github.com/facebook/react/pull/27936) by [@&#8203;acdlite](https://github.com/acdlite))
-   Added an `initialValue` argument to `useDeferredValue()` hook ([#&#8203;27500](https://github.com/facebook/react/pull/27500), [#&#8203;27509](https://github.com/facebook/react/pull/27509), [#&#8203;27512](https://github.com/facebook/react/pull/27512), [#&#8203;27888](https://github.com/facebook/react/pull/27888), [#&#8203;27550](https://github.com/facebook/react/pull/27550) by [@&#8203;acdlite](https://github.com/acdlite))
-   Support refs as props, warn on `element.ref` access ([#&#8203;28348](https://github.com/facebook/react/pull/28348), [#&#8203;28464](https://github.com/facebook/react/pull/28464), [#&#8203;28731](https://github.com/facebook/react/pull/28731) by [@&#8203;acdlite](https://github.com/acdlite))
-   Support Custom Elements ([#&#8203;22184](https://github.com/facebook/react/pull/22184), [#&#8203;26524](https://github.com/facebook/react/pull/26524), [#&#8203;26523](https://github.com/facebook/react/pull/26523), [#&#8203;27511](https://github.com/facebook/react/pull/27511), [#&#8203;24541](https://github.com/facebook/react/pull/24541) by [@&#8203;josepharhar](https://github.com/josepharhar), [@&#8203;sebmarkbage](https://github.com/sebmarkbage), [@&#8203;gnoff](https://github.com/gnoff) and [@&#8203;eps1lon](https://github.com/eps1lon))
-   Add ref cleanup function ([#&#8203;25686](https://github.com/facebook/react/pull/25686), [#&#8203;28883](https://github.com/facebook/react/pull/28883), [#&#8203;28910](https://github.com/facebook/react/pull/28910)  by [@&#8203;sammy-SC](https://github.com/sammy-SC), [@&#8203;jackpope](https://github.com/jackpope), and [@&#8203;kassens](https://github.com/kassens))
-   Sibling pre-rendering replaced by sibling pre-warming ([#&#8203;26380](https://github.com/facebook/react/pull/26380), [#&#8203;26549](https://github.com/facebook/react/pull/26549), [#&#8203;30761](https://github.com/facebook/react/pull/30761), [#&#8203;30800](https://github.com/facebook/react/pull/30800), [#&#8203;30762](https://github.com/facebook/react/pull/30762), [#&#8203;30879](https://github.com/facebook/react/pull/30879), [#&#8203;30934](https://github.com/facebook/react/pull/30934), [#&#8203;30952](https://github.com/facebook/react/pull/30952), [#&#8203;31056](https://github.com/facebook/react/pull/31056), [#&#8203;31452](https://github.com/facebook/react/pull/31452) by [@&#8203;sammy-SC](https://github.com/sammy-SC), [@&#8203;acdlite](https://github.com/acdlite), [@&#8203;gnoff](https://github.com/gnoff), [@&#8203;jackpope](https://github.com/jackpope), [@&#8203;rickhanlonii](https://github.com/rickhanlonii))
-   Don’t rethrow errors at the root ([#&#8203;28627](https://github.com/facebook/react/pull/28627), [#&#8203;28641](https://github.com/facebook/react/pull/28641) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
-   Batch sync discrete, continuous, and default lanes ([#&#8203;25700](https://github.com/facebook/react/pull/25700) by [@&#8203;tyao1](https://github.com/tyao1))
-   Switch `<Context>` to mean `<Context.Provider>` ([#&#8203;28226](https://github.com/facebook/react/pull/28226) by [@&#8203;gaearon](https://github.com/gaearon))
-   Changes to *StrictMode*
    -   Handle `info`, `group`, and `groupCollapsed` in *StrictMode* logging ([#&#8203;25172](https://github.com/facebook/react/pull/25172) by [@&#8203;timneutkens](https://github.com/timneutkens))
    -   Refs are now attached/detached/attached in *StrictMode* ([#&#8203;25049](https://github.com/facebook/react/pull/25049) by [@&#8203;sammy-SC](https://github.com/sammy-SC))
    -   Fix `useSyncExternalStore()` hydration in *StrictMode* ([#&#8203;26791](https://github.com/facebook/react/pull/26791) by [@&#8203;sophiebits](https://github.com/sophiebits))
    -   Always trigger `componentWillUnmount()` in *StrictMode* ([#&#8203;26842](https://github.com/facebook/react/pull/26842) by [@&#8203;tyao1](https://github.com/tyao1))
    -   Restore double invoking `useState()` and `useReducer()` initializer functions in *StrictMode* ([#&#8203;28248](https://github.com/facebook/react/pull/28248) by [@&#8203;eps1lon](https://github.com/eps1lon))
    -   Reuse memoized result from first pass ([#&#8203;25583](https://github.com/facebook/react/pull/25583) by [@&#8203;acdlite](https://github.com/acdlite))
    -   Fix `useId()` in *StrictMode* ([#&#8203;25713](https://github.com/facebook/react/pull/25713) by [@&#8203;gnoff](https://github.com/gnoff))
    -   Add component name to *StrictMode* error messages ([#&#8203;25718](https://github.com/facebook/react/pull/25718) by [@&#8203;sammy-SC](https://github.com/sammy-SC))
-   Add support for rendering BigInt ([#&#8203;24580](https://github.com/facebook/react/pull/24580) by [@&#8203;eps1lon](https://github.com/eps1lon))
-   `act()` no longer checks `shouldYield` which can be inaccurate in test environments ([#&#8203;26317](https://github.com/facebook/react/pull/26317) by [@&#8203;acdlite](https://github.com/acdlite))
-   Warn when keys are spread with props ([#&#8203;25697](https://github.com/facebook/react/pull/25697), [#&#8203;26080](https://github.com/facebook/react/pull/26080) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage) and [@&#8203;kassens](https://github.com/kassens))
-   Generate sourcemaps for production build artifacts ([#&#8203;26446](https://github.com/facebook/react/pull/26446) by [@&#8203;markerikson](https://github.com/markerikson))
-   Improve stack diffing algorithm ([#&#8203;27132](https://github.com/facebook/react/pull/27132) by [@&#8203;KarimP](https://github.com/KarimP))
-   Suspense throttling lowered from 500ms to 300ms ([#&#8203;26803](https://github.com/facebook/react/pull/26803) by [@&#8203;acdlite](https://github.com/acdlite))
-   Lazily propagate context changes ([#&#8203;20890](https://github.com/facebook/react/pull/20890) by [@&#8203;acdlite](https://github.com/acdlite) and [@&#8203;gnoff](https://github.com/gnoff))
-   Immediately rerender pinged fiber ([#&#8203;25074](https://github.com/facebook/react/pull/25074) by [@&#8203;acdlite](https://github.com/acdlite))
-   Move update scheduling to microtask ([#&#8203;26512](https://github.com/facebook/react/pull/26512) by [@&#8203;acdlite](https://github.com/acdlite))
-   Consistently apply throttled retries ([#&#8203;26611](https://github.com/facebook/react/pull/26611), [#&#8203;26802](https://github.com/facebook/react/pull/26802) by [@&#8203;acdlite](https://github.com/acdlite))
-   Suspend Thenable/Lazy if it's used in React.Children ([#&#8203;28284](https://github.com/facebook/react/pull/28284) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
-   Detect infinite update loops caused by render phase updates ([#&#8203;26625](https://github.com/facebook/react/pull/26625) by [@&#8203;acdlite](https://github.com/acdlite))
-   Update conditional hooks warning ([#&#8203;29626](https://github.com/facebook/react/pull/29626) by [@&#8203;sophiebits](https://github.com/sophiebits))
-   Update error URLs to go to new docs ([#&#8203;27240](https://github.com/facebook/react/pull/27240) by [@&#8203;rickhanlonii](https://github.com/rickhanlonii))
-   Rename the `react.element` symbol to `react.transitional.element` ([#&#8203;28813](https://github.com/facebook/react/pull/28813) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
-   Fix crash when suspending in shell during `useSyncExternalStore()` re-render ([#&#8203;27199](https://github.com/facebook/react/pull/27199) by [@&#8203;acdlite](https://github.com/acdlite))
-   Fix incorrect “detected multiple renderers" error in tests ([#&#8203;22797](https://github.com/facebook/react/pull/22797) by [@&#8203;eps1lon](https://github.com/eps1lon))
-   Fix bug where effect cleanup may be called twice after bailout ([#&#8203;26561](https://github.com/facebook/react/pull/26561) by [@&#8203;acdlite](https://github.com/acdlite))
-   Fix suspending in shell during discrete update ([#&#8203;25495](https://github.com/facebook/react/pull/25495) by [@&#8203;acdlite](https://github.com/acdlite))
-   Fix memory leak after repeated setState bailouts ([#&#8203;25309](https://github.com/facebook/react/pull/25309) by [@&#8203;acdlite](https://github.com/acdlite))
-   Fix `useSyncExternalStore()` dropped update when state is dispatched in render phase ([#&#8203;25578](https://github.com/facebook/react/pull/25578) by [@&#8203;pandaiolo](https://github.com/pandaiolo))
-   Fix logging when rendering a lazy fragment ([#&#8203;30372](https://github.com/facebook/react/pull/30372) by [@&#8203;tom-sherman](https://github.com/tom-sherman))
-   Remove string refs ([#&#8203;25383](https://github.com/facebook/react/pull/25383), [#&#8203;28322](https://github.com/facebook/react/pull/28322) by [@&#8203;eps1lon](https://github.com/eps1lon) and [@&#8203;acdlite](https://github.com/acdlite))
-   Remove Legacy Context ([#&#8203;30319](https://github.com/facebook/react/issues/30319) by [@&#8203;kassens](https://github.com/kassens))
-   Remove `RefreshRuntime.findAffectedHostInstances` ([#&#8203;30538](https://github.com/facebook/react/pull/30538) by [@&#8203;gaearon](https://github.com/gaearon))
-   Remove client caching from `cache()` API ([#&#8203;27977](https://github.com/facebook/react/pull/27977), [#&#8203;28250](https://github.com/facebook/react/pull/28250) by [@&#8203;acdlite](https://github.com/acdlite) and [@&#8203;gnoff](https://github.com/gnoff))
-   Remove `propTypes` ([#&#8203;28324](https://github.com/facebook/react/pull/28324), [#&#8203;28326](https://github.com/facebook/react/pull/28326) by [@&#8203;gaearon](https://github.com/gaearon))
-   Remove `defaultProps` support, except for classes ([#&#8203;28733](https://github.com/facebook/react/pull/28733) by [@&#8203;acdlite](https://github.com/acdlite))
-   Remove UMD builds ([#&#8203;28735](https://github.com/facebook/react/pull/28735) by [@&#8203;gnoff](https://github.com/gnoff))
-   Remove delay for non-transition updates ([#&#8203;26597](https://github.com/facebook/react/pull/26597) by [@&#8203;acdlite](https://github.com/acdlite))
-   Remove `createFactory` ([#&#8203;27798](https://github.com/facebook/react/pull/27798) by [@&#8203;kassens](https://github.com/kassens))

##### React DOM

-   Adds Form Actions to handle form submission ([#&#8203;26379](https://github.com/facebook/react/pull/26379), [#&#8203;26674](https://github.com/facebook/react/pull/26674), [#&#8203;26689](https://github.com/facebook/react/pull/26689), [#&#8203;26708](https://github.com/facebook/react/pull/26708), [#&#8203;26714](https://github.com/facebook/react/pull/26714),  [#&#8203;26735](https://github.com/facebook/react/pull/26735), [#&#8203;26846](https://github.com/facebook/react/pull/26846), [#&#8203;27358](https://github.com/facebook/react/pull/27358),  [#&#8203;28056](https://github.com/facebook/react/pull/28056) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage), [@&#8203;acdlite](https://github.com/acdlite), and [@&#8203;jupapios](https://github.com/jupapios))
-   Add `useFormStatus()` hook to provide status information of the last form submission ([#&#8203;26719](https://github.com/facebook/react/pull/26719), [#&#8203;26722](https://github.com/facebook/react/pull/26722), [#&#8203;26788](https://github.com/facebook/react/pull/26788),  [#&#8203;29019](https://github.com/facebook/react/pull/29019), [#&#8203;28728](https://github.com/facebook/react/pull/28728), [#&#8203;28413](https://github.com/facebook/react/pull/28413) by [@&#8203;acdlite](https://github.com/acdlite) and [@&#8203;eps1lon](https://github.com/eps1lon))
-   Support for Document Metadata. Adds `preinit`, `preinitModule`, `preconnect`, `prefetchDNS`, `preload`, and `preloadModule` APIs.
    -   [#&#8203;25060](https://github.com/facebook/react/pull/25060), [#&#8203;25243](https://github.com/facebook/react/pull/25243), [#&#8203;25388](https://github.com/facebook/react/pull/25388), [#&#8203;25432](https://github.com/facebook/react/pull/25432), [#&#8203;25436](https://github.com/facebook/react/pull/25436), [#&#8203;25426](https://github.com/facebook/react/pull/25426), [#&#8203;25500](https://github.com/facebook/react/pull/25500), [#&#8203;25480](https://github.com/facebook/react/pull/25480), [#&#8203;25508](https://github.com/facebook/react/pull/25508), [#&#8203;25515](https://github.com/facebook/react/pull/25515), [#&#8203;25514](https://github.com/facebook/react/pull/25514), [#&#8203;25532](https://github.com/facebook/react/pull/25532), [#&#8203;25536](https://github.com/facebook/react/pull/25536), [#&#8203;25534](https://github.com/facebook/react/pull/25534), [#&#8203;25546](https://github.com/facebook/react/pull/25546), [#&#8203;25559](https://github.com/facebook/react/pull/25559), [#&#8203;25569](https://github.com/facebook/react/pull/25569), [#&#8203;25599](https://github.com/facebook/react/pull/25599), [#&#8203;25689](https://github.com/facebook/react/pull/25689), [#&#8203;26106](https://github.com/facebook/react/pull/26106), [#&#8203;26152](https://github.com/facebook/react/pull/26152), [#&#8203;26239](https://github.com/facebook/react/pull/26239), [#&#8203;26237](https://github.com/facebook/react/pull/26237), [#&#8203;26280](https://github.com/facebook/react/pull/26280), [#&#8203;26154](https://github.com/facebook/react/pull/26154), [#&#8203;26256](https://github.com/facebook/react/pull/26256), [#&#8203;26353](https://github.com/facebook/react/pull/26353), [#&#8203;26427](https://github.com/facebook/react/pull/26427), [#&#8203;26450](https://github.com/facebook/react/pull/26450), [#&#8203;26502](https://github.com/facebook/react/pull/26502),  [#&#8203;26514](https://github.com/facebook/react/pull/26514), [#&#8203;26531](https://github.com/facebook/react/pull/26531), [#&#8203;26532](https://github.com/facebook/react/pull/26532), [#&#8203;26557](https://github.com/facebook/react/pull/26557), [#&#8203;26871](https://github.com/facebook/react/pull/26871), [#&#8203;26881](https://github.com/facebook/react/pull/26881), [#&#8203;26877](https://github.com/facebook/react/pull/26877), [#&#8203;26873](https://github.com/facebook/react/pull/26873), [#&#8203;26880](https://github.com/facebook/react/pull/26880), [#&#8203;26942](https://github.com/facebook/react/pull/26942), [#&#8203;26938](https://github.com/facebook/react/pull/26938), [#&#8203;26940](https://github.com/facebook/react/pull/26940), [#&#8203;26939](https://github.com/facebook/react/pull/26939), [#&#8203;27030](https://github.com/facebook/react/pull/27030), [#&#8203;27201](https://github.com/facebook/react/pull/27201), [#&#8203;27212](https://github.com/facebook/react/pull/27212), [#&#8203;27217](https://github.com/facebook/react/pull/27217), [#&#8203;27218](https://github.com/facebook/react/pull/27218), [#&#8203;27220](https://github.com/facebook/react/pull/27220), [#&#8203;27224](https://github.com/facebook/react/pull/27224), [#&#8203;27223](https://github.com/facebook/react/pull/27223), [#&#8203;27269](https://github.com/facebook/react/pull/27269), [#&#8203;27260](https://github.com/facebook/react/pull/27260), [#&#8203;27347](https://github.com/facebook/react/pull/27347), [#&#8203;27346](https://github.com/facebook/react/pull/27346), [#&#8203;27361](https://github.com/facebook/react/pull/27361), [#&#8203;27400](https://github.com/facebook/react/pull/27400), [#&#8203;27541](https://github.com/facebook/react/pull/27541), [#&#8203;27610](https://github.com/facebook/react/pull/27610), [#&#8203;28110](https://github.com/facebook/react/pull/28110), [#&#8203;29693](https://github.com/facebook/react/pull/29693), [#&#8203;29732](https://github.com/facebook/react/pull/29732), [#&#8203;29811](https://github.com/facebook/react/pull/29811), [#&#8203;27586](https://github.com/facebook/react/pull/27586), [#&#8203;28069](https://github.com/facebook/react/pull/28069) by [@&#8203;gnoff](https://github.com/gnoff), [@&#8203;sebmarkbage](https://github.com/sebmarkbage), [@&#8203;acdlite](https://github.com/acdlite), [@&#8203;kassens](https://github.com/kassens), [@&#8203;sokra](https://github.com/sokra), [@&#8203;sweetliquid](https://github.com/sweetliquid)
-   Add `fetchPriority` to `<img>` and `<link>` ([#&#8203;25927](https://github.com/facebook/react/pull/25927) by [@&#8203;styfle](https://github.com/styfle))
-   Add support for SVG `transformOrigin` prop ([#&#8203;26130](https://github.com/facebook/react/pull/26130) by [@&#8203;arav-ind](https://github.com/arav-ind))
-   Add support for `onScrollEnd` event ([#&#8203;26789](https://github.com/facebook/react/pull/26789) by [@&#8203;devongovett](https://github.com/devongovett))
-   Allow `<hr>` as child of `<select>` ([#&#8203;27632](https://github.com/facebook/react/pull/27632) by [@&#8203;SouSingh](https://github.com/SouSingh))
-   Add support for Popover API ([#&#8203;27981](https://github.com/facebook/react/pull/27981) by [@&#8203;eps1lon](https://github.com/eps1lon))
-   Add support for `inert` ([#&#8203;24730](https://github.com/facebook/react/pull/24730) by [@&#8203;eps1lon](https://github.com/eps1lon))
-   Add support for `imageSizes` and `imageSrcSet` ([#&#8203;22550](https://github.com/facebook/react/pull/22550) by [@&#8203;eps1lon](https://github.com/eps1lon))
-   Synchronously flush transitions in popstate events ([#&#8203;26025](https://github.com/facebook/react/pull/26025), [#&#8203;27559](https://github.com/facebook/react/pull/27559), [#&#8203;27505](https://github.com/facebook/react/pull/27505), [#&#8203;30759](https://github.com/facebook/react/pull/30759) by [@&#8203;tyao1](https://github.com/tyao1) and [@&#8203;acdlite](https://github.com/acdlite))
-   `flushSync` exhausts queue even if something throws ([#&#8203;26366](https://github.com/facebook/react/pull/26366) by [@&#8203;acdlite](https://github.com/acdlite))
-   Throw error if `react` and `react-dom` versions don’t match ([#&#8203;29236](https://github.com/facebook/react/pull/29236) by [@&#8203;acdlite](https://github.com/acdlite))
-   Ensure `srcset` and `src` are assigned last on `<img>` instances ([#&#8203;30340](https://github.com/facebook/react/pull/30340) by [@&#8203;gnoff](https://github.com/gnoff))
-   Javascript URLs are replaced with functions that throw errors ([#&#8203;26507](https://github.com/facebook/react/pull/26507), [#&#8203;29808](https://github.com/facebook/react/pull/29808) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage) and [@&#8203;kassens](https://github.com/kassens))
-   Treat toggle and beforetoggle as discrete events ([#&#8203;29176](https://github.com/facebook/react/pull/29176) by [@&#8203;eps1lon](https://github.com/eps1lon))
-   Filter out empty `src` and `href` attributes (unless for `<a href=”” />`) ([#&#8203;18513](https://github.com/facebook/react/pull/18513), [#&#8203;28124](https://github.com/facebook/react/pull/28124) by [@&#8203;bvaughn](https://github.com/bvaughn) and [@&#8203;eps1lon](https://github.com/eps1lon))
-   Fix unitless `scale` style property ([#&#8203;25601](https://github.com/facebook/react/pull/25601) by [@&#8203;JonnyBurger](https://github.com/JonnyBurger))
-   Fix `onChange` error message for controlled `<select>` ([#&#8203;27740](https://github.com/facebook/react/pull/27740) by [@&#8203;Biki-das](https://github.com/Biki-das))
-   Fix focus restore in child windows after element reorder ([#&#8203;30951](https://github.com/facebook/react/pull/30951) by [@&#8203;ling1726](https://github.com/ling1726))
-   Remove `render`, `hydrate`, `findDOMNode`, `unmountComponentAtNode`, `unstable_createEventHandle`, `unstable_renderSubtreeIntoContainer`, and `unstable_runWithPriority`. Move `createRoot` and `hydrateRoot` to `react-dom/client`. ([#&#8203;28271](https://github.com/facebook/react/pull/28271) by [@&#8203;gnoff](https://github.com/gnoff))
-   Remove `test-utils` ([#&#8203;28541](https://github.com/facebook/react/pull/28541) by [@&#8203;eps1lon](https://github.com/eps1lon))
-   Remove `unstable_flushControlled` ([#&#8203;26397](https://github.com/facebook/react/pull/26397) by [@&#8203;kassens](https://github.com/kassens))
-   Remove legacy mode ([#&#8203;28468](https://github.com/facebook/react/pull/28468) by [@&#8203;gnoff](https://github.com/gnoff))
-   Remove `renderToStaticNodeStream()` ([#&#8203;28873](https://github.com/facebook/react/pull/28873) by [@&#8203;gnoff](https://github.com/gnoff))
-   Remove `unstable_renderSubtreeIntoContainer` ([#&#8203;29771](https://github.com/facebook/react/pull/29771) by [@&#8203;kassens](https://github.com/kassens))

##### React DOM Server

-   Stable release of React Server Components ([Many, many PRs](https://github.com/facebook/react/pulls?q=is%3Apr+is%3Aclosed+%5BFlight%5D+in%3Atitle+created%3A%3C2024-12-01+) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage), [@&#8203;acdlite](https://github.com/acdlite), [@&#8203;gnoff](https://github.com/gnoff), [@&#8203;sammy-SC](https://github.com/sammy-SC), [@&#8203;gaearon](https://github.com/gaearon), [@&#8203;sophiebits](https://github.com/sophiebits), [@&#8203;unstubbable](https://github.com/unstubbable), [@&#8203;lubieowoce](https://github.com/lubieowoce))
-   Support Server Actions ([#&#8203;26124](https://github.com/facebook/react/pull/26124), [#&#8203;26632](https://github.com/facebook/react/pull/26632), [#&#8203;27459](https://github.com/facebook/react/pull/27459) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage) and [@&#8203;acdlite](https://github.com/acdlite))
-   Changes to SSR
    -   Add external runtime which bootstraps hydration on the client for binary transparency ([#&#8203;25437](https://github.com/facebook/react/pull/25437), [#&#8203;26169](https://github.com/facebook/react/pull/26169), [#&#8203;25499](https://github.com/facebook/react/pull/25499) by [@&#8203;MofeiZ](https://github.com/mofeiZ) and [@&#8203;acdlite](https://github.com/acdlite))
    -   Support subresource integrity for `bootstrapScripts` and `bootstrapModules` ([#&#8203;25104](https://github.com/facebook/react/pull/25104) by [@&#8203;gnoff](https://github.com/gnoff))
    -   Fix null bytes written at text chunk boundaries ([#&#8203;26228](https://github.com/facebook/react/pull/26228) by [@&#8203;sophiebits](https://github.com/sophiebits))
    -   Fix logic around attribute serialization ([#&#8203;26526](https://github.com/facebook/react/pull/26526) by [@&#8203;gnoff](https://github.com/gnoff))
    -   Fix precomputed chunk cleared on Node 18 ([#&#8203;25645](https://github.com/facebook/react/pull/25645) by [@&#8203;feedthejim](https://github.com/feedthejim))
    -   Optimize end tag chunks ([#&#8203;27522](https://github.com/facebook/react/pull/27522) by [@&#8203;yujunjung](https://github.com/yujunjung))
    -   Gracefully handle suspending in DOM configs ([#&#8203;26768](https://github.com/facebook/react/pull/26768) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
    -   Check for nullish values on ReactCustomFormAction ([#&#8203;26770](https://github.com/facebook/react/pull/26770) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
    -   Preload `bootstrapModules`, `bootstrapScripts`, and update priority queue ([#&#8203;26754](https://github.com/facebook/react/pull/26754), [#&#8203;26753](https://github.com/facebook/react/pull/26753), [#&#8203;27190](https://github.com/facebook/react/pull/27190), [#&#8203;27189](https://github.com/facebook/react/pull/27189) by [@&#8203;gnoff](https://github.com/gnoff))
    -   Client render the nearest child or parent suspense boundary if replay errors or is aborted ([#&#8203;27386](https://github.com/facebook/react/pull/27386) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
    -   Don't bail out of flushing if we still have pending root tasks ([#&#8203;27385](https://github.com/facebook/react/pull/27385) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
    -   Ensure Resumable State is Serializable ([#&#8203;27388](https://github.com/facebook/react/pull/27388) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
    -   Remove extra render pass when reverting to client render ([#&#8203;26445](https://github.com/facebook/react/pull/26445) by [@&#8203;acdlite](https://github.com/acdlite))
    -   Fix unwinding context during selective hydration ([#&#8203;25876](https://github.com/facebook/react/pull/25876) by [@&#8203;tyao1](https://github.com/tyao1))
    -   Stop flowing and then abort if a stream is cancelled ([#&#8203;27405](https://github.com/facebook/react/pull/27405) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
    -   Pass cancellation reason to abort ([#&#8203;27536](https://github.com/facebook/react/pull/27536) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
    -   Add `onHeaders` entrypoint option ([#&#8203;27641](https://github.com/facebook/react/pull/27641), [#&#8203;27712](https://github.com/facebook/react/pull/27712) by [@&#8203;gnoff](https://github.com/gnoff))
    -   Escape `<style>` and `<script>` textContent to enable rendering inner content without dangerouslySetInnerHTML ([#&#8203;28870](https://github.com/facebook/react/pull/28870), [#&#8203;28871](https://github.com/facebook/react/pull/28871) by [@&#8203;gnoff](https://github.com/gnoff))
    -   Fallback to client replaying actions for Blob serialization ([#&#8203;28987](https://github.com/facebook/react/pull/28987) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
    -   Render Suspense fallback if boundary contains new stylesheet during sync update ([#&#8203;28965](https://github.com/facebook/react/pull/28965) by [@&#8203;gnoff](https://github.com/gnoff))
    -   Fix header length tracking ([#&#8203;30327](https://github.com/facebook/react/issues/30327) by [@&#8203;gnoff](https://github.com/gnoff))
    -   Use `srcset` to trigger load event on mount ([#&#8203;30351](https://github.com/facebook/react/issues/30351) by [@&#8203;gnoff](https://github.com/gnoff))
    -   Don't perform work when closing stream ([#&#8203;30497](https://github.com/facebook/react/issues/30497) by [@&#8203;gnoff](https://github.com/gnoff))
    -   Allow aborting during render ([#&#8203;30488](https://github.com/facebook/react/issues/30488), [#&#8203;30730](https://github.com/facebook/react/pull/30730) by [@&#8203;gnoff](https://github.com/gnoff))
    -   Start initial work immediately ([#&#8203;31079](https://github.com/facebook/react/issues/31079) by [@&#8203;gnoff](https://github.com/gnoff))
    -   A transition flowing into a dehydrated boundary no longer suspends when showing fallback ([#&#8203;27230](https://github.com/facebook/react/pull/27230) by [@&#8203;acdlite](https://github.com/acdlite))
    -   Fix selective hydration triggers false update loop error ([#&#8203;27439](https://github.com/facebook/react/pull/27439) by [@&#8203;acdlite](https://github.com/acdlite))
    -   Warn for Child Iterator of all types but allow Generator Components ([#&#8203;28853](https://github.com/facebook/react/pull/28853) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
    -   Include regular stack trace in serialized errors ([#&#8203;28684](https://github.com/facebook/react/pull/28684), [#&#8203;28738](https://github.com/facebook/react/pull/28738) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
    -   Aborting early no longer infinitely suspends ([#&#8203;24751](https://github.com/facebook/react/pull/24751) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
    -   Fix hydration warning suppression in text comparisons ([#&#8203;24784](https://github.com/facebook/react/pull/24784) by [@&#8203;gnoff](https://github.com/gnoff))
    -   Changes to error handling in SSR
        -   Add diffs to hydration warnings ([#&#8203;28502](https://github.com/facebook/react/pull/28502), [#&#8203;28512](https://github.com/facebook/react/pull/28512) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
        -   Make Error creation lazy ([#&#8203;24728](https://github.com/facebook/react/pull/24728) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
        -   Remove recoverable error when a sync update flows into a dehydrated boundary ([#&#8203;25692](https://github.com/facebook/react/pull/25692) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
        -   Don't "fix up" mismatched text content with suppressedHydrationWarning ([#&#8203;26391](https://github.com/facebook/react/pull/26391) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
        -   Fix component stacks in errors ([#&#8203;27456](https://github.com/facebook/react/pull/27456) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
        -   Add component stacks to `onError` ([#&#8203;27761](https://github.com/facebook/react/pull/27761), [#&#8203;27850](https://github.com/facebook/react/pull/27850) by [@&#8203;gnoff](https://github.com/gnoff) and [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
        -   Throw hydration mismatch errors once ([#&#8203;28502](https://github.com/facebook/react/pull/28502) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
-   Add Bun streaming server renderer ([#&#8203;25597](https://github.com/facebook/react/pull/25597) by [@&#8203;colinhacks](https://github.com/colinhacks))
-   Add nonce support to bootstrap scripts ([#&#8203;26738](https://github.com/facebook/react/pull/26738) by [@&#8203;danieltott](https://github.com/danieltott))
-   Add `crossorigin` support to bootstrap scripts ([#&#8203;26844](https://github.com/facebook/react/pull/26844) by [@&#8203;HenriqueLimas](https://github.com/HenriqueLimas))
-   Support `nonce` and `fetchpriority` in preload links ([#&#8203;26826](https://github.com/facebook/react/pull/26826) by [@&#8203;liuyenwei](https://github.com/liuyenwei))
-   Add `referrerPolicy` to `ReactDOM.preload()` ([#&#8203;27096](https://github.com/facebook/react/pull/27096) by [@&#8203;styfle](https://github.com/styfle))
-   Add server condition for `react/jsx-dev-runtime` ([#&#8203;28921](https://github.com/facebook/react/pull/28921) by [@&#8203;himself65](https://github.com/himself65))
-   Export version ([#&#8203;29596](https://github.com/facebook/react/pull/29596) by [@&#8203;unstubbable](https://github.com/unstubbable))
-   Rename the secret export of Client and Server internals ([#&#8203;28786](https://github.com/facebook/react/pull/28786), [#&#8203;28789](https://github.com/facebook/react/pull/28789) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage))
-   Remove layout effect warning on server ([#&#8203;26395](https://github.com/facebook/react/pull/26395) by [@&#8203;rickhanlonii](https://github.com/rickhanlonii))
-   Remove `errorInfo.digest` from `onRecoverableError` ([#&#8203;28222](https://github.com/facebook/react/pull/28222) by [@&#8203;gnoff](https://github.com/gnoff))

##### ReactTestRenderer

-   Add deprecation error to `react-test-renderer` on web ([#&#8203;27903](https://github.com/facebook/react/pull/27903), [#&#8203;28904](https://github.com/facebook/react/pull/28904) by [@&#8203;jackpope](https://github.com/jackpope) and [@&#8203;acdlite](https://github.com/acdlite))
-   Render with ConcurrentRoot on web ([#&#8203;28498](https://github.com/facebook/react/pull/28498) by [@&#8203;jackpope](https://github.com/jackpope))
-   Remove `react-test-renderer/shallow` export ([#&#8203;25475](https://github.com/facebook/react/pull/25475), [#&#8203;28497](https://github.com/facebook/react/pull/28497) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage) and [@&#8203;jackpope](https://github.com/jackpope))

##### React Reconciler

-   Enable suspending commits without blocking render ([#&#8203;26398](https://github.com/facebook/react/pull/26398), [#&#8203;26427](https://github.com/facebook/react/pull/26427) by [@&#8203;acdlite](https://github.com/acdlite))
-   Remove `prepareUpdate` ([#&#8203;26583](https://github.com/facebook/react/pull/26583), [#&#8203;27409](http://github.com/facebook/react/pull/27409) by [@&#8203;sebmarkbage](https://github.com/sebmarkbage) and [@&#8203;sophiebits](https://github.com/sophiebits))

##### React-Is

-   Enable tree shaking ([#&#8203;27701](https://github.com/facebook/react/pull/27701) by [@&#8203;markerikson](https://github.com/markerikson))
-   Remove `isConcurrentMode` and `isAsyncMode` methods ([#&#8203;28224](https://github.com/facebook/react/pull/28224) by [@&#8203;gaearon](https://github.com/gaearon))

##### useSyncExternalStore

-   Remove React internals access ([#&#8203;29868](https://github.com/facebook/react/pull/29868) by [@&#8203;phryneas](https://github.com/phryneas))
-   Fix stale selectors keeping previous store references ([#&#8203;25969](https://github.com/facebook/react/pull/25968) by [@&#8203;jellevoost](https://github.com/jellevoost))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS45OS4wIiwidXBkYXRlZEluVmVyIjoiMzkuMTEzLjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyJdfQ==-->

Reviewed-on: https://git.tristess.app/alexandresoro/ouca-web/pulls/6
Reviewed-by: Alexandre Soro <[email protected]>
Co-authored-by: renovate <[email protected]>
Co-committed-by: renovate <[email protected]>
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.

8 participants