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

Remove the condition argument from warning() #17568

Merged
merged 12 commits into from Dec 11, 2019
Merged

Conversation

@walaura
Copy link
Contributor

walaura commented Dec 10, 2019

Step 2 of #16753

  • I've deleted the babel plugin (Woo!) and forked warning-and-invariant-args into warning-argsand invariant-args.
  • toWarnDev and toLowPriorityWarnDev didn't actually need any changes as they track the underlying console calls
  • Some of the conditionals look wonky, not sure how to improve them without humans
  • I don't have java on this laptop yet so can't build but it's installing rn
@codesandbox

This comment has been minimized.

Copy link

codesandbox bot commented Dec 10, 2019

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 653965e:

Sandbox Source
sleepy-colden-pjwlk Configuration
@walaura walaura force-pushed the walaura:codemod branch from dd7650e to fda929a Dec 10, 2019
@sizebot

This comment has been minimized.

Copy link

sizebot commented Dec 10, 2019

Details of bundled changes.

Comparing: 7bf40e1...653965e

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react.development.js -0.4% -0.3% 113.18 KB 112.68 KB 28.71 KB 28.62 KB UMD_DEV
react.production.min.js 0.0% 0.0% 12.52 KB 12.52 KB 4.9 KB 4.9 KB UMD_PROD
React-dev.js -0.3% -0.3% 70.81 KB 70.6 KB 18.21 KB 18.15 KB FB_WWW_DEV
React-prod.js 0.0% 0.0% 17.75 KB 17.75 KB 4.62 KB 4.62 KB FB_WWW_PROD
React-profiling.js 0.0% 0.0% 17.75 KB 17.75 KB 4.62 KB 4.62 KB FB_WWW_PROFILING
react.profiling.min.js 0.0% 0.0% 16.05 KB 16.05 KB 6.01 KB 6.01 KB UMD_PROFILING
react.development.js -0.7% -0.5% 72.93 KB 72.43 KB 19.09 KB 18.99 KB NODE_DEV

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.profiling.min.js 0.0% 0.0% 123.07 KB 123.07 KB 38.81 KB 38.81 KB NODE_PROFILING
react-dom-server.browser.development.js -0.4% -0.2% 140.67 KB 140.06 KB 36.94 KB 36.86 KB UMD_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 20.39 KB 20.39 KB 7.48 KB 7.48 KB UMD_PROD
react-dom-test-utils.development.js -0.4% -0.3% 56.18 KB 55.98 KB 15.54 KB 15.49 KB UMD_DEV
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 3.88 KB 3.88 KB 1.55 KB 1.55 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% 0.0% 11.18 KB 11.18 KB 4.15 KB 4.15 KB UMD_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.1% 1.21 KB 1.21 KB 710 B 711 B UMD_PROD
ReactDOMServer-dev.js -0.4% -0.2% 140.21 KB 139.65 KB 35.48 KB 35.43 KB FB_WWW_DEV
react-dom-test-utils.development.js -0.4% -0.4% 54.45 KB 54.26 KB 15.21 KB 15.15 KB NODE_DEV
ReactDOMServer-prod.js 0.0% 0.0% 48.91 KB 48.91 KB 11.18 KB 11.18 KB FB_WWW_PROD
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 3.71 KB 3.71 KB 1.5 KB 1.5 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% 🔺+0.1% 10.95 KB 10.95 KB 4.09 KB 4.09 KB NODE_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.2% 1.05 KB 1.05 KB 641 B 642 B NODE_PROD
react-dom.development.js -0.2% -0.2% 952.97 KB 951.04 KB 215.77 KB 215.41 KB UMD_DEV
react-dom.production.min.js 0.0% 0.0% 119.11 KB 119.11 KB 38.43 KB 38.43 KB UMD_PROD
react-dom.profiling.min.js 0.0% 0.0% 122.8 KB 122.8 KB 39.52 KB 39.53 KB UMD_PROFILING
ReactDOMUnstableNativeDependencies-dev.js +0.3% +0.7% 58.11 KB 58.31 KB 14.78 KB 14.88 KB FB_WWW_DEV
react-dom.development.js -0.2% -0.2% 947.04 KB 945.11 KB 214.2 KB 213.84 KB NODE_DEV
react-dom-server.node.development.js -0.4% -0.2% 137.71 KB 137.1 KB 36.17 KB 36.09 KB NODE_DEV
react-dom.production.min.js 0.0% 0.0% 119.26 KB 119.26 KB 37.76 KB 37.76 KB NODE_PROD
react-dom-server.node.production.min.js 0.0% 0.0% 20.72 KB 20.72 KB 7.61 KB 7.61 KB NODE_PROD
ReactTestUtils-dev.js +0.8% +0.7% 51.29 KB 51.72 KB 13.92 KB 14.02 KB FB_WWW_DEV
react-dom-server.browser.development.js -0.4% -0.2% 136.6 KB 135.99 KB 35.94 KB 35.87 KB NODE_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 20.31 KB 20.31 KB 7.46 KB 7.46 KB NODE_PROD
react-dom-unstable-native-dependencies.development.js -0.2% -0.3% 60.1 KB 59.97 KB 15.78 KB 15.73 KB UMD_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% 🔺+0.1% 10.73 KB 10.73 KB 3.67 KB 3.67 KB UMD_PROD
ReactDOM-dev.js -0.5% -0.2% 975.19 KB 970.51 KB 216.68 KB 216.14 KB FB_WWW_DEV
ReactDOM-prod.js 0.0% 0.0% 401.68 KB 401.68 KB 73.14 KB 73.14 KB FB_WWW_PROD
react-dom-unstable-native-dependencies.development.js -0.2% -0.3% 59.77 KB 59.64 KB 15.65 KB 15.6 KB NODE_DEV
react-dom-unstable-fizz.node.development.js 0.0% +0.1% 4.42 KB 4.42 KB 1.65 KB 1.65 KB NODE_DEV
ReactDOM-profiling.js 0.0% -0.0% 403.48 KB 403.48 KB 74.14 KB 74.14 KB FB_WWW_PROFILING
react-dom-unstable-native-dependencies.production.min.js 0.0% 🔺+0.1% 10.48 KB 10.48 KB 3.57 KB 3.58 KB NODE_PROD
react-dom-unstable-fizz.node.production.min.js 0.0% 🔺+0.1% 1.21 KB 1.21 KB 696 B 697 B NODE_PROD

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js -0.2% -0.2% 616.47 KB 614.99 KB 131.73 KB 131.45 KB UMD_DEV
react-test-renderer.production.min.js 0.0% 0.0% 71.22 KB 71.22 KB 21.91 KB 21.92 KB UMD_PROD
ReactTestRenderer-dev.js -0.5% -0.3% 626.89 KB 623.51 KB 130.84 KB 130.46 KB FB_WWW_DEV
react-test-renderer-shallow.development.js -0.6% -0.2% 39.15 KB 38.93 KB 10.01 KB 9.99 KB UMD_DEV
react-test-renderer-shallow.production.min.js 0.0% 🔺+0.1% 11.6 KB 11.6 KB 3.58 KB 3.58 KB UMD_PROD
react-test-renderer-shallow.development.js -0.7% -0.2% 33.1 KB 32.88 KB 8.53 KB 8.51 KB NODE_DEV
react-test-renderer-shallow.production.min.js 0.0% 🔺+0.1% 11.73 KB 11.73 KB 3.69 KB 3.69 KB NODE_PROD
react-test-renderer.development.js -0.2% -0.2% 611.74 KB 610.26 KB 130.54 KB 130.26 KB NODE_DEV
react-test-renderer.production.min.js 0.0% 0.0% 70.93 KB 70.93 KB 21.55 KB 21.55 KB NODE_PROD
ReactShallowRenderer-dev.js +0.5% +0.4% 34.04 KB 34.22 KB 8.42 KB 8.46 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.6% -0.4% 747.34 KB 742.96 KB 158.54 KB 157.87 KB RN_OSS_DEV
ReactFabric-profiling.js 0.0% 0.0% 278.29 KB 278.29 KB 48.15 KB 48.15 KB RN_FB_PROFILING
ReactNativeRenderer-prod.js 0.0% 0.0% 276.53 KB 276.53 KB 47.68 KB 47.68 KB RN_FB_PROD
ReactFabric-dev.js -0.6% -0.4% 752.78 KB 748.39 KB 159.38 KB 158.69 KB RN_OSS_DEV
ReactFabric-prod.js 0.0% 0.0% 267.84 KB 267.84 KB 46.23 KB 46.23 KB RN_OSS_PROD
ReactFabric-profiling.js 0.0% 0.0% 277.95 KB 277.95 KB 48.08 KB 48.08 KB RN_OSS_PROFILING
ReactFabric-dev.js -0.6% -0.4% 752.96 KB 748.57 KB 159.46 KB 158.78 KB RN_FB_DEV
ReactNativeRenderer-prod.js 0.0% 0.0% 276.14 KB 276.14 KB 47.61 KB 47.61 KB RN_OSS_PROD
ReactNativeRenderer-dev.js -0.6% -0.4% 747.52 KB 743.14 KB 158.62 KB 157.96 KB RN_FB_DEV

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactART-dev.js -0.5% -0.3% 615.22 KB 612.04 KB 128.27 KB 127.9 KB FB_WWW_DEV
react-art.development.js -0.2% -0.2% 671.54 KB 670.07 KB 146.06 KB 145.78 KB UMD_DEV
react-art.production.min.js 0.0% 0.0% 106.19 KB 106.19 KB 32.35 KB 32.35 KB UMD_PROD
react-art.development.js -0.2% -0.2% 602.19 KB 600.72 KB 128.66 KB 128.38 KB NODE_DEV
react-art.production.min.js 0.0% 0.0% 71.16 KB 71.16 KB 21.5 KB 21.5 KB NODE_PROD

