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.

@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;
}

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.
@nl0
Copy link

nl0 commented Aug 26, 2022

@acdlite this looks quite exciting actually, what's the target React release to include this changeset?

@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
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