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

[Synchronous Suspense] Suspending a class outside concurrent mode #13926

Merged
merged 2 commits into from
Oct 23, 2018

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Oct 23, 2018

When a class component suspends during mount outside concurrent mode, change the tag so it's not mistaken for a completed component. For example, we should not call componentWillUnmount if it is deleted.

When a class component suspends during mount outside concurrent mode,
change the tag so it's not mistaken for a completed component. For
example, we should not call componentWillUnmount if it is deleted.
Copy link
Collaborator

@sebmarkbage sebmarkbage left a comment

Choose a reason for hiding this comment

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

Should be classes IncompleteClassComponent if it's assumed to be a class.

@acdlite
Copy link
Collaborator Author

acdlite commented Oct 23, 2018

@sebmarkbage Re: naming, I thought maybe this might be needed for other types in the future? But I suppose we'll rename it then.

@acdlite acdlite merged commit cbbc2b6 into facebook:master Oct 23, 2018
// Typically, a component that mounted will have an instance. However,
// outside of concurrent mode, a suspended component may commit without
// an instance, so we need to check whether it exists.
instance !== null &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

So why do we still need this check? I thought the separate tag is supposed to address it.

@@ -762,7 +763,7 @@ function mountLazyComponent(
renderExpirationTime,
) {
if (_current !== null) {
// An indeterminate component only mounts if it suspended inside a non-
// An lazy component only mounts if it suspended inside a non-
Copy link
Contributor

Choose a reason for hiding this comment

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

A* lazy

) {
if (_current !== null) {
// An incomplete component only mounts if it suspended inside a non-
// concurrent tree, in an inconsistent state. We want to tree it like
Copy link
Contributor

Choose a reason for hiding this comment

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

We want to tree it

treat it?

@sizebot
Copy link

sizebot commented Oct 23, 2018

ReactDOM: size: 🔺+0.3%, gzip: 🔺+0.3%

Details of bundled changes.

Comparing: 4947fcd...e1300ef

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js +0.4% +0.2% 678.37 KB 681.03 KB 157.78 KB 158.1 KB UMD_DEV
react-dom.production.min.js 🔺+0.3% 🔺+0.3% 97.73 KB 98.04 KB 31.96 KB 32.05 KB UMD_PROD
react-dom.development.js +0.4% +0.2% 673.71 KB 676.37 KB 156.39 KB 156.71 KB NODE_DEV
react-dom.production.min.js 🔺+0.3% 🔺+0.3% 97.74 KB 98.06 KB 31.48 KB 31.56 KB NODE_PROD
ReactDOM-dev.js +0.4% +0.2% 691.98 KB 694.73 KB 157.07 KB 157.42 KB FB_WWW_DEV
ReactDOM-prod.js 🔺+0.4% 🔺+0.3% 294.92 KB 295.99 KB 54.2 KB 54.36 KB FB_WWW_PROD
react-dom.profiling.min.js +0.3% +0.3% 100.15 KB 100.47 KB 31.84 KB 31.93 KB NODE_PROFILING
ReactDOM-profiling.js +0.4% +0.3% 299.41 KB 300.47 KB 55.27 KB 55.44 KB FB_WWW_PROFILING
react-dom.profiling.min.js +0.3% +0.3% 100.08 KB 100.4 KB 32.37 KB 32.45 KB UMD_PROFILING

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js +0.6% +0.3% 465.82 KB 468.47 KB 103.57 KB 103.91 KB UMD_DEV
react-art.production.min.js 🔺+0.4% 🔺+0.3% 89.69 KB 90.01 KB 27.57 KB 27.66 KB UMD_PROD
react-art.development.js +0.7% +0.4% 397.61 KB 400.27 KB 86.52 KB 86.84 KB NODE_DEV
react-art.production.min.js 🔺+0.6% 🔺+0.8% 54.67 KB 54.98 KB 16.83 KB 16.97 KB NODE_PROD
ReactART-dev.js +0.7% +0.4% 402.25 KB 405 KB 84.97 KB 85.33 KB FB_WWW_DEV
ReactART-prod.js 🔺+0.6% 🔺+0.2% 168.2 KB 169.27 KB 28.55 KB 28.62 KB FB_WWW_PROD

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js +0.7% +0.4% 410.31 KB 413 KB 89.26 KB 89.59 KB UMD_DEV
react-test-renderer.production.min.js 🔺+0.6% 🔺+0.7% 55.84 KB 56.17 KB 17.2 KB 17.32 KB UMD_PROD
react-test-renderer.development.js +0.7% +0.4% 405.88 KB 408.57 KB 88.17 KB 88.49 KB NODE_DEV
react-test-renderer.production.min.js 🔺+0.6% 🔺+0.9% 55.57 KB 55.89 KB 16.96 KB 17.12 KB NODE_PROD
ReactTestRenderer-dev.js +0.7% +0.4% 410.89 KB 413.67 KB 86.96 KB 87.33 KB FB_WWW_DEV

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js +0.7% +0.4% 395.32 KB 397.98 KB 84.96 KB 85.29 KB NODE_DEV
react-reconciler.production.min.js 🔺+0.6% 🔺+0.7% 55.71 KB 56.03 KB 16.68 KB 16.8 KB NODE_PROD
react-reconciler-persistent.development.js +0.7% +0.4% 393.92 KB 396.58 KB 84.41 KB 84.73 KB NODE_DEV
react-reconciler-persistent.production.min.js 🔺+0.6% 🔺+0.7% 55.72 KB 56.04 KB 16.69 KB 16.81 KB NODE_PROD

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js +0.5% +0.3% 528.87 KB 531.62 KB 115.93 KB 116.26 KB RN_FB_DEV
ReactNativeRenderer-prod.js 🔺+0.5% 🔺+0.5% 222.95 KB 224.02 KB 38.85 KB 39.05 KB RN_FB_PROD
ReactNativeRenderer-dev.js +0.5% +0.3% 528.58 KB 531.33 KB 115.85 KB 116.19 KB RN_OSS_DEV
ReactNativeRenderer-prod.js 🔺+0.5% 🔺+0.5% 222.96 KB 224.04 KB 38.85 KB 39.05 KB RN_OSS_PROD
ReactFabric-dev.js +0.5% +0.3% 519.09 KB 521.85 KB 113.52 KB 113.86 KB RN_FB_DEV
ReactFabric-prod.js 🔺+0.5% 🔺+0.5% 217.52 KB 218.57 KB 37.56 KB 37.74 KB RN_FB_PROD
ReactFabric-dev.js +0.5% +0.3% 519.13 KB 521.88 KB 113.53 KB 113.87 KB RN_OSS_DEV
ReactFabric-prod.js 🔺+0.5% 🔺+0.5% 217.56 KB 218.61 KB 37.57 KB 37.75 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js +0.5% +0.5% 228.66 KB 229.72 KB 40.18 KB 40.38 KB RN_OSS_PROFILING
ReactFabric-profiling.js +0.5% +0.5% 222.39 KB 223.45 KB 38.86 KB 39.05 KB RN_OSS_PROFILING
ReactNativeRenderer-profiling.js +0.5% +0.5% 228.64 KB 229.7 KB 40.19 KB 40.38 KB RN_FB_PROFILING
ReactFabric-profiling.js +0.5% +0.5% 222.35 KB 223.41 KB 38.84 KB 39.03 KB RN_FB_PROFILING

scheduler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
scheduler.development.js n/a n/a 0 B 19.17 KB 0 B 5.74 KB UMD_DEV
scheduler.production.min.js n/a n/a 0 B 3.16 KB 0 B 1.53 KB UMD_PROD

Generated by 🚫 dangerJS

jetoneza pushed a commit to jetoneza/react that referenced this pull request Jan 23, 2019
…cebook#13926)

* [Synchronous Suspense] Suspending a class outside concurrent mode

When a class component suspends during mount outside concurrent mode,
change the tag so it's not mistaken for a completed component. For
example, we should not call componentWillUnmount if it is deleted.

* PR nits
NMinhNguyen referenced this pull request in enzymejs/react-shallow-renderer Jan 29, 2020
…3926)

* [Synchronous Suspense] Suspending a class outside concurrent mode

When a class component suspends during mount outside concurrent mode,
change the tag so it's not mistaken for a completed component. For
example, we should not call componentWillUnmount if it is deleted.

* PR nits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants