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

Fix: Resolve entangled actions independently #26726

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Apr 25, 2023

When there are multiple async actions at the same time, we entangle them together because we can't be sure which action an update might be associated with. (For this, we'd need AsyncContext.) However, if one of the async actions fails with an error, it should only affect that action, not all the other actions it may be entangled with.

Resolving each action independently also means they can have independent pending state types, rather than being limited to an isPending boolean. We'll use this to implement an upcoming form API.

When there are multiple async actions at the same time, we entangle
them together because we can't be sure which action an update might
be associated with. (For this, we'd need AsyncContext.) However, if
one of the async actions fails with an error, it should only affect
that action, not all the other actions it may be entangled with.

Resolving each action independently also means they can have independent
pending state types, rather than being limited to an `isPending`
boolean. We'll use this to implement an upcoming form API.
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Apr 25, 2023
@acdlite acdlite requested a review from sebmarkbage April 25, 2023 16:10
@react-sizebot
Copy link

Comparing: ed545ae...14c8af7

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 = 163.94 kB 163.93 kB = 51.68 kB 51.68 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js +0.10% 169.47 kB 169.64 kB +0.09% 53.33 kB 53.38 kB
facebook-www/ReactDOM-prod.classic.js +0.15% 565.78 kB 566.63 kB +0.07% 100.03 kB 100.10 kB
facebook-www/ReactDOM-prod.modern.js +0.15% 549.52 kB 550.36 kB +0.07% 97.22 kB 97.29 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-test-renderer/cjs/react-test-renderer.development.js +0.36% 775.62 kB 778.42 kB +0.42% 169.39 kB 170.11 kB
oss-stable/react-test-renderer/cjs/react-test-renderer.development.js +0.36% 775.64 kB 778.44 kB +0.42% 169.42 kB 170.13 kB
oss-experimental/react-test-renderer/cjs/react-test-renderer.development.js +0.36% 776.01 kB 778.81 kB +0.42% 169.50 kB 170.22 kB
oss-stable-semver/react-test-renderer/umd/react-test-renderer.development.js +0.36% 812.47 kB 815.37 kB +0.43% 171.15 kB 171.89 kB
oss-stable/react-test-renderer/umd/react-test-renderer.development.js +0.36% 812.49 kB 815.39 kB +0.43% 171.18 kB 171.91 kB
oss-experimental/react-test-renderer/umd/react-test-renderer.development.js +0.36% 812.88 kB 815.79 kB +0.43% 171.28 kB 172.02 kB
facebook-react-native/react-test-renderer/cjs/ReactTestRenderer-dev.js +0.35% 790.35 kB 793.15 kB +0.42% 171.30 kB 172.02 kB
oss-stable-semver/react-art/cjs/react-art.development.js +0.35% 796.86 kB 799.66 kB +0.41% 173.61 kB 174.33 kB
oss-stable/react-art/cjs/react-art.development.js +0.35% 796.88 kB 799.68 kB +0.41% 173.63 kB 174.35 kB
oss-experimental/react-art/cjs/react-art.development.js +0.35% 805.95 kB 808.77 kB +0.41% 175.33 kB 176.05 kB
facebook-www/ReactTestRenderer-dev.modern.js +0.35% 807.72 kB 810.52 kB +0.42% 174.76 kB 175.49 kB
facebook-www/ReactTestRenderer-dev.classic.js +0.35% 807.73 kB 810.53 kB +0.42% 174.76 kB 175.49 kB
react-native/implementations/ReactFabric-dev.js +0.33% 855.56 kB 858.36 kB +0.38% 185.67 kB 186.37 kB
react-native/implementations/ReactNativeRenderer-dev.js +0.32% 871.19 kB 873.99 kB +0.38% 190.07 kB 190.79 kB
oss-stable-semver/react-art/umd/react-art.development.js +0.32% 911.47 kB 914.37 kB +0.38% 192.65 kB 193.39 kB
oss-stable/react-art/umd/react-art.development.js +0.32% 911.49 kB 914.40 kB +0.38% 192.67 kB 193.41 kB
oss-experimental/react-art/umd/react-art.development.js +0.32% 921.06 kB 923.99 kB +0.38% 194.34 kB 195.07 kB
facebook-www/ReactART-dev.modern.js +0.31% 898.38 kB 901.21 kB +0.39% 191.55 kB 192.29 kB
react-native/implementations/ReactFabric-dev.fb.js +0.31% 893.13 kB 895.93 kB +0.38% 192.96 kB 193.69 kB
oss-experimental/react-reconciler/cjs/react-reconciler.development.js +0.31% 906.82 kB 909.66 kB +0.37% 193.79 kB 194.51 kB
oss-stable-semver/react-reconciler/cjs/react-reconciler.development.js +0.31% 896.43 kB 899.24 kB +0.37% 191.74 kB 192.45 kB
oss-stable/react-reconciler/cjs/react-reconciler.development.js +0.31% 896.46 kB 899.26 kB +0.37% 191.76 kB 192.48 kB
facebook-www/ReactART-dev.classic.js +0.31% 909.58 kB 912.41 kB +0.39% 193.82 kB 194.58 kB
react-native/implementations/ReactNativeRenderer-dev.fb.js +0.31% 908.74 kB 911.54 kB +0.38% 197.37 kB 198.12 kB
facebook-www/ReactART-prod.modern.js +0.25% 333.95 kB 334.80 kB +0.11% 56.94 kB 57.01 kB
facebook-www/ReactART-prod.classic.js +0.25% 344.94 kB 345.79 kB +0.11% 58.86 kB 58.93 kB
oss-stable-semver/react-dom/cjs/react-dom.development.js +0.22% 1,257.75 kB 1,260.55 kB +0.26% 277.85 kB 278.59 kB
oss-stable/react-dom/cjs/react-dom.development.js +0.22% 1,257.78 kB 1,260.58 kB +0.26% 277.88 kB 278.61 kB
oss-stable-semver/react-dom/umd/react-dom.development.js +0.22% 1,318.76 kB 1,321.66 kB +0.26% 280.79 kB 281.51 kB
oss-stable/react-dom/umd/react-dom.development.js +0.22% 1,318.78 kB 1,321.69 kB +0.26% 280.81 kB 281.53 kB
oss-experimental/react-dom/cjs/react-dom.development.js +0.22% 1,287.48 kB 1,290.31 kB +0.26% 284.26 kB 284.99 kB
oss-experimental/react-dom/umd/react-dom.development.js +0.22% 1,349.91 kB 1,352.84 kB +0.25% 287.13 kB 287.86 kB
oss-experimental/react-dom/cjs/react-dom-unstable_testing.development.js +0.22% 1,305.53 kB 1,308.37 kB +0.26% 288.58 kB 289.32 kB
facebook-www/ReactDOM-dev.modern.js +0.20% 1,400.02 kB 1,402.85 kB +0.24% 302.52 kB 303.25 kB

Generated by 🚫 dangerJS against 14c8af7

@acdlite acdlite merged commit 6eadbe0 into facebook:main Apr 26, 2023
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
When there are multiple async actions at the same time, we entangle them
together because we can't be sure which action an update might be
associated with. (For this, we'd need AsyncContext.) However, if one of
the async actions fails with an error, it should only affect that
action, not all the other actions it may be entangled with.

Resolving each action independently also means they can have independent
pending state types, rather than being limited to an `isPending`
boolean. We'll use this to implement an upcoming form API.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
When there are multiple async actions at the same time, we entangle them
together because we can't be sure which action an update might be
associated with. (For this, we'd need AsyncContext.) However, if one of
the async actions fails with an error, it should only affect that
action, not all the other actions it may be entangled with.

Resolving each action independently also means they can have independent
pending state types, rather than being limited to an `isPending`
boolean. We'll use this to implement an upcoming form API.

DiffTrain build for commit 6eadbe0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants