Skip to content

Conversation

sebmarkbage
Copy link
Collaborator

This was originally added so you could use "break on caught exceptions" but that feature is pretty useless these days since it's used for feature detection and Suspense.

The better pattern is to use the stack trace, jump to source and set a break point here.

Since DevTools injects its own console.error, we could inject a "debugger" statement in there. Conditionally. E.g. React DevTools could have a flag to toggle "break on warnings".

This was originally added so you could use "break on caught exceptions"
but that feature is pretty useless these days since it's used for feature
detection and Suspense.

The better pattern is to use the stack trace, jump to source and set a
break point here.

Since DevTools injects its own console.error, we could inject a "debugger"
statement in there. Conditionally. E.g. React DevTools could have a flag
to toggle "break on warnings".
@sebmarkbage sebmarkbage requested review from bvaughn and gaearon May 29, 2020 18:15
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels May 29, 2020
@codesandbox-ci
Copy link

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 9a6b160:

Sandbox Source
interesting-sammet-ob0kv Configuration

@sizebot
Copy link

sizebot commented May 29, 2020

Details of bundled changes.

Comparing: c03b866...9a6b160

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-jsx-runtime.development.js -1.2% -1.6% 31.13 KB 30.75 KB 9.06 KB 8.91 KB NODE_DEV
react.development.js -0.4% -0.6% 102.27 KB 101.87 KB 24.71 KB 24.56 KB UMD_DEV
react-jsx-dev-runtime.development.js -1.2% -1.6% 30.54 KB 30.17 KB 8.88 KB 8.74 KB NODE_DEV
react-jsx-runtime.profiling.min.js 0.0% +0.2% 945 B 945 B 593 B 594 B NODE_PROFILING
react.development.js -0.6% -0.9% 64.08 KB 63.71 KB 17.15 KB 17 KB NODE_DEV
React-dev.js 0.0% 0.0% 99.87 KB 99.87 KB 24.24 KB 24.24 KB FB_WWW_DEV
React-prod.js 0.0% 0.0% 17.78 KB 17.78 KB 4.63 KB 4.63 KB FB_WWW_PROD
React-profiling.js 0.0% 0.0% 17.78 KB 17.78 KB 4.63 KB 4.63 KB FB_WWW_PROFILING

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js -0.0% -0.1% 876.81 KB 876.43 KB 199.69 KB 199.56 KB NODE_DEV
react-dom-server.node.development.js -0.3% -0.4% 131.63 KB 131.26 KB 34.97 KB 34.83 KB NODE_DEV
react-dom.production.min.js 0.0% -0.0% 121.16 KB 121.16 KB 37.9 KB 37.9 KB NODE_PROD
react-dom-server.browser.development.js -0.3% -0.4% 137.42 KB 137.02 KB 35.16 KB 35.02 KB UMD_DEV
react-dom-server.node.production.min.js 0.0% -0.0% 20.22 KB 20.22 KB 7.59 KB 7.58 KB NODE_PROD
ReactDOMTesting-dev.js 0.0% 0.0% 963.12 KB 963.12 KB 214.98 KB 214.98 KB FB_WWW_DEV
react-dom-test-utils.development.js -0.5% -0.7% 70.46 KB 70.08 KB 19.73 KB 19.59 KB NODE_DEV
ReactDOMTesting-prod.js 0.0% -0.0% 406.25 KB 406.25 KB 74.89 KB 74.89 KB FB_WWW_PROD
react-dom.development.js -0.0% -0.1% 921.18 KB 920.78 KB 202.23 KB 202.1 KB UMD_DEV
react-dom.profiling.min.js 0.0% -0.0% 125.26 KB 125.26 KB 39.13 KB 39.13 KB NODE_PROFILING
react-dom-server.browser.production.min.js 0.0% -0.0% 19.88 KB 19.88 KB 7.44 KB 7.44 KB UMD_PROD
ReactDOM-dev.js 0.0% 0.0% 1.04 MB 1.04 MB 236.9 KB 236.9 KB FB_WWW_DEV
react-dom-server.browser.development.js -0.3% -0.4% 130.36 KB 129.99 KB 34.72 KB 34.58 KB NODE_DEV
react-dom-server.browser.production.min.js 0.0% -0.0% 19.8 KB 19.8 KB 7.43 KB 7.43 KB NODE_PROD
ReactDOMServer-dev.js 0.0% 0.0% 148.32 KB 148.32 KB 37.67 KB 37.67 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% 0.0% 47.44 KB 47.44 KB 11.11 KB 11.11 KB FB_WWW_PROD
react-dom-test-utils.development.js -0.5% -0.7% 75.65 KB 75.25 KB 20.23 KB 20.09 KB UMD_DEV

