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

Move Hook mismatch warning to first mismatch site #14720

Merged
merged 2 commits into from
Jan 30, 2019

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Jan 29, 2019

Allows us to localize the warning logic in one place.

@sizebot
Copy link

sizebot commented Jan 29, 2019

ReactDOM: size: 0.0%, gzip: 0.0%

Details of bundled changes.

Comparing: cb1ff43...abde12b

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js -0.2% -0.2% 751.2 KB 749.66 KB 171.45 KB 171.05 KB UMD_DEV
react-dom.production.min.js 0.0% 0.0% 104.62 KB 104.62 KB 34.01 KB 34.01 KB UMD_PROD
react-dom.development.js -0.2% -0.2% 746.25 KB 744.72 KB 170.04 KB 169.64 KB NODE_DEV
ReactDOM-dev.js -0.2% -0.2% 769.01 KB 767.22 KB 171.28 KB 170.86 KB FB_WWW_DEV
react-dom-unstable-fire.development.js -0.2% -0.2% 751.54 KB 750.01 KB 171.6 KB 171.19 KB UMD_DEV
react-dom-unstable-fire.production.min.js 0.0% 0.0% 104.63 KB 104.63 KB 34.02 KB 34.02 KB UMD_PROD
react-dom-unstable-fire.development.js -0.2% -0.2% 746.6 KB 745.07 KB 170.18 KB 169.78 KB NODE_DEV
react-dom-unstable-fire.profiling.min.js 0.0% -0.0% 107.79 KB 107.79 KB 34.11 KB 34.11 KB NODE_PROFILING
ReactFire-dev.js -0.2% -0.2% 768.22 KB 766.43 KB 171.21 KB 170.78 KB FB_WWW_DEV
ReactFire-prod.js 0.0% -0.0% 302 KB 302 KB 55.2 KB 55.19 KB FB_WWW_PROD
ReactFire-profiling.js 0.0% -0.0% 309.07 KB 309.07 KB 56.57 KB 56.57 KB FB_WWW_PROFILING
react-dom-test-utils.development.js 0.0% -0.0% 44.87 KB 44.87 KB 12.3 KB 12.3 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% -0.0% 9.97 KB 9.97 KB 3.71 KB 3.71 KB UMD_PROD
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.0% 11.01 KB 11.01 KB 3.81 KB 3.81 KB UMD_PROD
react-dom-unstable-native-dependencies.development.js 0.0% -0.0% 60.29 KB 60.29 KB 15.79 KB 15.79 KB NODE_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.0% 10.75 KB 10.75 KB 3.7 KB 3.7 KB NODE_PROD
react-dom-server.browser.development.js 0.0% -0.0% 121.74 KB 121.74 KB 32.57 KB 32.57 KB NODE_DEV
ReactDOMServer-dev.js 0.0% -0.0% 122.7 KB 122.7 KB 32.09 KB 32.08 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% -0.0% 44.78 KB 44.78 KB 10.34 KB 10.34 KB FB_WWW_PROD
react-dom-server.node.development.js 0.0% 0.0% 123.8 KB 123.8 KB 33.12 KB 33.12 KB NODE_DEV
react-dom-server.node.production.min.js 0.0% 0.0% 19.38 KB 19.38 KB 7.46 KB 7.46 KB NODE_PROD
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 3.63 KB 3.63 KB 1.44 KB 1.44 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.1% 1.21 KB 1.21 KB 704 B 705 B UMD_PROD
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 3.45 KB 3.45 KB 1.39 KB 1.39 KB NODE_DEV
react-dom-unstable-fizz.node.development.js 0.0% -0.1% 3.7 KB 3.7 KB 1.42 KB 1.42 KB NODE_DEV

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js -0.3% -0.3% 530.04 KB 528.51 KB 115.06 KB 114.66 KB UMD_DEV
react-art.production.min.js 0.0% -0.0% 96.67 KB 96.67 KB 29.81 KB 29.81 KB UMD_PROD
react-art.development.js -0.3% -0.4% 461.56 KB 460.03 KB 97.96 KB 97.56 KB NODE_DEV
react-art.production.min.js 0.0% -0.0% 61.68 KB 61.68 KB 18.94 KB 18.94 KB NODE_PROD
ReactART-dev.js -0.4% -0.4% 470.73 KB 468.94 KB 97.32 KB 96.9 KB FB_WWW_DEV

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js -0.3% -0.3% 595.56 KB 593.78 KB 127.7 KB 127.28 KB RN_FB_DEV
ReactNativeRenderer-prod.js 0.0% -0.0% 245.17 KB 245.17 KB 42.95 KB 42.95 KB RN_FB_PROD
ReactNativeRenderer-profiling.js 0.0% -0.0% 251.3 KB 251.3 KB 44.25 KB 44.24 KB RN_FB_PROFILING
ReactNativeRenderer-dev.js -0.3% -0.3% 595.48 KB 593.69 KB 127.66 KB 127.24 KB RN_OSS_DEV
ReactNativeRenderer-prod.js 0.0% -0.0% 245.18 KB 245.18 KB 42.95 KB 42.95 KB RN_OSS_PROD
ReactFabric-dev.js -0.3% -0.3% 586.42 KB 584.63 KB 125.44 KB 125.02 KB RN_FB_DEV
ReactFabric-prod.js 0.0% 0.0% 238.37 KB 238.37 KB 41.49 KB 41.49 KB RN_FB_PROD
ReactFabric-dev.js -0.3% -0.3% 586.32 KB 584.53 KB 125.39 KB 124.98 KB RN_OSS_DEV
ReactFabric-prod.js 0.0% 0.0% 238.38 KB 238.38 KB 41.49 KB 41.49 KB RN_OSS_PROD

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js -0.3% -0.4% 474.78 KB 473.25 KB 100.88 KB 100.48 KB UMD_DEV
react-test-renderer.development.js -0.3% -0.4% 469.74 KB 468.21 KB 99.65 KB 99.25 KB NODE_DEV
ReactTestRenderer-dev.js -0.4% -0.4% 479.47 KB 477.68 KB 99.31 KB 98.89 KB FB_WWW_DEV
react-test-renderer-shallow.production.min.js 0.0% -0.0% 11.05 KB 11.05 KB 3.33 KB 3.33 KB UMD_PROD
react-test-renderer-shallow.development.js 0.0% -0.0% 31.14 KB 31.14 KB 7.98 KB 7.98 KB NODE_DEV
react-test-renderer-shallow.production.min.js 0.0% -0.0% 11.69 KB 11.69 KB 3.64 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.3% -0.4% 459.39 KB 457.86 KB 96.46 KB 96.05 KB NODE_DEV
react-reconciler-persistent.development.js -0.3% -0.4% 457.77 KB 456.24 KB 95.81 KB 95.41 KB NODE_DEV
react-reconciler-reflection.production.min.js 0.0% -0.1% 2.56 KB 2.56 KB 1.13 KB 1.13 KB NODE_PROD

Generated by 🚫 dangerJS

Allows us to localize the warning logic in one place.
@acdlite
Copy link
Collaborator Author

acdlite commented Jan 30, 2019

Rebased on master

@acdlite acdlite force-pushed the move-hooks-mismatch-warning branch 3 times, most recently from 77f40ff to 67892af Compare January 30, 2019 01:46
@@ -98,10 +98,6 @@ type HookType =
| 'useImperativeHandle'
| 'useDebugValue';

// the first instance of a hook mismatch in a component,
// represented by a portion of its stacktrace
let currentHookMismatchInDev = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

we were including the trace so peeps could tell which (possibly custom hook) was the offending one. fine to remove?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I suppose in this case the trace would be the stack of the warning itself?

Copy link
Contributor

Choose a reason for hiding this comment

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

right, of course the warning would have its own trace. thanks!

@acdlite acdlite merged commit 70d4075 into facebook:master Jan 30, 2019
n8schloss pushed a commit to n8schloss/react that referenced this pull request Jan 31, 2019
* Move Hook mismatch warning to first mismatch site

Allows us to localize the warning logic in one place.

* Nit
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.

5 participants