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

Async action support for React.startTransition #28097

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Jan 25, 2024

This adds support for async actions to the "isomorphic" version of startTransition (i.e. the one exported by the "react" package). Previously, async actions were only supported by the startTransition that is returned from the useTransition hook.

The interesting part about the isomorphic startTransition is that it's not associated with any particular root. It must work with updates to arbitrary roots, or even arbitrary React renderers in the same app. (For example, both React DOM and React Three Fiber.)

The idea is that React.startTransition should behave as if every root had an implicit useTransition hook, and you composed together all the startTransitions provided by those hooks. Multiple updates to the same root will be batched together. However, updates to one root will not be batched with updates to other roots.

Features like useOptimistic work the same as with the hook version.

There is one difference from from the hook version of startTransition: an error triggered inside an async action cannot be captured by an error boundary, because it's not associated with any particular part of the tree. You should handle errors the same way you would in a regular event, e.g. with a global error event handler, or with a local try/catch.

This adds support for async actions to the "isomorphic" version of
startTransition (i.e. the one exported by the "react" package).
Previously, async actions were only supported by the startTransition
that is returned from the useTransition hook.

The interesting part about the isomorphic startTransition is that it's
not associated with any particular root. It must work with updates to
arbitrary roots, or even arbitrary React renderers in the same app. (For
example, both React DOM and React Three Fiber.)

The idea is that React.startTransition should behave as if every root
had an implicit useTransition hook, and you composed together all the
startTransitions provided by those hooks. Multiple updates to the same
root will be batched together. However, updates to one root will not be
batched with updates to other roots.

Features like useOptimistic work the same as with the hook version.

There is one difference from from the hook version of startTransition:
an error triggered inside an async action cannot be captured by an error
boundary, because it's not associated with any particular part of the
tree. You should handle errors the same way you would in a regular
event, e.g. with a global error event handler, or with a
local `try/catch`.
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Jan 25, 2024
@acdlite acdlite marked this pull request as ready for review January 25, 2024 22:44
@react-sizebot
Copy link

