Skip to content

Conversation

@sebmarkbage
Copy link
Collaborator

This includes two similar looking bug fixes to SuspenseList.

We must transfer any pending promises from inner boundary to list. For non-hidden modes, this boundary should commit so this shouldn't be needed but the nested boundary can make a second pass which forces these to be recreated without resuspending. In this case, the outer list assumes
that it can collect the inner promises to still rerender if needed.

Otherwise, the Promise never retries anything.

We must also propagate suspense "context" change to nested SuspenseLists. This bug looks similar to the previous one but is not based on the lack of retry but that the retry only happens on the outer boundary but the inner doesn't get a retry ping since it didn't know about its own promise after the second pass. So it bails out.

For non-hidden modes, this boundary should commit so this shouldn't be
needed but the nested boundary can make a second pass which forces these
to be recreated without resuspending. In this case, the outer list assumes
that it can collect the inner promises to still rerender if needed.
This means that we always rerender any nested SuspenseLists together.

This bug looks similar to the previous one but is not based on the lack of
retry but that the retry only happens on the outer boundary but the inner
doesn't get a retry ping since it didn't know about its own promise after
the second pass.
@sizebot
Copy link

sizebot commented Oct 14, 2019

Details of bundled changes.

Comparing: 75955bf...654572d

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js +0.1% +0.1% 667.62 KB 668.18 KB 145.2 KB 145.35 KB UMD_DEV
react-art.production.min.js 0.0% -0.0% 103.63 KB 103.67 KB 31.51 KB 31.51 KB UMD_PROD
react-art.development.js +0.1% +0.1% 598.25 KB 598.81 KB 127.8 KB 127.95 KB NODE_DEV
react-art.production.min.js 🔺+0.1% -0.0% 68.64 KB 68.69 KB 20.81 KB 20.8 KB NODE_PROD
ReactART-dev.js +0.1% +0.1% 611.47 KB 611.99 KB 127.41 KB 127.55 KB FB_WWW_DEV
ReactART-prod.js 🔺+0.1% 🔺+0.1% 232.21 KB 232.34 KB 39.15 KB 39.18 KB FB_WWW_PROD

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.profiling.min.js 0.0% -0.0% 119.46 KB 119.5 KB 37.72 KB 37.7 KB NODE_PROFILING
ReactDOM-dev.js +0.1% +0.1% 968.85 KB 969.38 KB 215.29 KB 215.43 KB FB_WWW_DEV
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 3.78 KB 3.78 KB 1.53 KB 1.53 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 11.17 KB 11.17 KB 4.14 KB 4.14 KB UMD_PROD
react-dom-test-utils.development.js 0.0% -0.0% 54.58 KB 54.58 KB 15.26 KB 15.25 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 10.94 KB 10.94 KB 4.08 KB 4.08 KB NODE_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.2% 1.04 KB 1.04 KB 633 B 634 B NODE_PROD
react-dom.development.js +0.1% +0.1% 946.68 KB 947.24 KB 214.41 KB 214.55 KB UMD_DEV
react-dom.production.min.js 0.0% 🔺+0.1% 115.69 KB 115.74 KB 37.24 KB 37.26 KB UMD_PROD
react-dom.profiling.min.js 0.0% -0.0% 119.22 KB 119.26 KB 38.35 KB 38.34 KB UMD_PROFILING
react-dom.development.js +0.1% +0.1% 940.75 KB 941.31 KB 212.84 KB 212.99 KB NODE_DEV
react-dom.production.min.js 0.0% -0.0% 115.81 KB 115.86 KB 36.7 KB 36.69 KB NODE_PROD
ReactDOM-prod.js 0.0% 0.0% 398.09 KB 398.2 KB 72.46 KB 72.48 KB FB_WWW_PROD
ReactDOM-profiling.js 0.0% 0.0% 398.88 KB 398.92 KB 72.97 KB 72.99 KB FB_WWW_PROFILING
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 60.13 KB 60.13 KB 15.79 KB 15.79 KB UMD_DEV
ReactDOMServer-prod.js 0.0% 0.0% 48.5 KB 48.5 KB 11.08 KB 11.08 KB FB_WWW_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 59.8 KB 59.8 KB 15.66 KB 15.66 KB NODE_DEV

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-prod.js 🔺+0.1% 🔺+0.1% 272.32 KB 272.58 KB 46.72 KB 46.75 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js +0.1% +0.1% 281.91 KB 282.32 KB 48.47 KB 48.53 KB RN_OSS_PROFILING
ReactFabric-prod.js 🔺+0.1% 0.0% 264.1 KB 264.34 KB 45.36 KB 45.36 KB RN_OSS_PROD
ReactFabric-profiling.js +0.2% +0.1% 274.75 KB 275.17 KB 47.22 KB 47.27 KB RN_OSS_PROFILING
ReactFabric-dev.js +0.1% +0.1% 746.85 KB 747.38 KB 158.29 KB 158.43 KB RN_FB_DEV
ReactFabric-prod.js 🔺+0.1% 0.0% 264.1 KB 264.34 KB 45.37 KB 45.38 KB RN_FB_PROD
ReactNativeRenderer-dev.js +0.1% +0.1% 741.19 KB 741.72 KB 157.37 KB 157.51 KB RN_OSS_DEV
ReactFabric-profiling.js +0.2% +0.1% 274.75 KB 275.17 KB 47.23 KB 47.29 KB RN_FB_PROFILING
ReactNativeRenderer-dev.js +0.1% +0.1% 741.35 KB 741.88 KB 157.46 KB 157.59 KB RN_FB_DEV
ReactNativeRenderer-prod.js 🔺+0.1% 🔺+0.1% 272.32 KB 272.57 KB 46.73 KB 46.76 KB RN_FB_PROD
ReactNativeRenderer-profiling.js +0.1% +0.1% 281.9 KB 282.31 KB 48.49 KB 48.54 KB RN_FB_PROFILING
ReactFabric-dev.js +0.1% +0.1% 746.68 KB 747.21 KB 158.22 KB 158.36 KB RN_OSS_DEV

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactTestRenderer-dev.js +0.1% +0.1% 623 KB 623.53 KB 129.95 KB 130.09 KB FB_WWW_DEV
react-test-renderer-shallow.development.js 0.0% 0.0% 38.56 KB 38.56 KB 9.9 KB 9.9 KB UMD_DEV
react-test-renderer-shallow.production.min.js 0.0% 0.0% 11.43 KB 11.43 KB 3.54 KB 3.54 KB UMD_PROD
react-test-renderer.development.js +0.1% +0.1% 612.33 KB 612.88 KB 130.81 KB 130.96 KB UMD_DEV
react-test-renderer.production.min.js 🔺+0.1% 0.0% 70.66 KB 70.71 KB 21.64 KB 21.64 KB UMD_PROD
react-test-renderer.development.js +0.1% +0.1% 607.6 KB 608.15 KB 129.63 KB 129.77 KB NODE_DEV
react-test-renderer.production.min.js 🔺+0.1% -0.0% 70.36 KB 70.41 KB 21.32 KB 21.32 KB NODE_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js +0.1% +0.1% 599.23 KB 599.79 KB 126.97 KB 127.12 KB NODE_DEV
react-reconciler.production.min.js 🔺+0.1% 0.0% 71.36 KB 71.41 KB 21.09 KB 21.1 KB NODE_PROD
react-reconciler-reflection.development.js 0.0% 0.0% 19.19 KB 19.19 KB 6.26 KB 6.26 KB NODE_DEV
react-reconciler-persistent.development.js +0.1% +0.1% 596.58 KB 597.14 KB 125.86 KB 125.99 KB NODE_DEV
react-reconciler-persistent.production.min.js 🔺+0.1% 0.0% 71.37 KB 71.42 KB 21.1 KB 21.11 KB NODE_PROD

Generated by 🚫 dangerJS against 654572d

Copy link
Collaborator

@acdlite acdlite left a comment

Choose a reason for hiding this comment

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

Re: the first fix, maybe we could try the thing where instead of attaching the promise to the inner Suspense boundary, it always gets attached to the outer SuspenseList, so that there's nothing to transfer if the inner boundary does another pass. Would that have worked in this case?

@sebmarkbage sebmarkbage merged commit d5b54d0 into facebook:master Oct 14, 2019
@sebmarkbage
Copy link
Collaborator Author

sebmarkbage commented Oct 14, 2019

It’s tricky to do that in throwException because you have to know the context at every level and you don’t know the context of the shadowed levels. Otherwise you don’t know whether to continue bubbling or not.

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.

4 participants