react-cache

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactCache-dev.js +3.7% +5.4% 7.39 KB 7.66 KB 2.39 KB 2.52 KB FB_WWW_DEV
react-cache.development.js -1.4% -1.8% 9.19 KB 9.06 KB 3.11 KB 3.05 KB UMD_DEV
react-cache.production.min.js 0.0% 🔺+0.2% 2.39 KB 2.39 KB 1.22 KB 1.22 KB UMD_PROD
react-cache.development.js -1.4% -1.7% 8.97 KB 8.84 KB 3.03 KB 2.98 KB NODE_DEV
react-cache.production.min.js 0.0% 🔺+0.2% 2.2 KB 2.2 KB 1.13 KB 1.13 KB NODE_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler-persistent.development.js -0.2% -0.2% 600.69 KB 599.21 KB 126.74 KB 126.46 KB NODE_DEV
react-reconciler-reflection.development.js -0.7% -0.7% 19.09 KB 18.97 KB 6.23 KB 6.19 KB NODE_DEV
react-reconciler-persistent.production.min.js 0.0% 0.0% 71.97 KB 71.97 KB 21.31 KB 21.31 KB NODE_PROD
react-reconciler-reflection.production.min.js 0.0% 🔺+0.1% 2.86 KB 2.86 KB 1.24 KB 1.24 KB NODE_PROD
react-reconciler.development.js -0.2% -0.2% 603.22 KB 601.74 KB 127.84 KB 127.55 KB NODE_DEV
react-reconciler.production.min.js 0.0% 0.0% 74.18 KB 74.18 KB 21.87 KB 21.87 KB NODE_PROD