Comparing: c7e735f...2a83d9a

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.17% 176.34 kB 176.64 kB +0.14% 54.93 kB 55.01 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js +0.17% 178.44 kB 178.74 kB +0.12% 55.57 kB 55.64 kB
facebook-www/ReactDOM-prod.classic.js +0.15% 572.79 kB 573.66 kB +0.21% 100.80 kB 101.02 kB
facebook-www/ReactDOM-prod.modern.js +0.16% 556.55 kB 557.42 kB +0.22% 97.88 kB 98.10 kB
oss-stable-semver/react/cjs/react.react-server.production.js +2.59% 28.33 kB 29.07 kB +2.46% 8.51 kB 8.72 kB
oss-stable/react/cjs/react.react-server.production.js +2.58% 28.36 kB 29.09 kB +2.46% 8.54 kB 8.75 kB
oss-stable-semver/react/cjs/react.react-server.production.min.js +2.54% 6.77 kB 6.94 kB +2.18% 2.89 kB 2.95 kB
oss-stable/react/cjs/react.react-server.production.min.js +2.53% 6.79 kB 6.96 kB +2.16% 2.91 kB 2.97 kB
oss-experimental/react/cjs/react.react-server.production.js +2.02% 36.34 kB 37.07 kB +1.90% 10.70 kB 10.90 kB
test_utils/ReactAllWarnings.js Deleted 67.55 kB 0.00 kB Deleted 16.54 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable-semver/react/cjs/react.react-server.production.js +2.59% 28.33 kB 29.07 kB +2.46% 8.51 kB 8.72 kB
oss-stable/react/cjs/react.react-server.production.js +2.58% 28.36 kB 29.09 kB +2.46% 8.54 kB 8.75 kB
oss-stable-semver/react/cjs/react.react-server.production.min.js +2.54% 6.77 kB 6.94 kB +2.18% 2.89 kB 2.95 kB
oss-stable/react/cjs/react.react-server.production.min.js +2.53% 6.79 kB 6.96 kB +2.16% 2.91 kB 2.97 kB
oss-experimental/react/cjs/react.react-server.production.js +2.02% 36.34 kB 37.07 kB +1.90% 10.70 kB 10.90 kB
oss-experimental/react/cjs/react.react-server.production.min.js +1.83% 9.29 kB 9.46 kB +1.65% 3.75 kB 3.81 kB
facebook-www/ReactServer-prod.modern.js +1.67% 14.22 kB 14.46 kB +1.44% 3.83 kB 3.88 kB
facebook-www/React-prod.modern.js +1.35% 17.54 kB 17.78 kB +1.17% 4.53 kB 4.58 kB
facebook-react-native/react/cjs/React-prod.js +1.35% 17.57 kB 17.81 kB +1.11% 4.58 kB 4.63 kB
facebook-react-native/react/cjs/React-profiling.js +1.34% 17.71 kB 17.95 kB +1.11% 4.57 kB 4.63 kB
facebook-www/React-prod.classic.js +1.33% 17.84 kB 18.08 kB +1.06% 4.62 kB 4.66 kB
facebook-www/React-profiling.modern.js +1.32% 17.98 kB 18.22 kB +1.02% 4.61 kB 4.66 kB
facebook-www/React-profiling.classic.js +1.30% 18.27 kB 18.51 kB +1.09% 4.70 kB 4.75 kB
oss-stable-semver/react/cjs/react.production.js +1.24% 31.38 kB 31.77 kB +1.29% 8.93 kB 9.05 kB
oss-stable/react/cjs/react.production.js +1.24% 31.41 kB 31.80 kB +1.27% 8.96 kB 9.08 kB
oss-stable-semver/react/cjs/react.production.min.js +1.17% 7.26 kB 7.34 kB +1.18% 2.79 kB 2.83 kB
oss-stable/react/cjs/react.production.min.js +1.17% 7.28 kB 7.37 kB +1.13% 2.82 kB 2.85 kB
oss-experimental/react/cjs/react.production.js +1.08% 36.02 kB 36.41 kB +1.13% 9.94 kB 10.06 kB
oss-experimental/react/cjs/react.production.min.js +0.98% 8.75 kB 8.84 kB +1.01% 3.27 kB 3.30 kB
oss-stable-semver/react/umd/react.profiling.min.js +0.82% 11.04 kB 11.13 kB +0.88% 4.33 kB 4.37 kB
oss-stable-semver/react/umd/react.production.min.js +0.82% 11.04 kB 11.13 kB +0.88% 4.33 kB 4.37 kB
oss-stable/react/umd/react.profiling.min.js +0.81% 11.06 kB 11.15 kB +0.85% 4.35 kB 4.39 kB
oss-stable/react/umd/react.production.min.js +0.81% 11.06 kB 11.15 kB +0.87% 4.35 kB 4.39 kB
oss-experimental/react/umd/react.profiling.min.js +0.71% 12.48 kB 12.57 kB +0.79% 4.80 kB 4.83 kB
oss-experimental/react/umd/react.production.min.js +0.71% 12.48 kB 12.57 kB +0.79% 4.80 kB 4.83 kB
oss-stable-semver/react/cjs/react.react-server.development.js +0.45% 77.21 kB 77.56 kB +0.53% 21.33 kB 21.44 kB
oss-stable/react/cjs/react.react-server.development.js +0.45% 77.24 kB 77.59 kB +0.52% 21.36 kB 21.47 kB
oss-experimental/react/cjs/react.react-server.development.js +0.41% 86.36 kB 86.71 kB +0.44% 23.98 kB 24.09 kB
oss-stable-semver/react/cjs/react.development.js +0.35% 98.65 kB 99.00 kB +0.37% 26.57 kB 26.67 kB
oss-stable/react/cjs/react.development.js +0.35% 98.68 kB 99.03 kB +0.35% 26.60 kB 26.70 kB
facebook-www/ReactServer-dev.modern.js +0.35% 107.94 kB 108.32 kB +0.45% 26.22 kB 26.34 kB
oss-experimental/react/cjs/react.development.js +0.34% 104.06 kB 104.41 kB +0.33% 27.81 kB 27.90 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-prod.js +0.31% 313.42 kB 314.39 kB +0.33% 55.46 kB 55.64 kB
oss-stable-semver/react-art/cjs/react-art.production.min.js +0.31% 99.47 kB 99.78 kB +0.34% 30.54 kB 30.64 kB
oss-stable/react-art/cjs/react-art.production.min.js +0.31% 99.52 kB 99.83 kB +0.34% 30.56 kB 30.66 kB
oss-experimental/react-art/cjs/react-art.production.min.js +0.30% 101.47 kB 101.78 kB +0.28% 31.18 kB 31.27 kB
oss-stable-semver/react/umd/react.development.js +0.30% 121.54 kB 121.90 kB +0.31% 31.23 kB 31.33 kB
oss-stable/react/umd/react.development.js +0.30% 121.56 kB 121.93 kB +0.31% 31.26 kB 31.36 kB
facebook-react-native/react/cjs/React-dev.js +0.30% 127.98 kB 128.36 kB +0.30% 31.00 kB 31.10 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-profiling.js +0.29% 329.32 kB 330.29 kB +0.34% 57.91 kB 58.11 kB
oss-experimental/react/umd/react.development.js +0.29% 127.28 kB 127.65 kB +0.30% 32.53 kB 32.63 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.production.min.js +0.28% 108.53 kB 108.83 kB +0.32% 33.33 kB 33.44 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.min.js +0.28% 108.58 kB 108.89 kB +0.32% 33.36 kB 33.47 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.production.min.js +0.28% 108.85 kB 109.16 kB +0.21% 33.47 kB 33.54 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.production.min.js +0.28% 109.16 kB 109.46 kB +0.32% 33.76 kB 33.87 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.production.min.js +0.28% 108.83 kB 109.13 kB +0.16% 33.67 kB 33.72 kB
oss-stable/react-test-renderer/umd/react-test-renderer.production.min.js +0.28% 108.88 kB 109.18 kB +0.16% 33.69 kB 33.74 kB
facebook-www/React-dev.modern.js +0.27% 139.17 kB 139.55 kB +0.23% 33.97 kB 34.04 kB
facebook-www/React-dev.classic.js +0.27% 140.39 kB 140.77 kB +0.23% 34.21 kB 34.29 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.production.min.js +0.26% 114.98 kB 115.29 kB +0.24% 35.59 kB 35.67 kB
oss-stable/react-reconciler/cjs/react-reconciler.production.min.js +0.26% 115.01 kB 115.31 kB +0.23% 35.61 kB 35.70 kB
oss-experimental/react-reconciler/cjs/react-reconciler.production.min.js +0.26% 116.92 kB 117.22 kB +0.17% 36.25 kB 36.32 kB
facebook-www/ReactART-prod.modern.js +0.25% 342.27 kB 343.14 kB +0.36% 57.95 kB 58.16 kB
facebook-www/ReactART-prod.classic.js +0.25% 353.23 kB 354.10 kB +0.38% 59.90 kB 60.13 kB
oss-stable-semver/react-art/cjs/react-art.production.js +0.25% 596.62 kB 598.09 kB +0.27% 133.51 kB 133.88 kB
oss-stable/react-art/cjs/react-art.production.js +0.25% 596.65 kB 598.12 kB +0.27% 133.54 kB 133.90 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.profiling.min.js +0.25% 124.03 kB 124.34 kB +0.18% 37.98 kB 38.05 kB
oss-stable/react-reconciler/cjs/react-reconciler.profiling.min.js +0.25% 124.06 kB 124.36 kB +0.18% 38.00 kB 38.07 kB
oss-experimental/react-art/cjs/react-art.production.js +0.24% 604.06 kB 605.52 kB +0.26% 135.30 kB 135.65 kB
oss-experimental/react-reconciler/cjs/react-reconciler.profiling.min.js +0.24% 125.97 kB 126.27 kB +0.12% 38.68 kB 38.72 kB
oss-stable-semver/react-test-renderer/cjs/react-test-renderer.production.js +0.24% 609.16 kB 610.63 kB +0.26% 136.52 kB 136.87 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.production.js +0.24% 609.19 kB 610.65 kB +0.26% 136.55 kB 136.90 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.production.js +0.24% 610.59 kB 612.06 kB +0.27% 136.87 kB 137.24 kB
oss-stable-semver/react-art/umd/react-art.production.min.js +0.22% 136.69 kB 137.00 kB +0.21% 42.66 kB 42.75 kB
oss-stable/react-art/umd/react-art.production.min.js +0.22% 136.74 kB 137.05 kB +0.21% 42.69 kB 42.78 kB
oss-experimental/react-art/umd/react-art.production.min.js +0.22% 138.69 kB 139.00 kB +0.05% 43.37 kB 43.39 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.production.js +0.21% 688.55 kB 690.02 kB +0.23% 150.51 kB 150.87 kB
oss-stable/react-reconciler/cjs/react-reconciler.production.js +0.21% 688.58 kB 690.05 kB +0.23% 150.54 kB 150.90 kB
oss-experimental/react-reconciler/cjs/react-reconciler.production.js +0.21% 696.12 kB 697.59 kB +0.22% 152.21 kB 152.55 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.profiling.js +0.20% 729.75 kB 731.22 kB +0.23% 157.87 kB 158.23 kB
oss-stable/react-reconciler/cjs/react-reconciler.profiling.js +0.20% 729.78 kB 731.25 kB +0.23% 157.90 kB 158.25 kB
test_utils/ReactAllWarnings.js Deleted 67.55 kB 0.00 kB Deleted 16.54 kB 0.00 kB

