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

Rename inputsAreEqual to areHookInputsEqual & move it to shared #14036

Merged
merged 1 commit into from
Nov 2, 2018

Conversation

Andarist
Copy link
Contributor

I know its bikeshedding but the name of this function triggered my OCD a little bit because it sounds (to me) like a name for a boolean variable. Most commonly other functions with similar purpose are named in the codebase with verb as first work, i.e. isValidElementType.

While renaming it I've also noticed that this code was duplicated and already out of sync (one having a dev warning, one not having it) so I thought it would be also a good thing to move it to shared directory to keep a single source of truth.

@sizebot
Copy link

sizebot commented Oct 30, 2018

ReactDOM: size: 0.0%, gzip: 0.0%

Details of bundled changes.

Comparing: bf9fadf...cc18195

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js 0.0% 0.0% 705.01 KB 705.02 KB 163.13 KB 163.17 KB UMD_DEV
react-dom.production.min.js 0.0% 0.0% 102.57 KB 102.57 KB 33.54 KB 33.54 KB UMD_PROD
react-dom.development.js 0.0% 0.0% 700.32 KB 700.33 KB 161.75 KB 161.79 KB NODE_DEV
react-dom.production.min.js 0.0% 0.0% 102.66 KB 102.66 KB 33.07 KB 33.08 KB NODE_PROD
react-dom-server.browser.development.js +0.2% +0.4% 118.11 KB 118.39 KB 31.23 KB 31.35 KB UMD_DEV
react-dom-server.browser.development.js +0.2% +0.4% 114.24 KB 114.53 KB 30.28 KB 30.39 KB NODE_DEV
react-dom-server.node.development.js +0.2% +0.4% 116.16 KB 116.45 KB 30.82 KB 30.93 KB NODE_DEV
ReactDOM-dev.js 0.0% 0.0% 719.2 KB 719.22 KB 162.66 KB 162.69 KB FB_WWW_DEV
ReactDOM-prod.js 0.0% 0.0% 311.36 KB 311.38 KB 57.41 KB 57.42 KB FB_WWW_PROD
ReactDOMServer-dev.js +0.3% +0.4% 114.25 KB 114.63 KB 29.75 KB 29.87 KB FB_WWW_DEV
react-dom.profiling.min.js -0.0% -0.0% 105.07 KB 105.07 KB 33.41 KB 33.41 KB NODE_PROFILING
ReactDOM-profiling.js 0.0% 0.0% 316.02 KB 316.03 KB 58.38 KB 58.38 KB FB_WWW_PROFILING
react-dom.profiling.min.js 0.0% -0.0% 104.94 KB 104.94 KB 33.93 KB 33.93 KB UMD_PROFILING

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

Copy link
Contributor

@nhunzaker nhunzaker left a comment

Choose a reason for hiding this comment

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

Hey! Thanks for sending this in!

This looks good from my end, and I like that it drops duplication, particularly for warnings. However someone else more familiar with SSR should take a look at this.

If one code path was missing a warning, is there any concern about that behavior changing?

@sophiebits who do you think is the best person to review this?

@sophiebits
Copy link
Collaborator

Seems OK to me. Shared means that it will get copied into each renderer which I guess is fine since that's effectively what we were manually doing before.

Hooks aren't stable so we're allowed to have breaking changes (and we generally feel OK adding warnings in minor releases anyway since they don't affect behavior).

@sophiebits sophiebits merged commit ae196e8 into facebook:master Nov 2, 2018
@sophiebits
Copy link
Collaborator

Thanks!

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

5 participants