Skip to content

Avoid passing custom stacks to console.error#18685

Merged
sebmarkbage merged 5 commits intofacebook:masterfrom
sebmarkbage:fixstackdetection
Apr 21, 2020
Merged

Avoid passing custom stacks to console.error#18685
sebmarkbage merged 5 commits intofacebook:masterfrom
sebmarkbage:fixstackdetection

Conversation

@sebmarkbage
Copy link
Copy Markdown
Contributor

The detection if one of the args contains a stack was broken in the new stack format. Unfortunately the toWarnDev helper that was meant to detect that oversight used the same check.

This stops detecting stacks and instead always appends a stack.

Many of the custom stacks were actually unnecessary because they had the correct execution context already. For the ones that might be called outside the render phase, I set the debug fiber right before calling the warning to set the right context.

That way we never need to pass a custom stack as an argument.

@sebmarkbage sebmarkbage requested review from bvaughn and gaearon April 21, 2020 03:13
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Apr 21, 2020
@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented Apr 21, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 3aca0a0:

Sandbox Source
small-moon-6qpd4 Configuration

@sizebot
Copy link
Copy Markdown

sizebot commented Apr 21, 2020

Details of bundled changes.

Comparing: 0960b7b...3aca0a0

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react.development.js -0.3% -0.3% 101.99 KB 101.67 KB 24.8 KB 24.72 KB UMD_DEV
react.production.min.js -0.0% -0.1% 11.39 KB 11.39 KB 4.56 KB 4.55 KB UMD_PROD
JSXDEVRuntime-dev.js -0.6% -0.4% 39.09 KB 38.87 KB 11.03 KB 10.98 KB FB_WWW_DEV
react-jsx-runtime.development.js -0.6% -0.6% 30.29 KB 30.11 KB 8.93 KB 8.88 KB NODE_DEV
react-jsx-runtime.production.min.js 0.0% -0.3% 947 B 947 B 595 B 593 B NODE_PROD
react-jsx-runtime.profiling.min.js 0.0% -0.2% 946 B 946 B 594 B 593 B NODE_PROFILING
JSXRuntime-dev.js -0.6% -0.4% 39.67 KB 39.45 KB 11.2 KB 11.15 KB FB_WWW_DEV
react.profiling.min.js -0.0% -0.1% 14.9 KB 14.9 KB 5.63 KB 5.63 KB UMD_PROFILING
react.development.js -0.5% -0.5% 63.59 KB 63.28 KB 17.12 KB 17.04 KB NODE_DEV
react.production.min.js -0.0% -0.1% 6.32 KB 6.32 KB 2.62 KB 2.62 KB NODE_PROD
React-dev.js -0.4% -0.3% 98.84 KB 98.45 KB 24.12 KB 24.04 KB FB_WWW_DEV
React-prod.js -0.1% -0.1% 17.42 KB 17.4 KB 4.56 KB 4.55 KB FB_WWW_PROD
react-jsx-dev-runtime.development.js -0.6% -0.6% 29.71 KB 29.53 KB 8.76 KB 8.71 KB NODE_DEV
React-profiling.js -0.1% -0.1% 17.42 KB 17.4 KB 4.56 KB 4.55 KB FB_WWW_PROFILING
react-jsx-dev-runtime.production.min.js 0.0% -0.3% 441 B 441 B 315 B 314 B NODE_PROD
react-jsx-dev-runtime.profiling.min.js 0.0% -0.3% 440 B 440 B 313 B 312 B NODE_PROFILING

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js +0.1% 0.0% 656.73 KB 657.07 KB 141.12 KB 141.14 KB RN_OSS_DEV
ReactNativeRenderer-prod.js 0.0% 🔺+0.1% 271.96 KB 272.03 KB 46.96 KB 46.99 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js 0.0% +0.1% 283.39 KB 283.46 KB 49.18 KB 49.21 KB RN_OSS_PROFILING
ReactFabric-dev.js 0.0% -0.0% 638.39 KB 638.41 KB 136.7 KB 136.66 KB RN_OSS_DEV
ReactFabric-prod.js 0.0% 🔺+0.1% 263.94 KB 264.01 KB 45.44 KB 45.47 KB RN_OSS_PROD
ReactFabric-profiling.js 0.0% +0.1% 275.35 KB 275.42 KB 47.65 KB 47.69 KB RN_OSS_PROFILING

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.production.min.js -0.0% -0.0% 119.95 KB 119.93 KB 37.61 KB 37.6 KB NODE_PROD
react-dom-test-utils.development.js -0.3% -0.3% 75.18 KB 74.99 KB 20.13 KB 20.07 KB UMD_DEV
ReactDOMTesting-profiling.js -0.0% -0.0% 402.96 KB 402.94 KB 73.4 KB 73.39 KB FB_WWW_PROFILING
react-dom-server.node.production.min.js -0.0% -0.0% 23.3 KB 23.29 KB 8.68 KB 8.68 KB NODE_PROD
react-dom.profiling.min.js -0.0% -0.0% 123.82 KB 123.81 KB 38.76 KB 38.75 KB NODE_PROFILING
react-dom-test-utils.production.min.js 0.0% -0.0% 13.23 KB 13.23 KB 4.89 KB 4.89 KB UMD_PROD
ReactDOMServer-dev.js -0.4% -0.3% 165.06 KB 164.38 KB 41.95 KB 41.82 KB FB_WWW_DEV
ReactDOMServer-prod.js -0.0% -0.1% 53.36 KB 53.35 KB 12.87 KB 12.86 KB FB_WWW_PROD
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 4.53 KB 4.53 KB 1.57 KB 1.57 KB NODE_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.3% 1 KB 1 KB 610 B 608 B NODE_PROD
ReactDOMForked-dev.js -0.0% -0.1% 1.04 MB 1.04 MB 236.41 KB 236.29 KB FB_WWW_DEV
ReactDOMForked-prod.js -0.0% -0.0% 445.9 KB 445.88 KB 78.13 KB 78.12 KB FB_WWW_PROD
react-dom.development.js 0.0% -0.1% 907.78 KB 907.87 KB 199.78 KB 199.64 KB UMD_DEV
ReactDOMForked-profiling.js -0.0% -0.0% 456.86 KB 456.84 KB 80.05 KB 80.04 KB FB_WWW_PROFILING
react-dom.production.min.js -0.0% -0.0% 119.82 KB 119.81 KB 38.36 KB 38.36 KB UMD_PROD
react-dom.profiling.min.js -0.0% -0.0% 123.57 KB 123.56 KB 39.59 KB 39.59 KB UMD_PROFILING
ReactDOMTesting-dev.js -0.0% -0.1% 956.62 KB 956.48 KB 213.34 KB 213.21 KB FB_WWW_DEV
react-dom.development.js 0.0% -0.1% 864.11 KB 864.14 KB 197.26 KB 197.12 KB NODE_DEV
ReactDOMTesting-prod.js -0.0% -0.0% 402.96 KB 402.94 KB 73.4 KB 73.39 KB FB_WWW_PROD
react-dom-server.node.development.js -0.4% -0.4% 147.37 KB 146.8 KB 39.01 KB 38.88 KB NODE_DEV
ReactDOM-dev.js -0.0% -0.1% 1.04 MB 1.04 MB 236.24 KB 236.1 KB FB_WWW_DEV
ReactDOM-prod.js -0.0% -0.0% 445.32 KB 445.29 KB 78.04 KB 78.03 KB FB_WWW_PROD
react-dom-test-utils.development.js -0.3% -0.3% 70.02 KB 69.84 KB 19.62 KB 19.56 KB NODE_DEV
ReactDOM-profiling.js -0.0% -0.0% 456.28 KB 456.25 KB 79.97 KB 79.96 KB FB_WWW_PROFILING
react-dom-test-utils.production.min.js 0.0% -0.0% 13.1 KB 13.1 KB 4.8 KB 4.8 KB NODE_PROD
react-dom-server.browser.development.js -0.4% -0.3% 155.33 KB 154.73 KB 39.53 KB 39.4 KB UMD_DEV
react-dom-unstable-fizz.node.production.min.js 0.0% -0.3% 1.16 KB 1.16 KB 660 B 658 B NODE_PROD
react-dom-server.browser.production.min.js -0.0% -0.0% 22.99 KB 22.99 KB 8.54 KB 8.54 KB UMD_PROD
ReactTestUtils-dev.js -0.3% -0.4% 65.04 KB 64.82 KB 17.52 KB 17.45 KB FB_WWW_DEV
react-dom-server.browser.development.js -0.4% -0.4% 146.15 KB 145.58 KB 38.76 KB 38.62 KB NODE_DEV
react-dom-server.browser.production.min.js -0.0% -0.0% 22.89 KB 22.88 KB 8.52 KB 8.51 KB NODE_PROD
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 5.01 KB 5.01 KB 1.67 KB 1.67 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.3% 1.19 KB 1.19 KB 698 B 696 B UMD_PROD

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js -0.0% -0.1% 540.15 KB 539.92 KB 116.53 KB 116.42 KB NODE_DEV
react-art.production.min.js -0.0% -0.0% 72.5 KB 72.5 KB 21.79 KB 21.79 KB NODE_PROD
ReactART-dev.js -0.1% -0.1% 613.73 KB 613.4 KB 129.04 KB 128.94 KB FB_WWW_DEV
ReactART-prod.js -0.0% -0.0% 249.54 KB 249.52 KB 42.64 KB 42.63 KB FB_WWW_PROD
react-art.development.js -0.0% -0.1% 635.93 KB 635.72 KB 134.09 KB 133.99 KB UMD_DEV
react-art.production.min.js -0.0% -0.0% 107.51 KB 107.51 KB 32.63 KB 32.62 KB UMD_PROD

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer-shallow.production.min.js 0.0% -0.0% 12.73 KB 12.73 KB 3.97 KB 3.96 KB UMD_PROD
react-test-renderer.development.js 0.0% -0.1% 545.82 KB 545.92 KB 117.89 KB 117.79 KB NODE_DEV
react-test-renderer.production.min.js -0.0% -0.0% 74.34 KB 74.33 KB 22.41 KB 22.41 KB NODE_PROD
ReactTestRenderer-dev.js -0.0% -0.1% 578.06 KB 578.04 KB 122.36 KB 122.29 KB FB_WWW_DEV
react-test-renderer.development.js 0.0% -0.1% 572.45 KB 572.61 KB 119.24 KB 119.15 KB UMD_DEV
react-test-renderer.production.min.js -0.0% -0.0% 74.54 KB 74.53 KB 22.73 KB 22.73 KB UMD_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js +0.1% -0.0% 580.76 KB 581.19 KB 123.04 KB 123.02 KB NODE_DEV
react-reconciler-reflection.development.js -1.0% -1.2% 17.57 KB 17.39 KB 5.18 KB 5.12 KB NODE_DEV
react-reconciler.production.min.js -0.0% -0.0% 77.61 KB 77.6 KB 23.06 KB 23.06 KB NODE_PROD
react-reconciler-reflection.production.min.js 0.0% -0.2% 2.92 KB 2.92 KB 1.21 KB 1.21 KB NODE_PROD