Generated by 🚫 dangerJS against 2a83d9a

@acdlite acdlite merged commit 85b296e into facebook:main Jan 26, 2024
36 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 26, 2024
This adds support for async actions to the "isomorphic" version of
startTransition (i.e. the one exported by the "react" package).
Previously, async actions were only supported by the startTransition
that is returned from the useTransition hook.

The interesting part about the isomorphic startTransition is that it's
not associated with any particular root. It must work with updates to
arbitrary roots, or even arbitrary React renderers in the same app. (For
example, both React DOM and React Three Fiber.)

The idea is that React.startTransition should behave as if every root
had an implicit useTransition hook, and you composed together all the
startTransitions provided by those hooks. Multiple updates to the same
root will be batched together. However, updates to one root will not be
batched with updates to other roots.

Features like useOptimistic work the same as with the hook version.

There is one difference from from the hook version of startTransition:
an error triggered inside an async action cannot be captured by an error
boundary, because it's not associated with any particular part of the
tree. You should handle errors the same way you would in a regular
event, e.g. with a global error event handler, or with a local
`try/catch`.

DiffTrain build for [85b296e](85b296e)
gnoff added a commit to gnoff/next.js that referenced this pull request Feb 1, 2024
- facebook/react#28183
- facebook/react#28125
- facebook/react#28157
- facebook/react#28115
- facebook/react#28124
- facebook/react#28163
- facebook/react#28164
- facebook/react#28150
- facebook/react#28159
- facebook/react#28069
- facebook/react#28110
- facebook/react#28148
- facebook/react#28116
- facebook/react#28099
- facebook/react#28100
- facebook/react#28147
- facebook/react#28128
- facebook/react#28126
- facebook/react#28139
- facebook/react#28140
- facebook/react#28141
- facebook/react#28142
- facebook/react#28113
- facebook/react#28129
- facebook/react#28114
- facebook/react#28053
- facebook/react#28091
- facebook/react#28087
- facebook/react#28112
- facebook/react#28086
- facebook/react#28101
- facebook/react#28106
- facebook/react#28117
- facebook/react#28118
- facebook/react#28105
- facebook/react#27883
- facebook/react#28111
- facebook/react#28095
- facebook/react#28108
- facebook/react#28090
- facebook/react#28089
- facebook/react#28076
- facebook/react#28074
- facebook/react#28103
- facebook/react#28098
- facebook/react#28097
- facebook/react#28068
- facebook/react#28093
- facebook/react#28094
- facebook/react#28073
- facebook/react#28084
- facebook/react#28063
- facebook/react#28085
- facebook/react#28083
- facebook/react#28065
- facebook/react#28061
- facebook/react#28077
- facebook/react#28075
- facebook/react#28078
- facebook/react#28050
- facebook/react#28011
- facebook/react#28055
- facebook/react#28066
- facebook/react#28067
- facebook/react#28010
- facebook/react#27993
- facebook/react#28052
- facebook/react#28060
- facebook/react#28059
- facebook/react#28034
- facebook/react#28033
- facebook/react#28004
- facebook/react#28051
- facebook/react#28012
- facebook/react#28001
- facebook/react#28002
- facebook/react#27995
- facebook/react#28006
- facebook/react#28005
- facebook/react#28007
- facebook/react#28008
- facebook/react#28009
- facebook/react#28000
- facebook/react#28003
- facebook/react#27997
- facebook/react#27240
- facebook/react#27977
- facebook/react#27940
- facebook/react#27939
- facebook/react#28090
- facebook/react#28089
- facebook/react#28076
- facebook/react#28074
- facebook/react#28103
- facebook/react#28098
- facebook/react#28097
- facebook/react#28068
- facebook/react#28093
- facebook/react#28094
- facebook/react#28073
- facebook/react#28084
- facebook/react#28063
- facebook/react#28085
- facebook/react#28083
- facebook/react#28065
- facebook/react#28061
- facebook/react#28077
- facebook/react#28075
- facebook/react#28078
- facebook/react#28050
- facebook/react#28011
- facebook/react#28055
- facebook/react#28066
- facebook/react#28067
- facebook/react#28010
- facebook/react#27993
- facebook/react#28052
- facebook/react#28060
- facebook/react#28059
- facebook/react#28034
- facebook/react#28033
- facebook/react#28004
- facebook/react#28051
- facebook/react#28012
- facebook/react#28001
- facebook/react#28002
- facebook/react#27995
- facebook/react#28006
- facebook/react#28005
- facebook/react#28007
- facebook/react#28008
- facebook/react#28009
- facebook/react#28000
- facebook/react#28003
- facebook/react#27997
- facebook/react#27240
- facebook/react#27977
- facebook/react#27940
- facebook/react#27939
gnoff added a commit to gnoff/next.js that referenced this pull request Feb 5, 2024
- facebook/react#28183
- facebook/react#28125
- facebook/react#28157
- facebook/react#28115
- facebook/react#28124
- facebook/react#28163
- facebook/react#28164
- facebook/react#28150
- facebook/react#28159
- facebook/react#28069
- facebook/react#28110
- facebook/react#28148
- facebook/react#28116
- facebook/react#28099
- facebook/react#28100
- facebook/react#28147
- facebook/react#28128
- facebook/react#28126
- facebook/react#28139
- facebook/react#28140
- facebook/react#28141
- facebook/react#28142
- facebook/react#28113
- facebook/react#28129
- facebook/react#28114
- facebook/react#28053
- facebook/react#28091
- facebook/react#28087
- facebook/react#28112
- facebook/react#28086
- facebook/react#28101
- facebook/react#28106
- facebook/react#28117
- facebook/react#28118
- facebook/react#28105
- facebook/react#27883
- facebook/react#28111
- facebook/react#28095
- facebook/react#28108
- facebook/react#28090
- facebook/react#28089
- facebook/react#28076
- facebook/react#28074
- facebook/react#28103
- facebook/react#28098
- facebook/react#28097
- facebook/react#28068
- facebook/react#28093
- facebook/react#28094
- facebook/react#28073
- facebook/react#28084
- facebook/react#28063
- facebook/react#28085
- facebook/react#28083
- facebook/react#28065
- facebook/react#28061
- facebook/react#28077
- facebook/react#28075
- facebook/react#28078
- facebook/react#28050
- facebook/react#28011
- facebook/react#28055
- facebook/react#28066
- facebook/react#28067
- facebook/react#28010
- facebook/react#27993
- facebook/react#28052
- facebook/react#28060
- facebook/react#28059
- facebook/react#28034
- facebook/react#28033
- facebook/react#28004
- facebook/react#28051
- facebook/react#28012
- facebook/react#28001
- facebook/react#28002
- facebook/react#27995
- facebook/react#28006
- facebook/react#28005
- facebook/react#28007
- facebook/react#28008
- facebook/react#28009
- facebook/react#28000
- facebook/react#28003
- facebook/react#27997
- facebook/react#27240
- facebook/react#27977
- facebook/react#27940
- facebook/react#27939
- facebook/react#28090
- facebook/react#28089
- facebook/react#28076
- facebook/react#28074
- facebook/react#28103
- facebook/react#28098
- facebook/react#28097
- facebook/react#28068
- facebook/react#28093
- facebook/react#28094
- facebook/react#28073
- facebook/react#28084
- facebook/react#28063
- facebook/react#28085
- facebook/react#28083
- facebook/react#28065
- facebook/react#28061
- facebook/react#28077
- facebook/react#28075
- facebook/react#28078
- facebook/react#28050
- facebook/react#28011
- facebook/react#28055
- facebook/react#28066
- facebook/react#28067
- facebook/react#28010
- facebook/react#27993
- facebook/react#28052
- facebook/react#28060
- facebook/react#28059
- facebook/react#28034
- facebook/react#28033
- facebook/react#28004
- facebook/react#28051
- facebook/react#28012
- facebook/react#28001
- facebook/react#28002
- facebook/react#27995
- facebook/react#28006
- facebook/react#28005
- facebook/react#28007
- facebook/react#28008
- facebook/react#28009
- facebook/react#28000
- facebook/react#28003
- facebook/react#27997
- facebook/react#27240
- facebook/react#27977
- facebook/react#27940
- facebook/react#27939
gnoff added a commit to gnoff/next.js that referenced this pull request Feb 6, 2024
- facebook/react#28250
- facebook/react#28225
- facebook/react#28123
- facebook/react#28240
- facebook/react#28239
- facebook/react#28245
- facebook/react#28244
- facebook/react#28238
- facebook/react#28235
- facebook/react#28221
- facebook/react#28215
- facebook/react#28214
- facebook/react#28213
- facebook/react#28212
- facebook/react#28211
- facebook/react#28247
- facebook/react#28210
- facebook/react#28186
- facebook/react#28232
- facebook/react#28169
- facebook/react#28177
- facebook/react#28170
- facebook/react#28168
- facebook/react#28122
- facebook/react#27982
- facebook/react#28217
- facebook/react#28223
- facebook/react#28208
- facebook/react#28209
- facebook/react#28200
- facebook/react#28199
- facebook/react#28198
- facebook/react#28197
- facebook/react#28196
- facebook/react#28194
- facebook/react#28192
- facebook/react#28191
- facebook/react#28182
- facebook/react#28181
- facebook/react#28180
- facebook/react#28178
- facebook/react#28201
- facebook/react#28176
- facebook/react#28162
- facebook/react#28131
- facebook/react#28190
- facebook/react#28172
- facebook/react#28171
- facebook/react#28173
- facebook/react#28174
- facebook/react#28175
- facebook/react#28136
- facebook/react#28135
- facebook/react#28134
- facebook/react#28133
- facebook/react#28132
- facebook/react#28130
- facebook/react#28202
- facebook/react#28102
- facebook/react#28161
- facebook/react#28193
- facebook/react#28195
- facebook/react#28189
- facebook/react#28160
- facebook/react#28096
- facebook/react#28183
- facebook/react#28125
- facebook/react#28157
- facebook/react#28115
- facebook/react#28124
- facebook/react#28163
- facebook/react#28164
- facebook/react#28150
- facebook/react#28159
- facebook/react#28069
- facebook/react#28110
- facebook/react#28148
- facebook/react#28116
- facebook/react#28099
- facebook/react#28100
- facebook/react#28147
- facebook/react#28128
- facebook/react#28126
- facebook/react#28139
- facebook/react#28140
- facebook/react#28141
- facebook/react#28142
- facebook/react#28113
- facebook/react#28129
- facebook/react#28114
- facebook/react#28053
- facebook/react#28091
- facebook/react#28087
- facebook/react#28112
- facebook/react#28086
- facebook/react#28101
- facebook/react#28106
- facebook/react#28117
- facebook/react#28118
- facebook/react#28105
- facebook/react#27883
- facebook/react#28111
- facebook/react#28095
- facebook/react#28108
- facebook/react#28090
- facebook/react#28089
- facebook/react#28076
- facebook/react#28074
- facebook/react#28103
- facebook/react#28098
- facebook/react#28097
- facebook/react#28068
- facebook/react#28093
- facebook/react#28094
- facebook/react#28073
- facebook/react#28084
- facebook/react#28063
- facebook/react#28085
- facebook/react#28083
- facebook/react#28065
- facebook/react#28061
- facebook/react#28077
- facebook/react#28075
- facebook/react#28078
- facebook/react#28050
- facebook/react#28011
- facebook/react#28055
- facebook/react#28066
- facebook/react#28067
- facebook/react#28010
- facebook/react#27993
- facebook/react#28052
- facebook/react#28060
- facebook/react#28059
- facebook/react#28034
- facebook/react#28033
- facebook/react#28004
- facebook/react#28051
- facebook/react#28012
- facebook/react#28001
- facebook/react#28002
- facebook/react#27995
- facebook/react#28006
- facebook/react#28005
- facebook/react#28007
- facebook/react#28008
- facebook/react#28009
- facebook/react#28000
- facebook/react#28003
- facebook/react#27997
- facebook/react#27240
- facebook/react#27977
- facebook/react#27940
- facebook/react#27939
- facebook/react#28090
- facebook/react#28089
- facebook/react#28076
- facebook/react#28074
- facebook/react#28103
- facebook/react#28098
- facebook/react#28097
- facebook/react#28068
- facebook/react#28093
- facebook/react#28094
- facebook/react#28073
- facebook/react#28084
- facebook/react#28063
- facebook/react#28085
- facebook/react#28083
- facebook/react#28065
- facebook/react#28061
- facebook/react#28077
- facebook/react#28075
- facebook/react#28078
- facebook/react#28050
- facebook/react#28011
- facebook/react#28055
- facebook/react#28066
- facebook/react#28067
- facebook/react#28010
- facebook/react#27993
- facebook/react#28052
- facebook/react#28060
- facebook/react#28059
- facebook/react#28034
- facebook/react#28033
- facebook/react#28004
- facebook/react#28051
- facebook/react#28012
- facebook/react#28001
- facebook/react#28002
- facebook/react#27995
- facebook/react#28006
- facebook/react#28005
- facebook/react#28007
- facebook/react#28008
- facebook/react#28009
- facebook/react#28000
- facebook/react#28003
- facebook/react#27997
- facebook/react#27240
- facebook/react#27977
- facebook/react#27940
- facebook/react#27939
gnoff added a commit to gnoff/next.js that referenced this pull request Feb 6, 2024
- facebook/react#28250
- facebook/react#28225
- facebook/react#28123
- facebook/react#28240
- facebook/react#28239
- facebook/react#28245
- facebook/react#28244
- facebook/react#28238
- facebook/react#28235
- facebook/react#28221
- facebook/react#28215
- facebook/react#28214
- facebook/react#28213
- facebook/react#28212
- facebook/react#28211
- facebook/react#28247
- facebook/react#28210
- facebook/react#28186
- facebook/react#28232
- facebook/react#28169
- facebook/react#28177
- facebook/react#28170
- facebook/react#28168
- facebook/react#28122
- facebook/react#27982
- facebook/react#28217
- facebook/react#28223
- facebook/react#28208
- facebook/react#28209
- facebook/react#28200
- facebook/react#28199
- facebook/react#28198
- facebook/react#28197
- facebook/react#28196
- facebook/react#28194
- facebook/react#28192
- facebook/react#28191
- facebook/react#28182
- facebook/react#28181
- facebook/react#28180
- facebook/react#28178
- facebook/react#28201
- facebook/react#28176
- facebook/react#28162
- facebook/react#28131
- facebook/react#28190
- facebook/react#28172
- facebook/react#28171
- facebook/react#28173
- facebook/react#28174
- facebook/react#28175
- facebook/react#28136
- facebook/react#28135
- facebook/react#28134
- facebook/react#28133
- facebook/react#28132
- facebook/react#28130
- facebook/react#28202
- facebook/react#28102
- facebook/react#28161
- facebook/react#28193
- facebook/react#28195
- facebook/react#28189
- facebook/react#28160
- facebook/react#28096
- facebook/react#28183
- facebook/react#28125
- facebook/react#28157
- facebook/react#28115
- facebook/react#28124
- facebook/react#28163
- facebook/react#28164
- facebook/react#28150
- facebook/react#28159
- facebook/react#28069
- facebook/react#28110
- facebook/react#28148
- facebook/react#28116
- facebook/react#28099
- facebook/react#28100
- facebook/react#28147
- facebook/react#28128
- facebook/react#28126
- facebook/react#28139
- facebook/react#28140
- facebook/react#28141
- facebook/react#28142
- facebook/react#28113
- facebook/react#28129
- facebook/react#28114
- facebook/react#28053
- facebook/react#28091
- facebook/react#28087
- facebook/react#28112
- facebook/react#28086
- facebook/react#28101
- facebook/react#28106
- facebook/react#28117
- facebook/react#28118
- facebook/react#28105
- facebook/react#27883
- facebook/react#28111
- facebook/react#28095
- facebook/react#28108
- facebook/react#28090
- facebook/react#28089
- facebook/react#28076
- facebook/react#28074
- facebook/react#28103
- facebook/react#28098
- facebook/react#28097
- facebook/react#28068
- facebook/react#28093
- facebook/react#28094
- facebook/react#28073
- facebook/react#28084
- facebook/react#28063
- facebook/react#28085
- facebook/react#28083
- facebook/react#28065
- facebook/react#28061
- facebook/react#28077
- facebook/react#28075
- facebook/react#28078
- facebook/react#28050
- facebook/react#28011
- facebook/react#28055
- facebook/react#28066
- facebook/react#28067
- facebook/react#28010
- facebook/react#27993
- facebook/react#28052
- facebook/react#28060
- facebook/react#28059
- facebook/react#28034
- facebook/react#28033
- facebook/react#28004
- facebook/react#28051
- facebook/react#28012
- facebook/react#28001
- facebook/react#28002
- facebook/react#27995
- facebook/react#28006
- facebook/react#28005
- facebook/react#28007
- facebook/react#28008
- facebook/react#28009
- facebook/react#28000
- facebook/react#28003
- facebook/react#27997
- facebook/react#27240
- facebook/react#27977
- facebook/react#27940
- facebook/react#27939
- facebook/react#28090
- facebook/react#28089
- facebook/react#28076
- facebook/react#28074
- facebook/react#28103
- facebook/react#28098
- facebook/react#28097
- facebook/react#28068
- facebook/react#28093
- facebook/react#28094
- facebook/react#28073
- facebook/react#28084
- facebook/react#28063
- facebook/react#28085
- facebook/react#28083
- facebook/react#28065
- facebook/react#28061
- facebook/react#28077
- facebook/react#28075
- facebook/react#28078
- facebook/react#28050
- facebook/react#28011
- facebook/react#28055
- facebook/react#28066
- facebook/react#28067
- facebook/react#28010
- facebook/react#27993
- facebook/react#28052
- facebook/react#28060
- facebook/react#28059
- facebook/react#28034
- facebook/react#28033
- facebook/react#28004
- facebook/react#28051
- facebook/react#28012
- facebook/react#28001
- facebook/react#28002
- facebook/react#27995
- facebook/react#28006
- facebook/react#28005
- facebook/react#28007
- facebook/react#28008
- facebook/react#28009
- facebook/react#28000
- facebook/react#28003
- facebook/react#27997
- facebook/react#27240
- facebook/react#27977
- facebook/react#27940
- facebook/react#27939
gnoff added a commit to vercel/next.js that referenced this pull request Feb 6, 2024
Updates React from 60a927d04 to 2bc7d336a