react-is

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-is.development.js -0.6% -0.9% 8.79 KB 8.74 KB 2.63 KB 2.61 KB UMD_DEV
react-is.production.min.js 0.0% 🔺+0.1% 2.52 KB 2.52 KB 974 B 975 B UMD_PROD
react-is.development.js -0.6% -0.9% 8.61 KB 8.56 KB 2.58 KB 2.56 KB NODE_DEV
react-is.production.min.js 0.0% 🔺+0.1% 2.52 KB 2.52 KB 908 B 909 B NODE_PROD
ReactIs-dev.js +3.7% +6.9% 7.03 KB 7.29 KB 1.88 KB 2.01 KB FB_WWW_DEV

ReactDOM: size: 0.0%, gzip: 0.0%

React: size: 0.0%, gzip: 0.0%

Size changes (experimental)

Generated by 🚫 dangerJS against 653965e

@sizebot

This comment has been minimized.

Copy link

sizebot commented Dec 10, 2019

Details of bundled changes.

Comparing: 7bf40e1...653965e

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react.development.js -0.4% -0.3% 113.16 KB 112.66 KB 28.71 KB 28.61 KB UMD_DEV
react.profiling.min.js 0.0% 0.0% 15.83 KB 15.83 KB 5.94 KB 5.94 KB UMD_PROFILING
react.development.js -0.7% -0.5% 72.9 KB 72.4 KB 19.08 KB 18.98 KB NODE_DEV
react.production.min.js 0.0% 0.0% 6.51 KB 6.51 KB 2.71 KB 2.71 KB NODE_PROD

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom-unstable-native-dependencies.production.min.js 0.0% 🔺+0.1% 10.46 KB 10.46 KB 3.56 KB 3.57 KB NODE_PROD
react-dom-server.browser.development.js -0.4% -0.2% 136.58 KB 135.97 KB 35.94 KB 35.86 KB NODE_DEV
react-dom.development.js -0.2% -0.2% 952.95 KB 951.02 KB 215.74 KB 215.38 KB UMD_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 19.85 KB 19.85 KB 7.38 KB 7.38 KB NODE_PROD
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 3.87 KB 3.87 KB 1.54 KB 1.54 KB UMD_DEV
react-dom.production.min.js 0.0% 0.0% 115.77 KB 115.77 KB 37.42 KB 37.43 KB UMD_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.3% 1.2 KB 1.2 KB 701 B 703 B UMD_PROD
react-dom.profiling.min.js 0.0% 0.0% 119.33 KB 119.33 KB 38.53 KB 38.53 KB UMD_PROFILING
react-dom.development.js -0.2% -0.2% 947.01 KB 945.09 KB 214.17 KB 213.81 KB NODE_DEV
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 3.7 KB 3.7 KB 1.49 KB 1.5 KB NODE_DEV
react-dom.production.min.js 0.0% 0.0% 115.88 KB 115.88 KB 36.83 KB 36.83 KB NODE_PROD
react-dom-unstable-native-dependencies.development.js -0.2% -0.3% 60.08 KB 59.96 KB 15.77 KB 15.72 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.2% 1.04 KB 1.04 KB 633 B 634 B NODE_PROD
react-dom.profiling.min.js 0.0% 0.0% 119.57 KB 119.57 KB 37.82 KB 37.82 KB NODE_PROFILING
react-dom-unstable-native-dependencies.production.min.js 0.0% 🔺+0.1% 10.72 KB 10.72 KB 3.67 KB 3.67 KB UMD_PROD
react-dom-unstable-native-dependencies.development.js -0.2% -0.3% 59.76 KB 59.63 KB 15.64 KB 15.59 KB NODE_DEV
react-dom-server.node.development.js -0.4% -0.2% 137.69 KB 137.08 KB 36.16 KB 36.09 KB NODE_DEV
react-dom-test-utils.development.js -0.4% -0.3% 56.17 KB 55.97 KB 15.54 KB 15.49 KB UMD_DEV
react-dom-server.node.production.min.js 0.0% 0.0% 20.26 KB 20.26 KB 7.53 KB 7.53 KB NODE_PROD
react-dom-test-utils.production.min.js 0.0% 0.0% 11.17 KB 11.17 KB 4.14 KB 4.14 KB UMD_PROD
react-dom-test-utils.development.js -0.4% -0.4% 54.44 KB 54.24 KB 15.21 KB 15.15 KB NODE_DEV
react-dom-unstable-fizz.node.development.js 0.0% +0.1% 4.4 KB 4.4 KB 1.64 KB 1.64 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% 🔺+0.1% 10.94 KB 10.94 KB 4.08 KB 4.08 KB NODE_PROD
react-dom-server.browser.development.js -0.4% -0.2% 140.64 KB 140.03 KB 36.93 KB 36.86 KB UMD_DEV
react-dom-unstable-fizz.node.production.min.js 0.0% 🔺+0.1% 1.2 KB 1.2 KB 688 B 689 B NODE_PROD
react-dom-server.browser.production.min.js 0.0% 0.0% 19.93 KB 19.93 KB 7.38 KB 7.39 KB UMD_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.production.min.js 0.0% 0.0% 71.94 KB 71.94 KB 21.29 KB 21.29 KB NODE_PROD
react-reconciler-persistent.development.js -0.2% -0.2% 600.68 KB 599.2 KB 126.74 KB 126.45 KB NODE_DEV
react-reconciler-persistent.production.min.js 0.0% 0.0% 71.95 KB 71.95 KB 21.3 KB 21.3 KB NODE_PROD
react-reconciler.development.js -0.2% -0.2% 603.21 KB 601.73 KB 127.84 KB 127.54 KB NODE_DEV
react-reconciler-reflection.development.js -0.7% -0.7% 19.08 KB 18.95 KB 6.23 KB 6.18 KB NODE_DEV

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js -0.2% -0.2% 671.51 KB 670.05 KB 146.05 KB 145.77 KB UMD_DEV
react-art.production.min.js 0.0% 0.0% 104.17 KB 104.17 KB 31.83 KB 31.83 KB UMD_PROD
react-art.development.js -0.2% -0.2% 602.16 KB 600.7 KB 128.66 KB 128.37 KB NODE_DEV
react-art.production.min.js 0.0% 0.0% 69.18 KB 69.18 KB 20.98 KB 20.98 KB NODE_PROD

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js -0.2% -0.2% 616.44 KB 614.97 KB 131.72 KB 131.44 KB UMD_DEV
react-test-renderer.production.min.js 0.0% 0.0% 71.19 KB 71.19 KB 21.9 KB 21.9 KB UMD_PROD
react-test-renderer.development.js -0.2% -0.2% 611.71 KB 610.24 KB 130.53 KB 130.25 KB NODE_DEV
react-test-renderer.production.min.js 0.0% 0.0% 70.9 KB 70.9 KB 21.53 KB 21.53 KB NODE_PROD
react-test-renderer-shallow.development.js -0.6% -0.2% 39.13 KB 38.92 KB 10 KB 9.98 KB UMD_DEV
react-test-renderer-shallow.production.min.js 0.0% 🔺+0.1% 11.58 KB 11.58 KB 3.57 KB 3.58 KB UMD_PROD
react-test-renderer-shallow.development.js -0.7% -0.2% 33.09 KB 32.87 KB 8.52 KB 8.5 KB NODE_DEV
react-test-renderer-shallow.production.min.js 0.0% 🔺+0.1% 11.72 KB 11.72 KB 3.68 KB 3.68 KB NODE_PROD

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js -0.6% -0.4% 747.5 KB 743.13 KB 158.61 KB 157.95 KB RN_FB_DEV
ReactNativeRenderer-prod.js 0.0% 0.0% 276.52 KB 276.52 KB 47.67 KB 47.68 KB RN_FB_PROD
ReactFabric-dev.js -0.6% -0.4% 752.95 KB 748.56 KB 159.46 KB 158.77 KB RN_FB_DEV
ReactFabric-prod.js 0.0% 0.0% 268.18 KB 268.18 KB 46.3 KB 46.3 KB RN_FB_PROD
ReactFabric-profiling.js 0.0% 0.0% 278.28 KB 278.28 KB 48.14 KB 48.14 KB RN_FB_PROFILING
ReactNativeRenderer-dev.js -0.6% -0.4% 747.33 KB 742.95 KB 158.53 KB 157.86 KB RN_OSS_DEV
ReactNativeRenderer-prod.js 0.0% 0.0% 276.13 KB 276.13 KB 47.6 KB 47.6 KB RN_OSS_PROD
ReactFabric-dev.js -0.6% -0.4% 752.77 KB 748.37 KB 159.37 KB 158.69 KB RN_OSS_DEV
ReactFabric-profiling.js 0.0% 0.0% 277.94 KB 277.94 KB 48.07 KB 48.07 KB RN_OSS_PROFILING

