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 a crash in Suspense with findDOMNode #15195

Closed
wants to merge 1 commit into from

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Mar 22, 2019

Another attempt at #14198.
Fixes the internal crash we've recently observed.

I know this fix might have weird semantics (which DOM node should it return for a suspended tree?) but it still seems better to not crash in this case IMO.

parentA = maybeSuspense;
parentB = maybeSuspense;
a = maybeSuspenseFragment;
b = maybeSuspenseFragment;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't know if it's legit to have them pointing to the same one. I haven't really thought whether this makes sense.

@sizebot
Copy link

sizebot commented Mar 22, 2019

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

Details of bundled changes.

Comparing: 8e9a013...43e7858

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js +0.1% +0.1% 804.45 KB 805.14 KB 182.3 KB 182.48 KB UMD_DEV
react-dom.production.min.js 🔺+0.1% 🔺+0.1% 105.09 KB 105.18 KB 33.96 KB 34 KB UMD_PROD
react-dom.profiling.min.js +0.1% +0.1% 108.06 KB 108.16 KB 34.62 KB 34.64 KB UMD_PROFILING
react-dom.development.js +0.1% +0.1% 798.84 KB 799.53 KB 180.68 KB 180.86 KB NODE_DEV
react-dom.production.min.js 🔺+0.1% 🔺+0.1% 105.06 KB 105.16 KB 33.47 KB 33.51 KB NODE_PROD
react-dom.profiling.min.js +0.1% +0.1% 108.17 KB 108.26 KB 34.07 KB 34.11 KB NODE_PROFILING
ReactDOM-dev.js +0.1% +0.1% 823.23 KB 823.95 KB 182.26 KB 182.43 KB FB_WWW_DEV
ReactDOM-prod.js 🔺+0.1% 🔺+0.1% 324.92 KB 325.17 KB 59.7 KB 59.77 KB FB_WWW_PROD
ReactDOM-profiling.js +0.1% +0.1% 336.35 KB 336.6 KB 61.84 KB 61.91 KB FB_WWW_PROFILING
react-dom-unstable-fire.development.js +0.1% +0.1% 804.79 KB 805.49 KB 182.44 KB 182.62 KB UMD_DEV
react-dom-unstable-fire.production.min.js 🔺+0.1% 🔺+0.1% 105.1 KB 105.2 KB 33.97 KB 34.01 KB UMD_PROD
react-dom-unstable-fire.profiling.min.js +0.1% +0.1% 108.08 KB 108.18 KB 34.63 KB 34.65 KB UMD_PROFILING
react-dom-unstable-fire.development.js +0.1% +0.1% 799.18 KB 799.87 KB 180.82 KB 181 KB NODE_DEV
react-dom-unstable-fire.production.min.js 🔺+0.1% 🔺+0.1% 105.08 KB 105.17 KB 33.48 KB 33.51 KB NODE_PROD
react-dom-unstable-fire.profiling.min.js +0.1% +0.1% 108.18 KB 108.28 KB 34.07 KB 34.11 KB NODE_PROFILING
ReactFire-dev.js +0.1% +0.1% 822.44 KB 823.16 KB 182.13 KB 182.32 KB FB_WWW_DEV
ReactFire-prod.js 🔺+0.1% 🔺+0.1% 313.48 KB 313.72 KB 57.35 KB 57.43 KB FB_WWW_PROD
ReactFire-profiling.js +0.1% +0.1% 324.86 KB 325.11 KB 59.39 KB 59.46 KB FB_WWW_PROFILING
react-dom-test-utils.development.js +1.6% +1.4% 47.49 KB 48.23 KB 12.98 KB 13.16 KB UMD_DEV
react-dom-test-utils.production.min.js 🔺+1.0% 🔺+1.4% 9.95 KB 10.05 KB 3.66 KB 3.71 KB UMD_PROD
react-dom-test-utils.development.js +1.6% +1.4% 47.21 KB 47.95 KB 12.91 KB 13.09 KB NODE_DEV
react-dom-test-utils.production.min.js 🔺+1.0% 🔺+1.5% 9.73 KB 9.82 KB 3.59 KB 3.64 KB NODE_PROD
ReactTestUtils-dev.js +1.7% +1.4% 45.17 KB 45.94 KB 12.18 KB 12.36 KB FB_WWW_DEV
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 60.53 KB 60.53 KB 15.8 KB 15.8 KB UMD_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% 🔺+0.1% 10.69 KB 10.69 KB 3.67 KB 3.67 KB UMD_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 60.2 KB 60.2 KB 15.67 KB 15.67 KB NODE_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% 0.0% 10.42 KB 10.42 KB 3.56 KB 3.57 KB NODE_PROD
react-dom-server.browser.development.js 0.0% 0.0% 133.68 KB 133.68 KB 35.37 KB 35.37 KB UMD_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 18.93 KB 18.93 KB 7.14 KB 7.14 KB UMD_PROD
react-dom-server.browser.development.js 0.0% 0.0% 129.81 KB 129.81 KB 34.43 KB 34.43 KB NODE_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 18.86 KB 18.86 KB 7.14 KB 7.14 KB NODE_PROD
ReactDOMServer-dev.js 0.0% 0.0% 132.15 KB 132.15 KB 34.19 KB 34.19 KB FB_WWW_DEV
react-dom-server.node.development.js 0.0% 0.0% 131.75 KB 131.75 KB 34.97 KB 34.97 KB NODE_DEV
react-dom-server.node.production.min.js 0.0% 0.0% 19.72 KB 19.72 KB 7.44 KB 7.44 KB NODE_PROD
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 3.66 KB 3.66 KB 1.45 KB 1.46 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.1% 1.21 KB 1.21 KB 705 B 706 B UMD_PROD
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 3.49 KB 3.49 KB 1.41 KB 1.41 KB NODE_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.3% 1.05 KB 1.05 KB 636 B 638 B NODE_PROD
react-dom-unstable-fizz.node.development.js 0.0% +0.1% 3.74 KB 3.74 KB 1.43 KB 1.43 KB NODE_DEV

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js +0.1% +0.2% 565.89 KB 566.58 KB 122.15 KB 122.35 KB UMD_DEV
react-art.production.min.js 🔺+0.1% 🔺+0.1% 96.78 KB 96.87 KB 29.68 KB 29.72 KB UMD_PROD
react-art.development.js +0.1% +0.2% 496.8 KB 497.5 KB 104.76 KB 104.92 KB NODE_DEV
react-art.production.min.js 🔺+0.2% 🔺+0.3% 61.78 KB 61.88 KB 18.91 KB 18.96 KB NODE_PROD
ReactART-dev.js +0.1% +0.2% 506.73 KB 507.46 KB 104.08 KB 104.25 KB FB_WWW_DEV
ReactART-prod.js 🔺+0.1% 🔺+0.2% 196.46 KB 196.71 KB 33.27 KB 33.34 KB FB_WWW_PROD

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js +0.1% +0.1% 626.79 KB 627.52 KB 133.7 KB 133.86 KB RN_FB_DEV
ReactNativeRenderer-prod.js 🔺+0.1% 🔺+0.1% 245.55 KB 245.79 KB 42.95 KB 43.01 KB RN_FB_PROD
ReactNativeRenderer-profiling.js +0.1% +0.1% 251.79 KB 252.04 KB 44.29 KB 44.35 KB RN_FB_PROFILING
ReactNativeRenderer-dev.js +0.1% +0.1% 626.71 KB 627.43 KB 133.66 KB 133.83 KB RN_OSS_DEV
ReactNativeRenderer-prod.js 🔺+0.1% 🔺+0.1% 245.56 KB 245.81 KB 42.94 KB 43.01 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js +0.1% +0.1% 251.81 KB 252.06 KB 44.29 KB 44.35 KB RN_OSS_PROFILING
ReactFabric-dev.js +0.1% +0.1% 617.22 KB 617.95 KB 131.34 KB 131.5 KB RN_FB_DEV
ReactFabric-prod.js 🔺+0.1% 🔺+0.2% 239.62 KB 239.87 KB 41.78 KB 41.84 KB RN_FB_PROD
ReactFabric-profiling.js +0.1% +0.1% 244.96 KB 245.21 KB 43.1 KB 43.17 KB RN_FB_PROFILING
ReactFabric-dev.js +0.1% +0.1% 617.13 KB 617.86 KB 131.3 KB 131.46 KB RN_OSS_DEV
ReactFabric-prod.js 🔺+0.1% 🔺+0.2% 239.63 KB 239.88 KB 41.77 KB 41.84 KB RN_OSS_PROD
ReactFabric-profiling.js +0.1% +0.1% 244.97 KB 245.22 KB 43.1 KB 43.16 KB RN_OSS_PROFILING

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js +0.1% +0.2% 508.18 KB 508.87 KB 106.91 KB 107.08 KB UMD_DEV
react-test-renderer.production.min.js 🔺+0.2% 🔺+0.3% 62.77 KB 62.86 KB 19.14 KB 19.19 KB UMD_PROD
react-test-renderer.development.js +0.1% +0.1% 503.7 KB 504.39 KB 105.76 KB 105.91 KB NODE_DEV
react-test-renderer.production.min.js 🔺+0.2% 🔺+0.2% 62.46 KB 62.55 KB 18.96 KB 19 KB NODE_PROD
ReactTestRenderer-dev.js +0.1% +0.2% 514.77 KB 515.49 KB 105.51 KB 105.67 KB FB_WWW_DEV
react-test-renderer-shallow.development.js 0.0% 0.0% 38.98 KB 38.98 KB 9.81 KB 9.81 KB UMD_DEV
react-test-renderer-shallow.production.min.js 0.0% 0.0% 11.42 KB 11.42 KB 3.5 KB 3.51 KB UMD_PROD
react-test-renderer-shallow.development.js 0.0% 0.0% 33.2 KB 33.2 KB 8.41 KB 8.42 KB NODE_DEV
react-test-renderer-shallow.production.min.js 0.0% 0.0% 11.61 KB 11.61 KB 3.63 KB 3.63 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% 496.9 KB 497.59 KB 103.57 KB 103.72 KB NODE_DEV
react-reconciler.production.min.js 🔺+0.2% 🔺+0.2% 62.97 KB 63.06 KB 18.73 KB 18.78 KB NODE_PROD
react-reconciler-persistent.development.js +0.1% +0.2% 494.79 KB 495.48 KB 102.7 KB 102.86 KB NODE_DEV
react-reconciler-persistent.production.min.js 🔺+0.2% 🔺+0.2% 62.98 KB 63.08 KB 18.74 KB 18.78 KB NODE_PROD
react-reconciler-reflection.development.js +4.7% +3.7% 15.79 KB 16.53 KB 4.91 KB 5.09 KB NODE_DEV
react-reconciler-reflection.production.min.js 🔺+4.1% 🔺+5.2% 2.37 KB 2.47 KB 1.07 KB 1.12 KB NODE_PROD

Generated by 🚫 dangerJS

maybeSuspense.memoizedState !== null
) {
parentA = maybeSuspense;
parentB = maybeSuspense;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe it’s possible for the suspense to have an alternate and we might be coming from the disconnected tree.

@gaearon
Copy link
Collaborator Author

gaearon commented Apr 9, 2019

Fixed in #15312

@gaearon gaearon closed this Apr 9, 2019
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