Also updates aliases for `react.shared-subset` to `react.react-server`

### React upstream changes

- facebook/react#28250
- facebook/react#28225
- facebook/react#28123
- facebook/react#28240
- facebook/react#28239
- facebook/react#28245
- facebook/react#28244
- facebook/react#28238
- facebook/react#28235
- facebook/react#28221
- facebook/react#28215
- facebook/react#28214
- facebook/react#28213
- facebook/react#28212
- facebook/react#28211
- facebook/react#28247
- facebook/react#28210
- facebook/react#28186
- facebook/react#28232
- facebook/react#28169
- facebook/react#28177
- facebook/react#28170
- facebook/react#28168
- facebook/react#28122
- facebook/react#27982
- facebook/react#28217
- facebook/react#28223
- facebook/react#28208
- facebook/react#28209
- facebook/react#28200
- facebook/react#28199
- facebook/react#28198
- facebook/react#28197
- facebook/react#28196
- facebook/react#28194
- facebook/react#28192
- facebook/react#28191
- facebook/react#28182
- facebook/react#28181
- facebook/react#28180
- facebook/react#28178
- facebook/react#28201
- facebook/react#28176
- facebook/react#28162
- facebook/react#28131
- facebook/react#28190
- facebook/react#28172
- facebook/react#28171
- facebook/react#28173
- facebook/react#28174
- facebook/react#28175
- facebook/react#28136
- facebook/react#28135
- facebook/react#28134
- facebook/react#28133
- facebook/react#28132
- facebook/react#28130
- facebook/react#28202
- facebook/react#28102
- facebook/react#28161
- facebook/react#28193
- facebook/react#28195
- facebook/react#28189
- facebook/react#28160
- facebook/react#28096
- facebook/react#28183
- facebook/react#28125
- facebook/react#28157
- facebook/react#28115
- facebook/react#28124
- facebook/react#28163
- facebook/react#28164
- facebook/react#28150
- facebook/react#28159
- facebook/react#28069
- facebook/react#28110
- facebook/react#28148
- facebook/react#28116
- facebook/react#28099
- facebook/react#28100
- facebook/react#28147
- facebook/react#28128
- facebook/react#28126
- facebook/react#28139
- facebook/react#28140
- facebook/react#28141
- facebook/react#28142
- facebook/react#28113
- facebook/react#28129
- facebook/react#28114
- facebook/react#28053
- facebook/react#28091
- facebook/react#28087
- facebook/react#28112
- facebook/react#28086
- facebook/react#28101
- facebook/react#28106
- facebook/react#28117
- facebook/react#28118
- facebook/react#28105
- facebook/react#27883
- facebook/react#28111
- facebook/react#28095
- facebook/react#28108
- facebook/react#28090
- facebook/react#28089
- facebook/react#28076
- facebook/react#28074
- facebook/react#28103
- facebook/react#28098
- facebook/react#28097
- facebook/react#28068
- facebook/react#28093
- facebook/react#28094
- facebook/react#28073
- facebook/react#28084
- facebook/react#28063
- facebook/react#28085
- facebook/react#28083
- facebook/react#28065
- facebook/react#28061
- facebook/react#28077
- facebook/react#28075
- facebook/react#28078
- facebook/react#28050
- facebook/react#28011
- facebook/react#28055
- facebook/react#28066
- facebook/react#28067
- facebook/react#28010
- facebook/react#27993
- facebook/react#28052
- facebook/react#28060
- facebook/react#28059
- facebook/react#28034
- facebook/react#28033
- facebook/react#28004
- facebook/react#28051
- facebook/react#28012
- facebook/react#28001
- facebook/react#28002
- facebook/react#27995
- facebook/react#28006
- facebook/react#28005
- facebook/react#28007
- facebook/react#28008
- facebook/react#28009
- facebook/react#28000
- facebook/react#28003
- facebook/react#27997
- facebook/react#27240
- facebook/react#27977
- facebook/react#27940
- facebook/react#27939
- facebook/react#28090
- facebook/react#28089
- facebook/react#28076
- facebook/react#28074
- facebook/react#28103
- facebook/react#28098
- facebook/react#28097
- facebook/react#28068
- facebook/react#28093
- facebook/react#28094
- facebook/react#28073
- facebook/react#28084
- facebook/react#28063
- facebook/react#28085
- facebook/react#28083
- facebook/react#28065
- facebook/react#28061
- facebook/react#28077
- facebook/react#28075
- facebook/react#28078
- facebook/react#28050
- facebook/react#28011
- facebook/react#28055
- facebook/react#28066
- facebook/react#28067
- facebook/react#28010
- facebook/react#27993
- facebook/react#28052
- facebook/react#28060
- facebook/react#28059
- facebook/react#28034
- facebook/react#28033
- facebook/react#28004
- facebook/react#28051
- facebook/react#28012
- facebook/react#28001
- facebook/react#28002
- facebook/react#27995
- facebook/react#28006
- facebook/react#28005
- facebook/react#28007
- facebook/react#28008
- facebook/react#28009
- facebook/react#28000
- facebook/react#28003
- facebook/react#27997
- facebook/react#27240
- facebook/react#27977
- facebook/react#27940
- facebook/react#27939