ReactDOM: size: 0.0%, gzip: -0.0%

React: size: -0.0%, gzip: -0.1%

Size changes (stable)

Generated by 🚫 dangerJS against 3aca0a0

@sizebot
Copy link
Copy Markdown

sizebot commented Apr 21, 2020

Details of bundled changes.

Comparing: 0960b7b...3aca0a0

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react.development.js -0.3% -0.3% 111.55 KB 111.23 KB 27.22 KB 27.15 KB UMD_DEV
react-jsx-runtime.profiling.min.js 0.0% -0.3% 959 B 959 B 603 B 601 B NODE_PROFILING
react.production.min.js -0.0% -0.1% 12.38 KB 12.38 KB 4.84 KB 4.84 KB UMD_PROD
JSXRuntime-dev.js -0.6% -0.4% 39.67 KB 39.45 KB 11.2 KB 11.15 KB FB_WWW_DEV
react-jsx-dev-runtime.development.js -0.5% -0.4% 34.96 KB 34.78 KB 10.29 KB 10.25 KB NODE_DEV
react-jsx-dev-runtime.production.min.js 0.0% -0.3% 454 B 454 B 322 B 321 B NODE_PROD
react-jsx-dev-runtime.profiling.min.js 0.0% -0.3% 453 B 453 B 320 B 319 B NODE_PROFILING
JSXDEVRuntime-dev.js -0.6% -0.4% 39.09 KB 38.87 KB 11.03 KB 10.98 KB FB_WWW_DEV
react-jsx-runtime.development.js -0.5% -0.4% 35.54 KB 35.36 KB 10.47 KB 10.42 KB NODE_DEV
react-jsx-runtime.production.min.js 0.0% -0.3% 960 B 960 B 603 B 601 B NODE_PROD
react.profiling.min.js -0.0% -0.1% 15.92 KB 15.91 KB 5.94 KB 5.94 KB UMD_PROFILING
react.development.js -0.4% -0.4% 72.66 KB 72.36 KB 19.49 KB 19.41 KB NODE_DEV
react.production.min.js -0.0% -0.1% 7.37 KB 7.36 KB 2.92 KB 2.92 KB NODE_PROD
React-dev.js -0.4% -0.4% 97.85 KB 97.46 KB 23.92 KB 23.83 KB FB_WWW_DEV
React-prod.js -0.1% -0.1% 17.27 KB 17.26 KB 4.52 KB 4.51 KB FB_WWW_PROD
React-profiling.js -0.1% -0.1% 17.27 KB 17.26 KB 4.52 KB 4.51 KB FB_WWW_PROFILING

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactTestUtils-dev.js -0.3% -0.4% 65.04 KB 64.82 KB 17.53 KB 17.46 KB FB_WWW_DEV
react-dom.profiling.min.js -0.0% -0.0% 128.77 KB 128.76 KB 40.23 KB 40.22 KB NODE_PROFILING
ReactDOM-dev.js -0.0% -0.1% 1.01 MB 1.01 MB 231.33 KB 231.11 KB FB_WWW_DEV
ReactDOMServer-dev.js -0.4% -0.3% 161.56 KB 160.88 KB 41.04 KB 40.91 KB FB_WWW_DEV
ReactDOM-prod.js -0.0% -0.0% 434.3 KB 434.28 KB 76.44 KB 76.42 KB FB_WWW_PROD
ReactDOMServer-prod.js -0.0% -0.1% 52.47 KB 52.46 KB 12.69 KB 12.68 KB FB_WWW_PROD
ReactDOM-profiling.js -0.0% -0.0% 445.21 KB 445.18 KB 78.32 KB 78.3 KB FB_WWW_PROFILING
react-dom-unstable-fizz.node.development.js 0.0% -0.1% 5.29 KB 5.29 KB 1.73 KB 1.73 KB NODE_DEV
react-dom-unstable-fizz.node.production.min.js 0.0% -0.3% 1.17 KB 1.17 KB 668 B 666 B NODE_PROD
react-dom-test-utils.development.js -0.3% -0.3% 75.19 KB 75 KB 20.13 KB 20.08 KB UMD_DEV
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 5.03 KB 5.03 KB 1.67 KB 1.68 KB UMD_DEV
ReactDOMTesting-dev.js -0.1% -0.1% 930.07 KB 929.6 KB 207.8 KB 207.59 KB FB_WWW_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.1% 1.2 KB 1.2 KB 705 B 704 B UMD_PROD
ReactDOMTesting-prod.js -0.0% -0.0% 391.14 KB 391.12 KB 71.56 KB 71.55 KB FB_WWW_PROD
react-dom-test-utils.development.js -0.3% -0.3% 70.03 KB 69.85 KB 19.63 KB 19.57 KB NODE_DEV
ReactDOMTesting-profiling.js -0.0% -0.0% 391.14 KB 391.12 KB 71.56 KB 71.55 KB FB_WWW_PROFILING
react-dom-test-utils.production.min.js 0.0% -0.0% 13.12 KB 13.12 KB 4.81 KB 4.81 KB NODE_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.2% 1.02 KB 1.02 KB 617 B 616 B NODE_PROD
react-dom-server.node.development.js -0.4% -0.3% 154.12 KB 153.55 KB 40.77 KB 40.64 KB NODE_DEV
react-dom-server.node.production.min.js -0.0% -0.0% 23.75 KB 23.75 KB 8.76 KB 8.76 KB NODE_PROD
react-dom.development.js 0.0% -0.1% 941.46 KB 941.56 KB 206.23 KB 206.07 KB UMD_DEV
react-dom-server.browser.development.js -0.4% -0.3% 162.44 KB 161.84 KB 41.29 KB 41.15 KB UMD_DEV
react-dom.production.min.js -0.0% -0.0% 124.58 KB 124.57 KB 39.79 KB 39.79 KB UMD_PROD
ReactDOMForked-dev.js -0.0% -0.1% 1.01 MB 1.01 MB 231.5 KB 231.28 KB FB_WWW_DEV
react-dom-server.browser.production.min.js -0.0% -0.0% 23.46 KB 23.45 KB 8.62 KB 8.62 KB UMD_PROD
react-dom.profiling.min.js -0.0% 0.0% 128.44 KB 128.43 KB 40.98 KB 40.99 KB UMD_PROFILING
ReactDOMForked-prod.js -0.0% -0.0% 434.88 KB 434.85 KB 76.52 KB 76.5 KB FB_WWW_PROD
react-dom.development.js 0.0% -0.1% 896.35 KB 896.39 KB 203.67 KB 203.53 KB NODE_DEV
ReactDOMForked-profiling.js -0.0% -0.0% 445.78 KB 445.75 KB 78.41 KB 78.39 KB FB_WWW_PROFILING
react-dom-server.browser.development.js -0.4% -0.3% 152.91 KB 152.33 KB 40.52 KB 40.38 KB NODE_DEV
react-dom.production.min.js -0.0% -0.0% 124.77 KB 124.76 KB 39 KB 38.99 KB NODE_PROD
react-dom-server.browser.production.min.js -0.0% -0.0% 23.35 KB 23.34 KB 8.61 KB 8.61 KB NODE_PROD

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactART-dev.js -0.1% -0.1% 603.71 KB 603.38 KB 127.02 KB 126.92 KB FB_WWW_DEV
ReactART-prod.js -0.0% -0.0% 242.5 KB 242.49 KB 41.42 KB 41.42 KB FB_WWW_PROD
react-art.development.js -0.0% -0.1% 660.06 KB 659.85 KB 138.9 KB 138.8 KB UMD_DEV
react-art.production.min.js -0.0% -0.1% 110.79 KB 110.79 KB 33.59 KB 33.56 KB UMD_PROD
react-art.development.js -0.0% -0.1% 563.28 KB 563.05 KB 121.36 KB 121.26 KB NODE_DEV
react-art.production.min.js -0.0% -0.0% 75.74 KB 75.74 KB 22.77 KB 22.77 KB NODE_PROD

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js +0.1% 0.0% 661.54 KB 661.89 KB 141.93 KB 141.95 KB RN_FB_DEV
ReactNativeRenderer-prod.js 0.0% 🔺+0.1% 272.11 KB 272.18 KB 47 KB 47.03 KB RN_FB_PROD
ReactNativeRenderer-profiling.js 0.0% +0.1% 283.54 KB 283.61 KB 49.22 KB 49.25 KB RN_FB_PROFILING
ReactFabric-dev.js 0.0% -0.0% 638.4 KB 638.43 KB 136.7 KB 136.67 KB RN_OSS_DEV
ReactFabric-prod.js 0.0% 🔺+0.1% 263.95 KB 264.02 KB 45.45 KB 45.48 KB RN_OSS_PROD
ReactFabric-profiling.js 0.0% +0.1% 275.36 KB 275.43 KB 47.66 KB 47.7 KB RN_OSS_PROFILING
ReactFabric-dev.js 0.0% -0.0% 643.21 KB 643.24 KB 137.47 KB 137.45 KB RN_FB_DEV
ReactFabric-prod.js 0.0% 🔺+0.1% 264.11 KB 264.17 KB 45.48 KB 45.51 KB RN_FB_PROD
ReactNativeRenderer-dev.js +0.1% 0.0% 656.74 KB 657.09 KB 141.13 KB 141.15 KB RN_OSS_DEV
ReactFabric-profiling.js 0.0% +0.1% 275.51 KB 275.58 KB 47.69 KB 47.72 KB RN_FB_PROFILING
ReactNativeRenderer-prod.js 0.0% 🔺+0.1% 271.97 KB 272.04 KB 46.97 KB 47 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js 0.0% +0.1% 283.4 KB 283.47 KB 49.19 KB 49.22 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.0% -0.1% 572.47 KB 572.63 KB 119.25 KB 119.16 KB UMD_DEV
react-test-renderer.production.min.js -0.0% -0.0% 74.56 KB 74.56 KB 22.75 KB 22.74 KB UMD_PROD
react-test-renderer-shallow.production.min.js 0.0% -0.0% 12.74 KB 12.74 KB 3.97 KB 3.97 KB UMD_PROD
react-test-renderer.development.js 0.0% -0.1% 545.85 KB 545.95 KB 117.9 KB 117.81 KB NODE_DEV
react-test-renderer.production.min.js -0.0% -0.0% 74.36 KB 74.36 KB 22.43 KB 22.42 KB NODE_PROD
ReactTestRenderer-dev.js -0.0% -0.1% 578.07 KB 578.06 KB 122.37 KB 122.3 KB FB_WWW_DEV

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler-reflection.development.js -1.0% -1.2% 17.58 KB 17.4 KB 5.19 KB 5.12 KB NODE_DEV
react-reconciler-reflection.production.min.js 0.0% -0.2% 2.93 KB 2.93 KB 1.22 KB 1.21 KB NODE_PROD
react-reconciler.development.js +0.1% 0.0% 606.26 KB 606.69 KB 128.36 KB 128.37 KB NODE_DEV
react-reconciler.production.min.js -0.0% -0.0% 81.25 KB 81.25 KB 24.08 KB 24.08 KB NODE_PROD

React: size: -0.0%, gzip: -0.1%

Size changes (experimental)

Generated by 🚫 dangerJS against 3aca0a0

We print component stacks for every error anyway so this is just duplicate
information.
Copy link
Copy Markdown
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

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

ok

(__DEV__
? ' If you meant to render a collection of children, use ' +
'an array instead.' +
'\n in div (at **)'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This one will likely regress full-screen errors in CRA and such, where the extra information ("the above error occurred") isn't shown. That's a problem by itself though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

How do those work today? Ours is using a fork so seems like some missing layering.

If implemented as error boundaries, the information is in the componentStack but I assume it needs a global hook?

Copy link
Copy Markdown
Collaborator

@gaearon gaearon Apr 21, 2020

Choose a reason for hiding this comment

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

Yeah needs something global. They work today by just catching unhandled errors on window.

@sebmarkbage sebmarkbage merged commit 940f48b into facebook:master Apr 21, 2020
@bvaughn
Copy link
Copy Markdown
Contributor

bvaughn commented Apr 21, 2020

This looks like a nice change!

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