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

DevTools: Add root and renderer version to inspected props panel #18963

Merged
merged 2 commits into from
May 21, 2020

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented May 20, 2020

Adds the root API and renderer version to the bottom of the "rendered by" list. (If this info is missing, we degrade gracefully.)

Screenshots

Screen Shot 2020-05-20 at 10 04 22 AM

Screen Shot 2020-05-20 at 10 04 09 AM

@facebook-github-bot facebook-github-bot added React Core Team Opened by a member of the React Core Team CLA Signed labels May 20, 2020

if (hocDisplayNames !== null) {
totalBadgeCount += hocDisplayNames.length;
if (hocDisplayNames === null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This fixes a regression from #18802 I think.

rendererPackageName !== null && rendererVersion !== null
? `${rendererPackageName}@${rendererVersion}`
: null;
const showRenderedBy =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll always show this section now, except for v15.

if (__DEV__) {
switch (tag) {
case BlockingRoot:
this._debugRootType = 'createBlockingRoot()';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This minimizes the coupling between React and DevTools.

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 20, 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 5dbafca:

Sandbox Source
quizzical-field-k9vvw Configuration

@sizebot
Copy link

sizebot commented May 20, 2020

Details of bundled changes.

Comparing: 099f737...5dbafca

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom-test-utils.development.js 0.0% -0.0% 75.66 KB 75.66 KB 20.24 KB 20.23 KB UMD_DEV
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 5.36 KB 5.36 KB 1.81 KB 1.8 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% -0.0% 13.18 KB 13.18 KB 4.9 KB 4.9 KB UMD_PROD
ReactDOMTesting-dev.js 0.0% 0.0% 932.19 KB 932.49 KB 208.31 KB 208.36 KB FB_WWW_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.3% 1.2 KB 1.2 KB 705 B 703 B UMD_PROD
react-dom.development.js 0.0% 0.0% 947.25 KB 947.57 KB 207.23 KB 207.28 KB UMD_DEV
react-dom-server.browser.development.js 0.0% -0.0% 143.86 KB 143.86 KB 36.72 KB 36.71 KB UMD_DEV
react-dom.production.min.js 0.0% -0.0% 124.8 KB 124.8 KB 39.98 KB 39.98 KB UMD_PROD
ReactDOMForked-dev.js 0.0% 0.0% 1.01 MB 1.01 MB 232.12 KB 232.17 KB FB_WWW_DEV
react-dom-server.browser.production.min.js 0.0% -0.0% 20.38 KB 20.38 KB 7.55 KB 7.54 KB UMD_PROD
react-dom.profiling.min.js 0.0% -0.0% 128.9 KB 128.9 KB 41.2 KB 41.2 KB UMD_PROFILING
ReactDOMForked-prod.js 0.0% -0.0% 430.04 KB 430.04 KB 77.72 KB 77.72 KB FB_WWW_PROD
react-dom.development.js 0.0% 0.0% 901.84 KB 902.14 KB 204.65 KB 204.69 KB NODE_DEV
react-dom-server.browser.development.js 0.0% -0.0% 136.47 KB 136.47 KB 36.26 KB 36.26 KB NODE_DEV
react-dom.production.min.js 0.0% -0.0% 124.98 KB 124.98 KB 39.04 KB 39.04 KB NODE_PROD
react-dom-server.browser.production.min.js 0.0% -0.0% 20.3 KB 20.3 KB 7.52 KB 7.52 KB NODE_PROD
react-dom.profiling.min.js 0.0% -0.0% 129.24 KB 129.24 KB 40.37 KB 40.37 KB NODE_PROFILING
ReactDOM-dev.js 0.0% 0.0% 1.01 MB 1.01 MB 229.99 KB 230.03 KB FB_WWW_DEV
ReactDOMServer-dev.js 0.0% -0.0% 143.94 KB 143.94 KB 36.57 KB 36.57 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% -0.0% 46.71 KB 46.71 KB 10.93 KB 10.93 KB FB_WWW_PROD
ReactDOM-profiling.js 0.0% 0.0% 443.97 KB 443.97 KB 78.59 KB 78.59 KB FB_WWW_PROFILING
react-dom-unstable-fizz.node.development.js 0.0% -0.2% 5.61 KB 5.61 KB 1.87 KB 1.86 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.0% -0.0% 70.47 KB 70.47 KB 19.74 KB 19.74 KB NODE_DEV
react-dom-unstable-fizz.browser.development.js 0.0% -0.2% 4.87 KB 4.87 KB 1.71 KB 1.7 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% -0.0% 13.06 KB 13.06 KB 4.81 KB 4.81 KB NODE_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.5% 1.02 KB 1.02 KB 618 B 615 B NODE_PROD
react-dom-server.node.development.js 0.0% -0.0% 137.74 KB 137.74 KB 36.51 KB 36.51 KB NODE_DEV
react-dom-server.node.production.min.js 0.0% -0.0% 20.72 KB 20.72 KB 7.68 KB 7.68 KB NODE_PROD

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js 0.0% 0.0% 664.92 KB 665.24 KB 140.23 KB 140.28 KB UMD_DEV
react-art.production.min.js 0.0% -0.0% 110.98 KB 110.98 KB 33.63 KB 33.62 KB UMD_PROD
react-art.development.js +0.1% 0.0% 567.93 KB 568.23 KB 122.71 KB 122.75 KB NODE_DEV
react-art.production.min.js 0.0% -0.0% 75.93 KB 75.93 KB 22.82 KB 22.82 KB NODE_PROD
ReactART-dev.js 0.0% 0.0% 604.02 KB 604.32 KB 127.26 KB 127.3 KB FB_WWW_DEV

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer-shallow.development.js 0.0% -0.0% 39.17 KB 39.17 KB 9.58 KB 9.58 KB UMD_DEV
ReactTestRenderer-dev.js +0.1% 0.0% 577.97 KB 578.28 KB 122.51 KB 122.55 KB FB_WWW_DEV
react-test-renderer.development.js +0.1% 0.0% 577.4 KB 577.72 KB 120.56 KB 120.6 KB UMD_DEV
react-test-renderer.production.min.js 0.0% -0.0% 74.74 KB 74.74 KB 22.77 KB 22.77 KB UMD_PROD
react-test-renderer.development.js +0.1% 0.0% 550.53 KB 550.83 KB 119.12 KB 119.17 KB NODE_DEV
react-test-renderer.production.min.js 0.0% -0.0% 74.54 KB 74.54 KB 22.47 KB 22.46 KB NODE_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js 0.0% 0.0% 623.89 KB 624.19 KB 132.44 KB 132.5 KB NODE_DEV
react-reconciler.production.min.js 0.0% -0.0% 85.29 KB 85.29 KB 25.48 KB 25.48 KB NODE_PROD
react-reconciler-reflection.development.js 0.0% -0.0% 17.72 KB 17.72 KB 5.24 KB 5.24 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-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactFabric-prod.js 0.0% -0.0% 264.11 KB 264.11 KB 45.51 KB 45.51 KB RN_OSS_PROD
ReactFabric-profiling.js 0.0% 0.0% 276.13 KB 276.13 KB 47.8 KB 47.8 KB RN_OSS_PROFILING
ReactNativeRenderer-prod.js 0.0% -0.0% 272.2 KB 272.2 KB 47.03 KB 47.03 KB RN_OSS_PROD
ReactNativeRenderer-dev.js 0.0% 0.0% 666.65 KB 666.95 KB 143.21 KB 143.25 KB RN_FB_DEV
ReactNativeRenderer-prod.js 0.0% -0.0% 272.16 KB 272.16 KB 47.01 KB 47.01 KB RN_FB_PROD
ReactFabric-dev.js 0.0% 0.0% 643.32 KB 643.62 KB 138.03 KB 138.07 KB RN_OSS_DEV
ReactFabric-dev.js 0.0% 0.0% 647.8 KB 648.1 KB 138.7 KB 138.74 KB RN_FB_DEV
ReactFabric-prod.js 0.0% -0.0% 264.07 KB 264.07 KB 45.5 KB 45.5 KB RN_FB_PROD
ReactNativeRenderer-dev.js 0.0% 0.0% 662.17 KB 662.47 KB 142.54 KB 142.58 KB RN_OSS_DEV

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

Size changes (experimental)

Generated by 🚫 dangerJS against 5dbafca

@sizebot
Copy link

sizebot commented May 20, 2020

Details of bundled changes.

Comparing: 099f737...5dbafca

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactFabric-dev.js 0.0% 0.0% 643.3 KB 643.6 KB 138.02 KB 138.07 KB RN_OSS_DEV
ReactNativeRenderer-dev.js 0.0% 0.0% 662.16 KB 662.46 KB 142.53 KB 142.57 KB RN_OSS_DEV
ReactFabric-prod.js 0.0% -0.0% 264.1 KB 264.1 KB 45.5 KB 45.5 KB RN_OSS_PROD

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom-test-utils.production.min.js 0.0% -0.0% 13.05 KB 13.05 KB 4.8 KB 4.8 KB NODE_PROD
react-dom-server.browser.development.js 0.0% -0.0% 136.36 KB 136.36 KB 34.88 KB 34.88 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% 19.87 KB 19.87 KB 7.44 KB 7.43 KB UMD_PROD
ReactDOMForked-dev.js 0.0% 0.0% 1.04 MB 1.04 MB 237.95 KB 238 KB FB_WWW_DEV
react-dom.development.js 0.0% 0.0% 913.38 KB 913.7 KB 200.75 KB 200.79 KB UMD_DEV
ReactDOMForked-profiling.js 0.0% -0.0% 451.83 KB 451.83 KB 81.35 KB 81.35 KB FB_WWW_PROFILING
react-dom.production.min.js 0.0% -0.0% 120.01 KB 120.01 KB 38.49 KB 38.49 KB UMD_PROD
react-dom.profiling.min.js 0.0% -0.0% 124 KB 124 KB 39.76 KB 39.76 KB UMD_PROFILING
ReactDOMTesting-dev.js 0.0% 0.0% 957.98 KB 958.28 KB 213.99 KB 214.04 KB FB_WWW_DEV
react-dom.development.js 0.0% 0.0% 869.42 KB 869.72 KB 198.22 KB 198.26 KB NODE_DEV
react-dom-server.node.development.js 0.0% -0.0% 130.61 KB 130.61 KB 34.7 KB 34.69 KB NODE_DEV
react-dom.production.min.js 0.0% -0.0% 120.13 KB 120.13 KB 37.59 KB 37.58 KB NODE_PROD
react-dom-test-utils.development.js 0.0% -0.0% 75.65 KB 75.65 KB 20.23 KB 20.23 KB UMD_DEV
react-dom-server.node.production.min.js 0.0% -0.0% 20.2 KB 20.2 KB 7.58 KB 7.58 KB NODE_PROD
react-dom.profiling.min.js 0.0% -0.0% 124.25 KB 124.25 KB 38.85 KB 38.85 KB NODE_PROFILING
react-dom-test-utils.production.min.js 0.0% -0.0% 13.17 KB 13.17 KB 4.89 KB 4.89 KB UMD_PROD
ReactDOM-dev.js 0.0% 0.0% 1.03 MB 1.03 MB 235.68 KB 235.72 KB FB_WWW_DEV
react-dom-test-utils.development.js 0.0% -0.0% 70.46 KB 70.46 KB 19.73 KB 19.73 KB NODE_DEV
react-dom-unstable-fizz.node.development.js 0.0% -0.2% 5.6 KB 5.6 KB 1.86 KB 1.85 KB NODE_DEV
react-dom-server.browser.development.js 0.0% -0.0% 129.34 KB 129.34 KB 34.44 KB 34.44 KB NODE_DEV
react-dom-server.browser.production.min.js 0.0% -0.0% 19.78 KB 19.78 KB 7.43 KB 7.42 KB NODE_PROD
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 5.35 KB 5.35 KB 1.8 KB 1.8 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.4% 1.19 KB 1.19 KB 698 B 695 B UMD_PROD
ReactDOMServer-dev.js 0.0% -0.0% 147.39 KB 147.39 KB 37.46 KB 37.45 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% -0.0% 47.57 KB 47.57 KB 11.14 KB 11.13 KB FB_WWW_PROD
react-dom-unstable-fizz.browser.development.js 0.0% -0.2% 4.85 KB 4.85 KB 1.7 KB 1.69 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

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactART-dev.js 0.0% 0.0% 614.04 KB 614.34 KB 129.29 KB 129.33 KB FB_WWW_DEV
ReactART-prod.js 0.0% -0.0% 249.51 KB 249.51 KB 42.65 KB 42.65 KB FB_WWW_PROD
react-art.development.js +0.1% 0.0% 640.53 KB 640.85 KB 135.32 KB 135.37 KB UMD_DEV
react-art.production.min.js 0.0% -0.0% 107.62 KB 107.62 KB 32.67 KB 32.66 KB UMD_PROD
react-art.development.js +0.1% 0.0% 544.54 KB 544.84 KB 117.77 KB 117.82 KB NODE_DEV
react-art.production.min.js 0.0% -0.0% 72.61 KB 72.61 KB 21.82 KB 21.81 KB NODE_PROD

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactTestRenderer-dev.js +0.1% 0.0% 577.96 KB 578.26 KB 122.5 KB 122.54 KB FB_WWW_DEV
react-test-renderer-shallow.development.js 0.0% -0.0% 39.16 KB 39.16 KB 9.57 KB 9.57 KB UMD_DEV
react-test-renderer.development.js +0.1% 0.0% 577.37 KB 577.7 KB 120.54 KB 120.59 KB UMD_DEV
react-test-renderer.production.min.js 0.0% -0.0% 74.71 KB 74.71 KB 22.75 KB 22.75 KB UMD_PROD
react-test-renderer.development.js +0.1% 0.0% 550.51 KB 550.81 KB 119.11 KB 119.16 KB NODE_DEV
react-test-renderer.production.min.js 0.0% -0.0% 74.51 KB 74.51 KB 22.45 KB 22.44 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.0% 598.12 KB 598.42 KB 127 KB 127.05 KB NODE_DEV
react-reconciler-reflection.development.js 0.0% -0.0% 17.71 KB 17.71 KB 5.24 KB 5.24 KB NODE_DEV
react-reconciler.production.min.js 0.0% -0.0% 81.55 KB 81.55 KB 24.39 KB 24.38 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%

Size changes (stable)

Generated by 🚫 dangerJS against 5dbafca

Comment on lines 432 to 433
{owners !== null &&
owners.length > 0 &&
Copy link
Contributor

@lunaruan lunaruan May 21, 2020

Choose a reason for hiding this comment

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

Are you intentionally checing this condition twice (also in showRenderedBy)?

Copy link
Contributor Author

@bvaughn bvaughn May 21, 2020

Choose a reason for hiding this comment

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

Yes in that the !== null check is for Flow. I guess I could technically get rid of the second owners.length check if I moved owners !== null && owners.length > 0 above into a second variable– or if I added an explicit inline casting- but it seemed kind of not worth doing since it's not really hot path code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll just add the Flow casting to get rid of the second check though 😄 I don't mind.

@bvaughn bvaughn merged commit aefb97e into facebook:master May 21, 2020
@bvaughn bvaughn deleted the devtools-meta-info branch May 21, 2020 21:40
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.

4 participants