Closes NEXT-2331
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
This adds support for async actions to the "isomorphic" version of
startTransition (i.e. the one exported by the "react" package).
Previously, async actions were only supported by the startTransition
that is returned from the useTransition hook.

The interesting part about the isomorphic startTransition is that it's
not associated with any particular root. It must work with updates to
arbitrary roots, or even arbitrary React renderers in the same app. (For
example, both React DOM and React Three Fiber.)

The idea is that React.startTransition should behave as if every root
had an implicit useTransition hook, and you composed together all the
startTransitions provided by those hooks. Multiple updates to the same
root will be batched together. However, updates to one root will not be
batched with updates to other roots.

Features like useOptimistic work the same as with the hook version.

There is one difference from from the hook version of startTransition:
an error triggered inside an async action cannot be captured by an error
boundary, because it's not associated with any particular part of the
tree. You should handle errors the same way you would in a regular
event, e.g. with a global error event handler, or with a local
`try/catch`.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
This adds support for async actions to the "isomorphic" version of
startTransition (i.e. the one exported by the "react" package).
Previously, async actions were only supported by the startTransition
that is returned from the useTransition hook.

The interesting part about the isomorphic startTransition is that it's
not associated with any particular root. It must work with updates to
arbitrary roots, or even arbitrary React renderers in the same app. (For
example, both React DOM and React Three Fiber.)

The idea is that React.startTransition should behave as if every root
had an implicit useTransition hook, and you composed together all the
startTransitions provided by those hooks. Multiple updates to the same
root will be batched together. However, updates to one root will not be
batched with updates to other roots.

Features like useOptimistic work the same as with the hook version.

There is one difference from from the hook version of startTransition:
an error triggered inside an async action cannot be captured by an error
boundary, because it's not associated with any particular part of the
tree. You should handle errors the same way you would in a regular
event, e.g. with a global error event handler, or with a local
`try/catch`.

DiffTrain build for commit 85b296e.
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.

5 participants