ReactDOM: size: 0.0%, gzip: 0.0%

Size changes (stable)

Generated by 🚫 dangerJS against 653965e

typeof subscribe === 'function',
'Subscription must specify a subscribe function',
);
if (!(typeof getCurrentValue === 'function')) {

This comment has been minimized.

Copy link
@gaearon

gaearon Dec 10, 2019

Member

Let's make a special case and convert these to !== negation directly.

identifier,
MAX_TOUCH_BANK,
);
if (!(identifier <= MAX_TOUCH_BANK)) {

This comment has been minimized.

Copy link
@gaearon

gaearon Dec 10, 2019

Member

Same for these. <= needs to flip to >, < needs to flip to >=, > needs to be <=, and >= needs to become <.

warningWithoutStack(
typeof input === 'string' ||
if (
!(

This comment has been minimized.

Copy link
@gaearon

gaearon Dec 10, 2019

Member

For more complex conditions like this it's fine to leave them as is.

Copy link
Member

gaearon left a comment

  • Let's detect if (!(a === b)) early and instead output if (a !== b) and possibly the same for < and such.
  • Need to fix up warningWithoutStack.www.js. It currently re-exports warning from WWW. But it has the old API. So warningWithoutStack.www.js should now export a function that calls the WWW warning with false as first argument.
@walaura walaura force-pushed the walaura:codemod branch from fda929a to b3bb398 Dec 10, 2019
@walaura

This comment has been minimized.

Copy link
Contributor Author

walaura commented Dec 10, 2019

  • Let's detect if (!(a === b)) early and instead output if (a !== b) and possibly the same for < and such.
  • Need to fix up warningWithoutStack.www.js. It currently re-exports warning from WWW. But it has the old API. So warningWithoutStack.www.js should now export a function that calls the WWW warning with false as first argument.

this should be good now but lemme recheck tomorrow

@gaearon

This comment has been minimized.

Copy link
Member

gaearon commented Dec 11, 2019

I still see the old !(a === b), did you re-run the codemod after those changes?

@gaearon gaearon force-pushed the walaura:codemod branch from adbfabd to 393738b Dec 11, 2019
@gaearon gaearon merged commit 9ac42dd into facebook:master Dec 11, 2019
21 checks passed
21 checks passed
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: build_experimental Your tests passed on CircleCI!
Details
ci/circleci: flow Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: lint_build Your tests passed on CircleCI!
Details
ci/circleci: process_artifacts Your tests passed on CircleCI!
Details
ci/circleci: process_artifacts_experimental Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: sizebot Your tests passed on CircleCI!
Details
ci/circleci: sizebot_experimental Your tests passed on CircleCI!
Details
ci/circleci: test_build Your tests passed on CircleCI!
Details
ci/circleci: test_build_devtools Your tests passed on CircleCI!
Details
ci/circleci: test_build_experimental Your tests passed on CircleCI!
Details
ci/circleci: test_build_prod Your tests passed on CircleCI!
Details
ci/circleci: test_build_prod_experimental Your tests passed on CircleCI!
Details
ci/circleci: test_dom_fixtures Your tests passed on CircleCI!
Details
ci/circleci: test_source Your tests passed on CircleCI!
Details
ci/circleci: test_source_experimental Your tests passed on CircleCI!
Details
ci/circleci: test_source_persistent Your tests passed on CircleCI!
Details
ci/circleci: test_source_prod Your tests passed on CircleCI!
Details
ci/codesandbox Building packages succeeded.
Details
@MuYunyun

This comment has been minimized.

Copy link

MuYunyun commented Dec 21, 2019

👍, the previous usage of warning is warning(false, 'xxx'), it increases the difficult of understanding the code.

In my option, it's naturally more to warn in the condition of true.

if (true) {
  warn('xxx')
}

and why not write waring(true, xxx)? 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.