react icon indicating copy to clipboard operation
react copied to clipboard

Add more test cases for exhaustive deps check

Open afzalsayed96 opened this issue 3 years ago • 1 comments

Summary

How did you test this change?

There seems to be a discrepancy in eslint-plugin-react-hooks when testing exhaustive deps. The following code reports an error:

const foo = bar || {}

useMemo(() => foo, [foo])

While the below code does not:

const {foo = {}} = bar

useMemo(() => foo, [foo])

I think that this might be a valid edge case which users might run into. Hence, I have added a few test cases as well as extended the eslint plugin logic to catch and report this scenario.

afzalsayed96 avatar Aug 17 '22 13:08 afzalsayed96

Comparing: f993ffc5141a58e2a53d4b822b15744b0542aa93...00c77a6978d54e75631f1565a93f7c9fe901f8a4

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 131.21 kB 131.21 kB = 41.98 kB 41.98 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 136.47 kB 136.47 kB = 43.57 kB 43.58 kB
facebook-www/ReactDOM-prod.classic.js = 434.63 kB 434.63 kB = 79.87 kB 79.87 kB
facebook-www/ReactDOM-prod.modern.js = 419.63 kB 419.63 kB = 77.50 kB 77.50 kB
facebook-www/ReactDOMForked-prod.classic.js = 434.63 kB 434.63 kB = 79.87 kB 79.87 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.min.js +0.95% 25.63 kB 25.87 kB +0.31% 8.78 kB 8.81 kB
oss-stable-semver/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.min.js +0.95% 25.63 kB 25.87 kB +0.31% 8.78 kB 8.81 kB
oss-stable/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.min.js +0.95% 25.63 kB 25.87 kB +0.31% 8.78 kB 8.81 kB
oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js +0.60% 87.43 kB 87.95 kB +0.39% 20.77 kB 20.85 kB
oss-stable-semver/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js +0.60% 87.43 kB 87.95 kB +0.39% 20.77 kB 20.85 kB
oss-stable/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js +0.60% 87.43 kB 87.95 kB +0.39% 20.77 kB 20.85 kB

Generated by :no_entry_sign: dangerJS against 00c77a6978d54e75631f1565a93f7c9fe901f8a4

sizebot avatar Aug 17 '22 13:08 sizebot

This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.

github-actions[bot] avatar Apr 10 '24 02:04 github-actions[bot]

Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you!

github-actions[bot] avatar Apr 17 '24 12:04 github-actions[bot]