react-interactions

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-interactions-events/press-legacy.development.js -1.6% -2.7% 23.39 KB 23.02 KB 5.85 KB 5.69 KB NODE_DEV
react-interactions-events/keyboard.development.js 0.0% 0.0% 6.31 KB 6.31 KB 2.31 KB 2.31 KB UMD_DEV
react-interactions-events/press-legacy.production.min.js 0.0% -0.0% 7.16 KB 7.16 KB 2.69 KB 2.69 KB NODE_PROD
react-interactions-events/deprecated-focus.development.js 0.0% 0.0% 16.13 KB 16.13 KB 3.29 KB 3.29 KB NODE_DEV
react-interactions-events/context-menu.production.min.js 0.0% 🔺+0.1% 1.2 KB 1.2 KB 670 B 671 B NODE_PROD
react-interactions-events/press-legacy.development.js -1.6% -2.7% 24.79 KB 24.4 KB 5.98 KB 5.82 KB UMD_DEV
react-interactions-events/press-legacy.production.min.js 0.0% -0.0% 7.36 KB 7.36 KB 2.77 KB 2.77 KB UMD_PROD
react-interactions-events/keyboard.production.min.js 0.0% 🔺+0.1% 2.45 KB 2.45 KB 1.25 KB 1.25 KB UMD_PROD
react-interactions-events/hover.production.min.js 0.0% -0.1% 3.28 KB 3.28 KB 1.15 KB 1.15 KB NODE_PROD

create-subscription

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
create-subscription.development.js -6.3% -6.9% 5.98 KB 5.6 KB 2.2 KB 2.05 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.1% 646.59 KB 646.19 KB 136.25 KB 136.12 KB UMD_DEV
react-art.development.js -0.1% -0.1% 550.27 KB 549.89 KB 118.68 KB 118.54 KB NODE_DEV
ReactART-dev.js 0.0% 0.0% 619.28 KB 619.28 KB 130.23 KB 130.23 KB FB_WWW_DEV

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.1% 583.4 KB 583.01 KB 121.43 KB 121.3 KB UMD_DEV
react-test-renderer.production.min.js 0.0% 0.0% 75.33 KB 75.33 KB 22.9 KB 22.9 KB UMD_PROD
react-test-renderer.development.js -0.1% -0.1% 556.2 KB 555.83 KB 119.97 KB 119.85 KB NODE_DEV
react-test-renderer.production.min.js 0.0% 0.0% 75.13 KB 75.13 KB 22.57 KB 22.57 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.1% 667.99 KB 667.6 KB 143.58 KB 143.44 KB RN_OSS_DEV
ReactFabric-dev.js -0.1% -0.1% 649.23 KB 648.83 KB 139.09 KB 138.95 KB RN_OSS_DEV

react-cache

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-cache.development.js -4.4% -5.3% 8.59 KB 8.22 KB 2.92 KB 2.76 KB NODE_DEV

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js -0.1% -0.1% 605.35 KB 604.98 KB 128.27 KB 128.14 KB NODE_DEV
react-reconciler-reflection.development.js -2.1% -2.8% 17.71 KB 17.33 KB 5.24 KB 5.09 KB NODE_DEV
react-reconciler-reflection.production.min.js 0.0% 🔺+0.1% 2.91 KB 2.91 KB 1.21 KB 1.21 KB NODE_PROD

