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

Add DEV-only checks for assumption about instance properties #14128

Merged
merged 1 commit into from
Nov 6, 2018

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Nov 6, 2018

I started depending on this in #14112. Adding some DEV-only checks so that we notice if we break this.

if (__DEV__) {
if (finishedWork.type === finishedWork.elementType) {
warning(
instance.props === finishedWork.memoizedProps,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I thought the whole point of your previous PR is that memoizedProps does not include the resolved default props, but instance.props does?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh duh, didn't notice the outer check :D

@sizebot
Copy link

sizebot commented Nov 6, 2018

Details of bundled changes.

Comparing: f777d19...076460d

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js +0.3% +0.1% 705.75 KB 708.1 KB 163.47 KB 163.71 KB UMD_DEV
react-dom.development.js +0.3% +0.1% 701.07 KB 703.41 KB 162.1 KB 162.33 KB NODE_DEV
ReactDOM-dev.js +0.5% +0.2% 721.04 KB 724.37 KB 163.2 KB 163.57 KB FB_WWW_DEV

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js +0.5% +0.2% 492.42 KB 494.77 KB 109.05 KB 109.26 KB UMD_DEV
react-art.development.js +0.6% +0.2% 424.2 KB 426.54 KB 92.01 KB 92.22 KB NODE_DEV
ReactART-dev.js +0.8% +0.4% 430.51 KB 433.84 KB 90.82 KB 91.18 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.5% +0.2% 436.86 KB 439.2 KB 94.7 KB 94.92 KB UMD_DEV
react-test-renderer.development.js +0.5% +0.2% 432.08 KB 434.42 KB 93.55 KB 93.77 KB NODE_DEV
ReactTestRenderer-dev.js +0.8% +0.4% 438.58 KB 441.91 KB 92.67 KB 93.03 KB FB_WWW_DEV

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js +0.6% +0.3% 422.04 KB 424.39 KB 90.47 KB 90.7 KB NODE_DEV
react-reconciler-persistent.development.js +0.6% +0.3% 420.49 KB 422.83 KB 89.84 KB 90.07 KB NODE_DEV

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js +0.6% +0.3% 556.24 KB 559.57 KB 121.61 KB 121.97 KB RN_FB_DEV
ReactNativeRenderer-dev.js +0.6% +0.3% 555.94 KB 559.27 KB 121.52 KB 121.88 KB RN_OSS_DEV
ReactFabric-dev.js +0.6% +0.3% 546.56 KB 549.89 KB 119.13 KB 119.49 KB RN_FB_DEV
ReactFabric-dev.js +0.6% +0.3% 546.59 KB 549.92 KB 119.14 KB 119.5 KB RN_OSS_DEV

scheduler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
scheduler.development.js n/a n/a 0 B 19.17 KB 0 B 5.74 KB UMD_DEV
scheduler.production.min.js n/a n/a 0 B 3.16 KB 0 B 1.53 KB UMD_PROD

Generated by 🚫 dangerJS

@gaearon gaearon merged commit b67c1a2 into facebook:master Nov 6, 2018
n8schloss pushed a commit to n8schloss/react that referenced this pull request Jan 31, 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.

None yet

4 participants