Size changes (stable)

Generated by 🚫 dangerJS against 9a6b160

@sizebot
Copy link

sizebot commented May 29, 2020

Details of bundled changes.

Comparing: c03b866...9a6b160

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-jsx-runtime.development.js -1.0% -1.3% 36.61 KB 36.23 KB 10.63 KB 10.49 KB NODE_DEV
react.development.js -0.4% -0.5% 112.14 KB 111.74 KB 27.19 KB 27.04 KB UMD_DEV
react-unstable-cache.development.js 0.0% +0.2% 1.05 KB 1.05 KB 588 B 589 B NODE_DEV
react-unstable-cache.production.min.js 0.0% 🔺+0.2% 867 B 867 B 562 B 563 B NODE_PROD
react-jsx-dev-runtime.development.js -1.0% -1.4% 36.03 KB 35.65 KB 10.45 KB 10.31 KB NODE_DEV
react-jsx-dev-runtime.production.min.js 0.0% 🔺+0.3% 453 B 453 B 320 B 321 B NODE_PROD
react-jsx-dev-runtime.profiling.min.js 0.0% +0.3% 452 B 452 B 319 B 320 B NODE_PROFILING
react.production.min.js 0.0% -0.0% 12.49 KB 12.49 KB 4.88 KB 4.88 KB UMD_PROD
react-jsx-runtime.profiling.min.js 0.0% +0.2% 958 B 958 B 601 B 602 B NODE_PROFILING
react.development.js -0.5% -0.8% 73.47 KB 73.09 KB 19.53 KB 19.37 KB NODE_DEV
React-prod.js 0.0% 0.0% 17.64 KB 17.64 KB 4.58 KB 4.58 KB FB_WWW_PROD
React-profiling.js 0.0% 0.0% 17.64 KB 17.64 KB 4.58 KB 4.58 KB FB_WWW_PROFILING

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js -0.0% -0.1% 910.76 KB 910.38 KB 206.32 KB 206.2 KB NODE_DEV
react-dom-server.node.development.js -0.3% -0.4% 138.62 KB 138.24 KB 36.72 KB 36.58 KB NODE_DEV
react-dom-server.browser.development.js -0.3% -0.4% 144.77 KB 144.37 KB 36.93 KB 36.78 KB UMD_DEV
ReactDOMTesting-dev.js 0.0% 0.0% 937.33 KB 937.33 KB 209.45 KB 209.45 KB FB_WWW_DEV
react-dom-test-utils.development.js -0.5% -0.7% 70.47 KB 70.09 KB 19.74 KB 19.6 KB NODE_DEV
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 5.36 KB 5.36 KB 1.8 KB 1.81 KB UMD_DEV
react-dom-unstable-fizz.node.production.min.js 0.0% 🔺+0.3% 1.17 KB 1.17 KB 665 B 667 B NODE_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.1% 1.2 KB 1.2 KB 705 B 706 B UMD_PROD
react-dom.development.js -0.0% -0.1% 956.66 KB 956.26 KB 208.93 KB 208.79 KB UMD_DEV
react-dom.production.min.js 0.0% -0.0% 126.01 KB 126.01 KB 40.35 KB 40.34 KB UMD_PROD
ReactDOMForked-dev.js 0.0% -0.0% 1.02 MB 1.02 MB 233.46 KB 233.46 KB FB_WWW_DEV
react-dom-server.browser.development.js -0.3% -0.4% 137.35 KB 136.97 KB 36.47 KB 36.33 KB NODE_DEV
ReactDOM-profiling.js 0.0% 0.0% 446.21 KB 446.21 KB 78.95 KB 78.96 KB FB_WWW_PROFILING
ReactDOMServer-dev.js 0.0% 0.0% 144.29 KB 144.29 KB 36.69 KB 36.69 KB FB_WWW_DEV
react-dom-test-utils.development.js -0.5% -0.7% 75.66 KB 75.26 KB 20.24 KB 20.1 KB UMD_DEV

react-interactions

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-interactions-events/press-legacy.development.js -1.6% -2.7% 23.41 KB 23.03 KB 5.86 KB 5.7 KB NODE_DEV
react-interactions-events/keyboard.development.js 0.0% 0.0% 6.33 KB 6.33 KB 2.31 KB 2.32 KB UMD_DEV
react-interactions-events/press-legacy.development.js -1.6% -2.7% 24.81 KB 24.41 KB 5.99 KB 5.82 KB UMD_DEV
react-interactions-events/keyboard.production.min.js 0.0% 🔺+0.1% 2.27 KB 2.27 KB 1.19 KB 1.19 KB NODE_PROD
react-interactions-events/hover.development.js 0.0% +0.1% 7.75 KB 7.75 KB 1.64 KB 1.64 KB NODE_DEV

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js -0.1% -0.1% 672.49 KB 672.09 KB 144.25 KB 144.11 KB RN_FB_DEV
ReactFabric-dev.js -0.1% -0.1% 653.72 KB 653.33 KB 139.81 KB 139.67 KB RN_FB_DEV
ReactNativeRenderer-dev.js -0.1% -0.1% 668.01 KB 667.61 KB 143.58 KB 143.44 KB RN_OSS_DEV
ReactFabric-dev.js -0.1% -0.1% 649.24 KB 648.84 KB 139.1 KB 138.96 KB RN_OSS_DEV

create-subscription

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
create-subscription.development.js -6.3% -6.9% 5.99 KB 5.62 KB 2.21 KB 2.06 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.1% 672.59 KB 672.2 KB 141.55 KB 141.41 KB UMD_DEV
react-art.production.min.js 0.0% 0.0% 111.72 KB 111.72 KB 33.87 KB 33.87 KB UMD_PROD
react-art.development.js -0.1% -0.1% 575.18 KB 574.8 KB 123.8 KB 123.67 KB NODE_DEV

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.74 KB 12.74 KB 3.97 KB 3.97 KB UMD_PROD
react-test-renderer.development.js -0.1% -0.1% 583.43 KB 583.03 KB 121.44 KB 121.31 KB UMD_DEV
react-test-renderer.production.min.js 0.0% -0.0% 75.36 KB 75.36 KB 22.92 KB 22.92 KB UMD_PROD
react-test-renderer.development.js -0.1% -0.1% 556.23 KB 555.85 KB 119.98 KB 119.86 KB NODE_DEV
react-test-renderer.production.min.js 0.0% 0.0% 75.15 KB 75.15 KB 22.59 KB 22.59 KB NODE_PROD
ReactTestRenderer-dev.js 0.0% 0.0% 581.28 KB 581.28 KB 122.94 KB 122.94 KB FB_WWW_DEV
react-test-renderer-shallow.development.js 0.0% 0.0% 39.17 KB 39.17 KB 9.58 KB 9.58 KB UMD_DEV

react-cache

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-cache.development.js -4.4% -5.3% 8.61 KB 8.23 KB 2.93 KB 2.77 KB NODE_DEV

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js -0.1% -0.1% 632.65 KB 632.27 KB 133.87 KB 133.74 KB NODE_DEV
react-reconciler-reflection.development.js -2.1% -2.8% 17.72 KB 17.34 KB 5.24 KB 5.1 KB NODE_DEV
react-reconciler.production.min.js 0.0% 0.0% 86.5 KB 86.5 KB 25.78 KB 25.78 KB NODE_PROD

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

Size changes (experimental)

Generated by 🚫 dangerJS against 9a6b160

@sebmarkbage sebmarkbage merged commit cb14168 into facebook:master May 29, 2020
@bvaughn
Copy link
Contributor

bvaughn commented May 29, 2020

Nice!

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