From 265359554f906b3faeabd6677bbf95d4b6301e03 Mon Sep 17 00:00:00 2001 From: Nic Bonetto Date: Fri, 20 Oct 2017 15:23:06 -0700 Subject: [PATCH 01/22] Modified tests and corrected error message. #3 --- .../src/__tests__/ReactDOMComponent-test.js | 16 ++++++++++++---- .../src/shared/ReactDOMUnknownPropertyHook.js | 6 ++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js index b1211e03de7b3..9b29c724148c0 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js @@ -2042,7 +2042,9 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Warning: Received `true` for non-boolean attribute `whatever`', + 'If you intentionally tried to pass a boolean, pass it as a string ' + + 'instead: trues="`whatever`". If you mean to conditionally pass an ' + + 'attribute, use a ternary expression: `true`={condition ? value : null}.', ); }); @@ -2055,7 +2057,9 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Warning: Received `true` for non-boolean attribute `whatever`', + 'If you intentionally tried to pass a boolean, pass it as a string ' + + 'instead: `true`="`whatever`". If you mean to conditionally pass an ' + + 'attribute, use a ternary expression: `true`={condition ? value : null}.', ); }); @@ -2230,7 +2234,9 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Warning: Received `true` for non-boolean attribute `whatever`.', + 'If you intentionally tried to pass a boolean, pass it as a string ' + + 'instead: `true`="`whatever`". If you mean to conditionally pass an ' + + 'attribute, use a ternary expression: `true`={condition ? value : null}.', ); }); @@ -2283,7 +2289,9 @@ describe('ReactDOMComponent', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Warning: Received `false` for non-boolean attribute `whatever`.', + 'If you intentionally tried to pass a boolean, pass it as a string ' + + 'instead: `false`="`whatever`". If you mean to conditionally pass an ' + + 'attribute, use a ternary expression: `false`={condition ? value : null}.', ); }); }); diff --git a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js index 3fb07e4ca9c77..86a7651c2ee37 100644 --- a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js @@ -183,10 +183,12 @@ if (__DEV__) { if (typeof value === 'boolean') { warning( DOMProperty.shouldAttributeAcceptBooleanValue(name), - 'Received `%s` for non-boolean attribute `%s`. If this is expected, cast ' + - 'the value to a string.%s', + 'If you intentionally tried to pass a boolean, pass it as a string ' + + 'instead: `%s`="`%s`". If you mean to conditionally pass an ' + + 'attribute, use a ternary expression: `%s`={condition ? value : null}.%s', value, name, + value, getStackAddendum(), ); warnedProperties[name] = true; From 8de9a20d68f7e4287fda880945265517c0dd1a55 Mon Sep 17 00:00:00 2001 From: Nic Bonetto Date: Fri, 20 Oct 2017 15:27:12 -0700 Subject: [PATCH 02/22] Fixed syntax issues. #3 --- .../react-dom/src/__tests__/ReactDOMComponent-test.js | 8 ++++---- .../react-dom/src/shared/ReactDOMUnknownPropertyHook.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js index 9b29c724148c0..d7ba8ab8bdc1b 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js @@ -2043,7 +2043,7 @@ describe('ReactDOMComponent', () => { expectDev(console.error.calls.argsFor(0)[0]).toContain( 'If you intentionally tried to pass a boolean, pass it as a string ' + - 'instead: trues="`whatever`". If you mean to conditionally pass an ' + + 'instead: `true`=\"`whatever`\". If you mean to conditionally pass an ' + 'attribute, use a ternary expression: `true`={condition ? value : null}.', ); }); @@ -2058,7 +2058,7 @@ describe('ReactDOMComponent', () => { expectDev(console.error.calls.argsFor(0)[0]).toContain( 'If you intentionally tried to pass a boolean, pass it as a string ' + - 'instead: `true`="`whatever`". If you mean to conditionally pass an ' + + 'instead: `true`=\"`whatever`\". If you mean to conditionally pass an ' + 'attribute, use a ternary expression: `true`={condition ? value : null}.', ); }); @@ -2235,7 +2235,7 @@ describe('ReactDOMComponent', () => { expectDev(console.error.calls.argsFor(0)[0]).toContain( 'If you intentionally tried to pass a boolean, pass it as a string ' + - 'instead: `true`="`whatever`". If you mean to conditionally pass an ' + + 'instead: `true`=\"`whatever`\". If you mean to conditionally pass an ' + 'attribute, use a ternary expression: `true`={condition ? value : null}.', ); }); @@ -2290,7 +2290,7 @@ describe('ReactDOMComponent', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(console.error.calls.argsFor(0)[0]).toContain( 'If you intentionally tried to pass a boolean, pass it as a string ' + - 'instead: `false`="`whatever`". If you mean to conditionally pass an ' + + 'instead: `false`=\"`whatever`\". If you mean to conditionally pass an ' + 'attribute, use a ternary expression: `false`={condition ? value : null}.', ); }); diff --git a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js index 86a7651c2ee37..8c4cefc170b3b 100644 --- a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js @@ -184,7 +184,7 @@ if (__DEV__) { warning( DOMProperty.shouldAttributeAcceptBooleanValue(name), 'If you intentionally tried to pass a boolean, pass it as a string ' + - 'instead: `%s`="`%s`". If you mean to conditionally pass an ' + + 'instead: `%s`=\"`%s`\". If you mean to conditionally pass an ' + 'attribute, use a ternary expression: `%s`={condition ? value : null}.%s', value, name, From 4ce5b496059f5bb20227c9c55464ed3bd0109574 Mon Sep 17 00:00:00 2001 From: Nic Bonetto Date: Fri, 20 Oct 2017 15:44:28 -0700 Subject: [PATCH 03/22] Modified test. #3 --- packages/react-dom/src/__tests__/ReactDOMAttribute-test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js index dca6ef23ab6b8..640fba1dfc556 100644 --- a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js @@ -54,8 +54,9 @@ describe('ReactDOM unknown attribute', () => { expectDev( normalizeCodeLocInfo(console.error.calls.argsFor(0)[0]), ).toMatch( - 'Warning: Received `true` for non-boolean attribute `unknown`. ' + - 'If this is expected, cast the value to a string.\n' + + 'Warning: If you intentionally tried to pass a boolean, pass it as a string ' + + 'instead: `true`=\"`unknown`\". If you mean to conditionally pass an ' + + 'attribute, use a ternary expression: `true`={condition ? value : null}.\n' + ' in div (at **)', ); expectDev(console.error.calls.count()).toBe(1); From 3d4724e9fc760f838b089c957631dfed6f9ef83a Mon Sep 17 00:00:00 2001 From: Nic Bonetto Date: Fri, 20 Oct 2017 15:56:19 -0700 Subject: [PATCH 04/22] Prettified. #3 --- .../react-dom/src/__tests__/ReactDOMAttribute-test.js | 2 +- .../react-dom/src/__tests__/ReactDOMComponent-test.js | 8 ++++---- .../react-dom/src/shared/ReactDOMUnknownPropertyHook.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js index 640fba1dfc556..f122d1fd3ddcd 100644 --- a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js @@ -55,7 +55,7 @@ describe('ReactDOM unknown attribute', () => { normalizeCodeLocInfo(console.error.calls.argsFor(0)[0]), ).toMatch( 'Warning: If you intentionally tried to pass a boolean, pass it as a string ' + - 'instead: `true`=\"`unknown`\". If you mean to conditionally pass an ' + + 'instead: `true`="`unknown`". If you mean to conditionally pass an ' + 'attribute, use a ternary expression: `true`={condition ? value : null}.\n' + ' in div (at **)', ); diff --git a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js index d7ba8ab8bdc1b..640da984782e2 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js @@ -2043,7 +2043,7 @@ describe('ReactDOMComponent', () => { expectDev(console.error.calls.argsFor(0)[0]).toContain( 'If you intentionally tried to pass a boolean, pass it as a string ' + - 'instead: `true`=\"`whatever`\". If you mean to conditionally pass an ' + + 'instead: `true`="`whatever`". If you mean to conditionally pass an ' + 'attribute, use a ternary expression: `true`={condition ? value : null}.', ); }); @@ -2058,7 +2058,7 @@ describe('ReactDOMComponent', () => { expectDev(console.error.calls.argsFor(0)[0]).toContain( 'If you intentionally tried to pass a boolean, pass it as a string ' + - 'instead: `true`=\"`whatever`\". If you mean to conditionally pass an ' + + 'instead: `true`="`whatever`". If you mean to conditionally pass an ' + 'attribute, use a ternary expression: `true`={condition ? value : null}.', ); }); @@ -2235,7 +2235,7 @@ describe('ReactDOMComponent', () => { expectDev(console.error.calls.argsFor(0)[0]).toContain( 'If you intentionally tried to pass a boolean, pass it as a string ' + - 'instead: `true`=\"`whatever`\". If you mean to conditionally pass an ' + + 'instead: `true`="`whatever`". If you mean to conditionally pass an ' + 'attribute, use a ternary expression: `true`={condition ? value : null}.', ); }); @@ -2290,7 +2290,7 @@ describe('ReactDOMComponent', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(console.error.calls.argsFor(0)[0]).toContain( 'If you intentionally tried to pass a boolean, pass it as a string ' + - 'instead: `false`=\"`whatever`\". If you mean to conditionally pass an ' + + 'instead: `false`="`whatever`". If you mean to conditionally pass an ' + 'attribute, use a ternary expression: `false`={condition ? value : null}.', ); }); diff --git a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js index 8c4cefc170b3b..86a7651c2ee37 100644 --- a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js @@ -184,7 +184,7 @@ if (__DEV__) { warning( DOMProperty.shouldAttributeAcceptBooleanValue(name), 'If you intentionally tried to pass a boolean, pass it as a string ' + - 'instead: `%s`=\"`%s`\". If you mean to conditionally pass an ' + + 'instead: `%s`="`%s`". If you mean to conditionally pass an ' + 'attribute, use a ternary expression: `%s`={condition ? value : null}.%s', value, name, From 449b98d48d04defc84ec574c7d81531ac2b3bf6e Mon Sep 17 00:00:00 2001 From: Nic Bonetto Date: Tue, 24 Oct 2017 15:42:37 -0700 Subject: [PATCH 05/22] Changed warning message to handle true and false boolean values. #3 --- .../src/__tests__/ReactDOMAttribute-test.js | 5 ++--- .../src/__tests__/ReactDOMComponent-test.js | 21 ++++++++----------- .../src/shared/ReactDOMUnknownPropertyHook.js | 19 +++++++++++------ 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js index f122d1fd3ddcd..cd9aa9012fcaf 100644 --- a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js @@ -54,9 +54,8 @@ describe('ReactDOM unknown attribute', () => { expectDev( normalizeCodeLocInfo(console.error.calls.argsFor(0)[0]), ).toMatch( - 'Warning: If you intentionally tried to pass a boolean, pass it as a string ' + - 'instead: `true`="`unknown`". If you mean to conditionally pass an ' + - 'attribute, use a ternary expression: `true`={condition ? value : null}.\n' + + 'Warning: Received `true` for non-boolean attribute `unknown`. If this is expected, cast ' + + 'the value to a string.\n' + ' in div (at **)', ); expectDev(console.error.calls.count()).toBe(1); diff --git a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js index 640da984782e2..a33ece8c11c9f 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js @@ -2042,9 +2042,8 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'If you intentionally tried to pass a boolean, pass it as a string ' + - 'instead: `true`="`whatever`". If you mean to conditionally pass an ' + - 'attribute, use a ternary expression: `true`={condition ? value : null}.', + 'Received `true` for non-boolean attribute `whatever`. If this is expected, cast ' + + 'the value to a string.', ); }); @@ -2057,9 +2056,8 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'If you intentionally tried to pass a boolean, pass it as a string ' + - 'instead: `true`="`whatever`". If you mean to conditionally pass an ' + - 'attribute, use a ternary expression: `true`={condition ? value : null}.', + 'Received `true` for non-boolean attribute `whatever`. If this is expected, cast ' + + 'the value to a string.', ); }); @@ -2234,9 +2232,8 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'If you intentionally tried to pass a boolean, pass it as a string ' + - 'instead: `true`="`whatever`". If you mean to conditionally pass an ' + - 'attribute, use a ternary expression: `true`={condition ? value : null}.', + 'Received `true` for non-boolean attribute `whatever`. If this is expected, cast ' + + 'the value to a string.', ); }); @@ -2289,9 +2286,9 @@ describe('ReactDOMComponent', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'If you intentionally tried to pass a boolean, pass it as a string ' + - 'instead: `false`="`whatever`". If you mean to conditionally pass an ' + - 'attribute, use a ternary expression: `false`={condition ? value : null}.', + 'If you mean to conditionally pass an attribute, use a ternary ' + + 'expression: `false`={condition ? value : null} instead of ' + + '{condition && value}.', ); }); }); diff --git a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js index 86a7651c2ee37..79dc9f06630b5 100644 --- a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js @@ -180,19 +180,26 @@ if (__DEV__) { return true; } - if (typeof value === 'boolean') { + if (typeof value === 'boolean' && value === false) { warning( DOMProperty.shouldAttributeAcceptBooleanValue(name), - 'If you intentionally tried to pass a boolean, pass it as a string ' + - 'instead: `%s`="`%s`". If you mean to conditionally pass an ' + - 'attribute, use a ternary expression: `%s`={condition ? value : null}.%s', - value, - name, + 'If you mean to conditionally pass an attribute, use a ternary ' + + 'expression: `%s`={condition ? value : undefined} instead of ' + + '{condition && value}.%s', value, getStackAddendum(), ); warnedProperties[name] = true; return true; + } else if (typeof value === 'boolean') { + warning( + DOMProperty.shouldAttributeAcceptBooleanValue(name), + 'Received `%s` for non-boolean attribute `%s`. If this is expected, cast ' + + 'the value to a string.%s', + value, + name, + getStackAddendum(), + ); } // Now that we've validated casing, do not validate From bb7978c064599c49d795a89cc8753d32ba71e938 Mon Sep 17 00:00:00 2001 From: Nic Bonetto Date: Tue, 24 Oct 2017 15:50:22 -0700 Subject: [PATCH 06/22] Changed test to contain undefined instead of value. #3 --- packages/react-dom/src/__tests__/ReactDOMComponent-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js index a33ece8c11c9f..5916e3bbdca7e 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js @@ -2287,7 +2287,7 @@ describe('ReactDOMComponent', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(console.error.calls.argsFor(0)[0]).toContain( 'If you mean to conditionally pass an attribute, use a ternary ' + - 'expression: `false`={condition ? value : null} instead of ' + + 'expression: `false`={condition ? value : undefined} instead of ' + '{condition && value}.', ); }); From 05ecf0a8a80d4cd12b0c6217a6ce17ade40da3f2 Mon Sep 17 00:00:00 2001 From: Nic Bonetto Date: Thu, 26 Oct 2017 12:50:55 -0700 Subject: [PATCH 07/22] Simplified branch structure. #3 --- .../src/shared/ReactDOMUnknownPropertyHook.js | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js index 79dc9f06630b5..5ab7f75fab68c 100644 --- a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js @@ -180,26 +180,28 @@ if (__DEV__) { return true; } - if (typeof value === 'boolean' && value === false) { - warning( - DOMProperty.shouldAttributeAcceptBooleanValue(name), - 'If you mean to conditionally pass an attribute, use a ternary ' + - 'expression: `%s`={condition ? value : undefined} instead of ' + - '{condition && value}.%s', - value, - getStackAddendum(), - ); + if (typeof value === 'boolean') { + if (value === true) { + warning( + DOMProperty.shouldAttributeAcceptBooleanValue(name), + 'Received `%s` for non-boolean attribute `%s`. If this is expected, cast ' + + 'the value to a string.%s', + value, + name, + getStackAddendum(), + ); + } else { + warning( + DOMProperty.shouldAttributeAcceptBooleanValue(name), + 'If you mean to conditionally pass an attribute, use a ternary ' + + 'expression: `%s`={condition ? value : undefined} instead of ' + + '{condition && value}.%s', + value, + getStackAddendum(), + ); + } warnedProperties[name] = true; return true; - } else if (typeof value === 'boolean') { - warning( - DOMProperty.shouldAttributeAcceptBooleanValue(name), - 'Received `%s` for non-boolean attribute `%s`. If this is expected, cast ' + - 'the value to a string.%s', - value, - name, - getStackAddendum(), - ); } // Now that we've validated casing, do not validate From e18a23552b92af876935e7169c3f3e3c29dd28dc Mon Sep 17 00:00:00 2001 From: Nic Bonetto Date: Thu, 26 Oct 2017 15:59:48 -0700 Subject: [PATCH 08/22] Refactored branching logic. #3 --- .../react-dom/src/shared/ReactDOMUnknownPropertyHook.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js index 5ab7f75fab68c..fa1ec29037644 100644 --- a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js @@ -180,10 +180,13 @@ if (__DEV__) { return true; } - if (typeof value === 'boolean') { + if ( + typeof value === 'boolean' && + !DOMProperty.shouldAttributeAcceptBooleanValue(name) + ) { if (value === true) { warning( - DOMProperty.shouldAttributeAcceptBooleanValue(name), + false, 'Received `%s` for non-boolean attribute `%s`. If this is expected, cast ' + 'the value to a string.%s', value, @@ -192,7 +195,7 @@ if (__DEV__) { ); } else { warning( - DOMProperty.shouldAttributeAcceptBooleanValue(name), + false, 'If you mean to conditionally pass an attribute, use a ternary ' + 'expression: `%s`={condition ? value : undefined} instead of ' + '{condition && value}.%s', From 9fc2b7f11dd6bc50263b56bda771bc254a71291c Mon Sep 17 00:00:00 2001 From: Nic Bonetto Date: Fri, 27 Oct 2017 19:20:47 -0700 Subject: [PATCH 09/22] Refactored falsy warning message and tests. #3 --- .../src/__tests__/ReactDOMAttribute-test.js | 4 ++-- .../src/__tests__/ReactDOMComponent-test.js | 18 +++++++++--------- .../src/shared/ReactDOMUnknownPropertyHook.js | 9 ++++++--- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js index cd9aa9012fcaf..dca6ef23ab6b8 100644 --- a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js @@ -54,8 +54,8 @@ describe('ReactDOM unknown attribute', () => { expectDev( normalizeCodeLocInfo(console.error.calls.argsFor(0)[0]), ).toMatch( - 'Warning: Received `true` for non-boolean attribute `unknown`. If this is expected, cast ' + - 'the value to a string.\n' + + 'Warning: Received `true` for non-boolean attribute `unknown`. ' + + 'If this is expected, cast the value to a string.\n' + ' in div (at **)', ); expectDev(console.error.calls.count()).toBe(1); diff --git a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js index 5916e3bbdca7e..7bd9d1e9efeef 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js @@ -2042,8 +2042,8 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Received `true` for non-boolean attribute `whatever`. If this is expected, cast ' + - 'the value to a string.', + 'Received `true` for non-boolean attribute `whatever`. ' + + 'If this is expected, cast the value to a string.', ); }); @@ -2056,8 +2056,8 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Received `true` for non-boolean attribute `whatever`. If this is expected, cast ' + - 'the value to a string.', + 'Received `true` for non-boolean attribute `whatever`. ' + + 'If this is expected, cast the value to a string.', ); }); @@ -2232,8 +2232,8 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Received `true` for non-boolean attribute `whatever`. If this is expected, cast ' + - 'the value to a string.', + 'Received `true` for non-boolean attribute `whatever`. ' + + 'If this is expected, cast the value to a string.', ); }); @@ -2286,9 +2286,9 @@ describe('ReactDOMComponent', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'If you mean to conditionally pass an attribute, use a ternary ' + - 'expression: `false`={condition ? value : undefined} instead of ' + - '{condition && value}.', + 'Received `false` for non-boolean attribute `whatever`. If you mean to conditionally ' + + 'pass an attribute, use a ternary expression: {condition ? `whatever` : undefined} ' + + 'instead of {condition && `whatever`}.', ); }); }); diff --git a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js index fa1ec29037644..6bae840b1204a 100644 --- a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js @@ -196,10 +196,13 @@ if (__DEV__) { } else { warning( false, - 'If you mean to conditionally pass an attribute, use a ternary ' + - 'expression: `%s`={condition ? value : undefined} instead of ' + - '{condition && value}.%s', + 'Received `%s` for non-boolean attribute `%s`. If you mean to conditionally ' + + 'pass an attribute, use a ternary expression: {condition ? `%s` : undefined} ' + + 'instead of {condition && `%s`}.%s', value, + name, + name, + name, getStackAddendum(), ); } From ede38f3bacbfb53cd58a1eee3f9005a503a3405e Mon Sep 17 00:00:00 2001 From: Nic Bonetto Date: Fri, 27 Oct 2017 19:50:34 -0700 Subject: [PATCH 10/22] Changed condition to attribute name. #3 --- packages/react-dom/src/__tests__/ReactDOMComponent-test.js | 4 ++-- packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js index 7bd9d1e9efeef..3074b896fa82d 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js @@ -2287,8 +2287,8 @@ describe('ReactDOMComponent', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(console.error.calls.argsFor(0)[0]).toContain( 'Received `false` for non-boolean attribute `whatever`. If you mean to conditionally ' + - 'pass an attribute, use a ternary expression: {condition ? `whatever` : undefined} ' + - 'instead of {condition && `whatever`}.', + 'pass an attribute, use a ternary expression: {`whatever` ? value : undefined} ' + + 'instead of {`whatever` && value}.', ); }); }); diff --git a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js index 6bae840b1204a..566f5919b7436 100644 --- a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js @@ -197,8 +197,8 @@ if (__DEV__) { warning( false, 'Received `%s` for non-boolean attribute `%s`. If you mean to conditionally ' + - 'pass an attribute, use a ternary expression: {condition ? `%s` : undefined} ' + - 'instead of {condition && `%s`}.%s', + 'pass an attribute, use a ternary expression: {`%s` ? value : undefined} ' + + 'instead of {`%s` && value}.%s', value, name, name, From ae6fcbfce1eac421d52bf8dcdbd98418b6319e9c Mon Sep 17 00:00:00 2001 From: Nic Bonetto Date: Sat, 28 Oct 2017 18:31:08 -0700 Subject: [PATCH 11/22] Refactored falsy and truthy warning messages with tests updated. #3 --- .../src/__tests__/ReactDOMAttribute-test.js | 5 ++-- .../src/__tests__/ReactDOMComponent-test.js | 24 ++++++++++++------- .../src/shared/ReactDOMUnknownPropertyHook.js | 23 ++++++++++++++---- 3 files changed, 36 insertions(+), 16 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js index dca6ef23ab6b8..51626658b82c7 100644 --- a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js @@ -54,8 +54,9 @@ describe('ReactDOM unknown attribute', () => { expectDev( normalizeCodeLocInfo(console.error.calls.argsFor(0)[0]), ).toMatch( - 'Warning: Received `true` for non-boolean attribute `unknown`. ' + - 'If this is expected, cast the value to a string.\n' + + 'Warning: Received `true` for non-boolean attribute `unknown`.\n\n ' + + 'If you want `unknown` to appear in the DOM, cast it as a string. ' + + 'For example, you can pass `unknown="true"` or `unknown={value.toString()} instead.\n' + ' in div (at **)', ); expectDev(console.error.calls.count()).toBe(1); diff --git a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js index 3074b896fa82d..e15492e52a11a 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js @@ -2042,8 +2042,9 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Received `true` for non-boolean attribute `whatever`. ' + - 'If this is expected, cast the value to a string.', + 'Received `true` for non-boolean attribute `whatever`.\n\n' + + 'If you want `whatever` to appear in the DOM, cast it to a string. ' + + 'For example, you can pass `whatever="true"` or `whatever={value.toString()}` instead.', ); }); @@ -2056,8 +2057,9 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Received `true` for non-boolean attribute `whatever`. ' + - 'If this is expected, cast the value to a string.', + 'Received `true` for non-boolean attribute `whatever`.\n\n' + + 'If you want `whatever` to appear in the DOM, cast it to a string. ' + + 'For example, you can pass `whatever="true"` or `whatever={value.toString()}` instead.', ); }); @@ -2232,8 +2234,9 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Received `true` for non-boolean attribute `whatever`. ' + - 'If this is expected, cast the value to a string.', + 'Received `true` for non-boolean attribute `whatever`.\n\n' + + 'If you want `whatever` to appear in the DOM, cast it to a string. ' + + 'For example, you can pass `whatever="true"` or `whatever={value.toString()}` instead.', ); }); @@ -2286,9 +2289,12 @@ describe('ReactDOMComponent', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Received `false` for non-boolean attribute `whatever`. If you mean to conditionally ' + - 'pass an attribute, use a ternary expression: {`whatever` ? value : undefined} ' + - 'instead of {`whatever` && value}.', + 'Received `false` for non-boolean attribute `whatever`.\n\n ' + + 'If you want `whatever` to appear in the DOM, cast it to a string. ' + + 'For example, you can pass `whatever="false"` or `whatever={value.toString()}.\n\n' + + 'If you want to omit `whatever` based on a condition, use a ternary expression. ' + + 'For example, you can pass `whatever={condition ? value : undefined}` ' + + 'instead of `whatever={condition && value}`.', ); }); }); diff --git a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js index 566f5919b7436..dd432d03f423b 100644 --- a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js @@ -187,8 +187,13 @@ if (__DEV__) { if (value === true) { warning( false, - 'Received `%s` for non-boolean attribute `%s`. If this is expected, cast ' + - 'the value to a string.%s', + 'Received `%s` for non-boolean attribute `%s`.\n\n' + + 'If you want `%s` to appear in the DOM, cast it to a string. ' + + 'For example, you can pass `%s="%s"` or `%s={value.toString()}` instead.%s', + value, + name, + name, + name, value, name, getStackAddendum(), @@ -196,13 +201,21 @@ if (__DEV__) { } else { warning( false, - 'Received `%s` for non-boolean attribute `%s`. If you mean to conditionally ' + - 'pass an attribute, use a ternary expression: {`%s` ? value : undefined} ' + - 'instead of {`%s` && value}.%s', + 'Received `%s` for non-boolean attribute `%s`.\n\n ' + + 'If you want `%s` to appear in the DOM, cast it to a string. ' + + 'For example, you can pass `%s="%s"` or `%s={value.toString()}.\n\n' + + 'If you want to omit `%s` based on a condition, use a ternary expression. ' + + 'For example, you can pass `%s={condition ? value : undefined}` ' + + 'instead of `%s={condition && value}`.%s', value, name, name, name, + value, + name, + name, + name, + name, getStackAddendum(), ); } From aada64cebb0217518e4bd996469783ca3da8e697 Mon Sep 17 00:00:00 2001 From: Nic Bonetto Date: Sat, 28 Oct 2017 18:34:53 -0700 Subject: [PATCH 12/22] Added missing character. #3 --- packages/react-dom/src/__tests__/ReactDOMAttribute-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js index 51626658b82c7..7767325920bfe 100644 --- a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js @@ -56,7 +56,7 @@ describe('ReactDOM unknown attribute', () => { ).toMatch( 'Warning: Received `true` for non-boolean attribute `unknown`.\n\n ' + 'If you want `unknown` to appear in the DOM, cast it as a string. ' + - 'For example, you can pass `unknown="true"` or `unknown={value.toString()} instead.\n' + + 'For example, you can pass `unknown="true"` or `unknown={value.toString()}` instead.\n' + ' in div (at **)', ); expectDev(console.error.calls.count()).toBe(1); From de26d9d7e5e3260d5307ae89498ba8c368252ccf Mon Sep 17 00:00:00 2001 From: Nic Bonetto Date: Sat, 28 Oct 2017 19:14:13 -0700 Subject: [PATCH 13/22] Fixed warning message. #3 --- packages/react-dom/src/__tests__/ReactDOMAttribute-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js index 7767325920bfe..308e24334717e 100644 --- a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js @@ -55,7 +55,7 @@ describe('ReactDOM unknown attribute', () => { normalizeCodeLocInfo(console.error.calls.argsFor(0)[0]), ).toMatch( 'Warning: Received `true` for non-boolean attribute `unknown`.\n\n ' + - 'If you want `unknown` to appear in the DOM, cast it as a string. ' + + 'If you want `unknown` to appear in the DOM, cast it to a string. ' + 'For example, you can pass `unknown="true"` or `unknown={value.toString()}` instead.\n' + ' in div (at **)', ); From c7ee43d25a3be0f2d0e5ba037f0b6ec2ecc2f284 Mon Sep 17 00:00:00 2001 From: Nic Bonetto Date: Sat, 28 Oct 2017 20:11:19 -0700 Subject: [PATCH 14/22] Cleared extra whitespace. #3 --- packages/react-dom/src/__tests__/ReactDOMAttribute-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js index 308e24334717e..7b2f8da200941 100644 --- a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js @@ -54,7 +54,7 @@ describe('ReactDOM unknown attribute', () => { expectDev( normalizeCodeLocInfo(console.error.calls.argsFor(0)[0]), ).toMatch( - 'Warning: Received `true` for non-boolean attribute `unknown`.\n\n ' + + 'Warning: Received `true` for non-boolean attribute `unknown`.\n\n' + 'If you want `unknown` to appear in the DOM, cast it to a string. ' + 'For example, you can pass `unknown="true"` or `unknown={value.toString()}` instead.\n' + ' in div (at **)', From 2c19ea301d73a43c2774c33c41e59f2a1224dc84 Mon Sep 17 00:00:00 2001 From: Nic Bonetto Date: Sun, 29 Oct 2017 15:09:39 -0700 Subject: [PATCH 15/22] Refactored warning messages to be clear. #3 --- .../src/__tests__/ReactDOMAttribute-test.js | 6 ++-- .../src/__tests__/ReactDOMComponent-test.js | 29 +++++++++---------- .../src/shared/ReactDOMUnknownPropertyHook.js | 22 ++++++-------- 3 files changed, 26 insertions(+), 31 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js index 7b2f8da200941..e0390284a733f 100644 --- a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js @@ -54,9 +54,9 @@ describe('ReactDOM unknown attribute', () => { expectDev( normalizeCodeLocInfo(console.error.calls.argsFor(0)[0]), ).toMatch( - 'Warning: Received `true` for non-boolean attribute `unknown`.\n\n' + - 'If you want `unknown` to appear in the DOM, cast it to a string. ' + - 'For example, you can pass `unknown="true"` or `unknown={value.toString()}` instead.\n' + + 'Received `true` for the non-boolean attribute `unknown`.\n\n' + + 'If you want to write it to the DOM, pass a string instead: ' + + 'unknown="true" or unknown={value.toString()}.\n' + ' in div (at **)', ); expectDev(console.error.calls.count()).toBe(1); diff --git a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js index e15492e52a11a..e59372d2c6a78 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js @@ -2042,9 +2042,9 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Received `true` for non-boolean attribute `whatever`.\n\n' + - 'If you want `whatever` to appear in the DOM, cast it to a string. ' + - 'For example, you can pass `whatever="true"` or `whatever={value.toString()}` instead.', + 'Received `true` for the non-boolean attribute `whatever`.\n\n' + + 'If you want to write it to the DOM, pass a string instead: ' + + 'whatever="true" or whatever={value.toString()}.', ); }); @@ -2057,9 +2057,9 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Received `true` for non-boolean attribute `whatever`.\n\n' + - 'If you want `whatever` to appear in the DOM, cast it to a string. ' + - 'For example, you can pass `whatever="true"` or `whatever={value.toString()}` instead.', + 'Received `true` for the non-boolean attribute `whatever`.\n\n' + + 'If you want to write it to the DOM, pass a string instead: ' + + 'whatever="true" or whatever={value.toString()}.', ); }); @@ -2234,9 +2234,9 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Received `true` for non-boolean attribute `whatever`.\n\n' + - 'If you want `whatever` to appear in the DOM, cast it to a string. ' + - 'For example, you can pass `whatever="true"` or `whatever={value.toString()}` instead.', + 'Received `true` for the non-boolean attribute `whatever`.\n\n' + + 'If you want to write it to the DOM, pass a string instead: ' + + 'whatever="true" or whatever={value.toString()}.', ); }); @@ -2289,12 +2289,11 @@ describe('ReactDOMComponent', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Received `false` for non-boolean attribute `whatever`.\n\n ' + - 'If you want `whatever` to appear in the DOM, cast it to a string. ' + - 'For example, you can pass `whatever="false"` or `whatever={value.toString()}.\n\n' + - 'If you want to omit `whatever` based on a condition, use a ternary expression. ' + - 'For example, you can pass `whatever={condition ? value : undefined}` ' + - 'instead of `whatever={condition && value}`.', + 'Received `false` for the non-boolean attribute `whatever`.\n\n' + + 'If you want to write it to the DOM, pass a string instead: ' + + 'whatever="false" or whatever={value.toString()}.\n\n' + + 'If you conditionally omit it with whatever={condition && value}, ' + + 'pass whatever={condition ? value : undefined} instead.', ); }); }); diff --git a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js index dd432d03f423b..3ba2236ec68aa 100644 --- a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js @@ -184,16 +184,15 @@ if (__DEV__) { typeof value === 'boolean' && !DOMProperty.shouldAttributeAcceptBooleanValue(name) ) { - if (value === true) { + if (value) { warning( false, - 'Received `%s` for non-boolean attribute `%s`.\n\n' + - 'If you want `%s` to appear in the DOM, cast it to a string. ' + - 'For example, you can pass `%s="%s"` or `%s={value.toString()}` instead.%s', + 'Received `%s` for the non-boolean attribute `%s`.\n\n' + + 'If you want to write it to the DOM, pass a string instead: ' + + '%s="%s" or %s={value.toString()}.%s', value, name, name, - name, value, name, getStackAddendum(), @@ -201,21 +200,18 @@ if (__DEV__) { } else { warning( false, - 'Received `%s` for non-boolean attribute `%s`.\n\n ' + - 'If you want `%s` to appear in the DOM, cast it to a string. ' + - 'For example, you can pass `%s="%s"` or `%s={value.toString()}.\n\n' + - 'If you want to omit `%s` based on a condition, use a ternary expression. ' + - 'For example, you can pass `%s={condition ? value : undefined}` ' + - 'instead of `%s={condition && value}`.%s', + 'Received `%s` for the non-boolean attribute `%s`.\n\n' + + 'If you want to write it to the DOM, pass a string instead: ' + + '%s="%s" or %s={value.toString()}.\n\n' + + 'If you conditionally omit it with %s={condition && value}, ' + + 'pass %s={condition ? value : undefined} instead.%s', value, name, name, - name, value, name, name, name, - name, getStackAddendum(), ); } From 37207a0269b96b8676b9f65870cd91a0c8d4d142 Mon Sep 17 00:00:00 2001 From: Nic Bonetto Date: Sun, 29 Oct 2017 15:40:56 -0700 Subject: [PATCH 16/22] Prettified. #3 --- packages/react-dom/src/__tests__/ReactDOMAttribute-test.js | 4 ++-- packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js index e0390284a733f..2f946c68445e0 100644 --- a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js @@ -55,8 +55,8 @@ describe('ReactDOM unknown attribute', () => { normalizeCodeLocInfo(console.error.calls.argsFor(0)[0]), ).toMatch( 'Received `true` for the non-boolean attribute `unknown`.\n\n' + - 'If you want to write it to the DOM, pass a string instead: ' + - 'unknown="true" or unknown={value.toString()}.\n' + + 'If you want to write it to the DOM, pass a string instead: ' + + 'unknown="true" or unknown={value.toString()}.\n' + ' in div (at **)', ); expectDev(console.error.calls.count()).toBe(1); diff --git a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js index 3ba2236ec68aa..51eb755a2e26a 100644 --- a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js @@ -204,7 +204,7 @@ if (__DEV__) { 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you conditionally omit it with %s={condition && value}, ' + - 'pass %s={condition ? value : undefined} instead.%s', + 'pass %s={condition ? value : undefined} instead.%s', value, name, name, From 12db8569fddd263ef9243e9c69a3fd9d307eb7b2 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 31 Oct 2017 12:45:19 +0000 Subject: [PATCH 17/22] Grammar fix --- .../src/__tests__/ReactDOMAttribute-test.js | 4 ++-- .../src/__tests__/ReactDOMComponent-test.js | 12 ++++++------ .../src/shared/ReactDOMUnknownPropertyHook.js | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js index 2f946c68445e0..0622ac67e42b6 100644 --- a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js @@ -54,7 +54,7 @@ describe('ReactDOM unknown attribute', () => { expectDev( normalizeCodeLocInfo(console.error.calls.argsFor(0)[0]), ).toMatch( - 'Received `true` for the non-boolean attribute `unknown`.\n\n' + + 'Received `true` for a non-boolean attribute `unknown`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + 'unknown="true" or unknown={value.toString()}.\n' + ' in div (at **)', @@ -88,7 +88,7 @@ describe('ReactDOM unknown attribute', () => { expectDev( normalizeCodeLocInfo(console.error.calls.argsFor(0)[0]), ).toMatch( - 'Warning: Received NaN for numeric attribute `unknown`. ' + + 'Warning: Received NaN for a numeric attribute `unknown`. ' + 'If this is expected, cast the value to a string.\n' + ' in div (at **)', ); diff --git a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js index e59372d2c6a78..0566873998807 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js @@ -714,7 +714,7 @@ describe('ReactDOMComponent', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Received a `function` for string attribute `is`. If this is expected, cast ' + + 'Received a `function` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', ); }); @@ -2042,7 +2042,7 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Received `true` for the non-boolean attribute `whatever`.\n\n' + + 'Received `true` for a non-boolean attribute `whatever`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + 'whatever="true" or whatever={value.toString()}.', ); @@ -2057,7 +2057,7 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Received `true` for the non-boolean attribute `whatever`.\n\n' + + 'Received `true` for a non-boolean attribute `whatever`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + 'whatever="true" or whatever={value.toString()}.', ); @@ -2132,7 +2132,7 @@ describe('ReactDOMComponent', () => { expect(el.getAttribute('whatever')).toBe('NaN'); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Warning: Received NaN for numeric attribute `whatever`. If this is ' + + 'Warning: Received NaN for a numeric attribute `whatever`. If this is ' + 'expected, cast the value to a string.\n in div', ); }); @@ -2234,7 +2234,7 @@ describe('ReactDOMComponent', () => { expect(el.hasAttribute('whatever')).toBe(false); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Received `true` for the non-boolean attribute `whatever`.\n\n' + + 'Received `true` for a non-boolean attribute `whatever`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + 'whatever="true" or whatever={value.toString()}.', ); @@ -2289,7 +2289,7 @@ describe('ReactDOMComponent', () => { expectDev(console.error.calls.count()).toBe(1); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Received `false` for the non-boolean attribute `whatever`.\n\n' + + 'Received `false` for a non-boolean attribute `whatever`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + 'whatever="false" or whatever={value.toString()}.\n\n' + 'If you conditionally omit it with whatever={condition && value}, ' + diff --git a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js index 51eb755a2e26a..1732e0780bbee 100644 --- a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js @@ -125,7 +125,7 @@ if (__DEV__) { ) { warning( false, - 'Received a `%s` for string attribute `is`. If this is expected, cast ' + + 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.%s', typeof value, getStackAddendum(), @@ -137,7 +137,7 @@ if (__DEV__) { if (typeof value === 'number' && isNaN(value)) { warning( false, - 'Received NaN for numeric attribute `%s`. If this is expected, cast ' + + 'Received NaN for a numeric attribute `%s`. If this is expected, cast ' + 'the value to a string.%s', name, getStackAddendum(), @@ -187,7 +187,7 @@ if (__DEV__) { if (value) { warning( false, - 'Received `%s` for the non-boolean attribute `%s`.\n\n' + + 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.%s', value, @@ -200,7 +200,7 @@ if (__DEV__) { } else { warning( false, - 'Received `%s` for the non-boolean attribute `%s`.\n\n' + + 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you conditionally omit it with %s={condition && value}, ' + From 69cbdfc06a98c86eb6148461e4f0a950e66ffd38 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 31 Oct 2017 12:50:04 +0000 Subject: [PATCH 18/22] Tweak unrelated warning The message didn't make sense because it appears for *any* attributes, not just numeric ones. --- .../react-dom/src/__tests__/ReactDOMAttribute-test.js | 2 +- .../react-dom/src/__tests__/ReactDOMComponent-test.js | 2 +- .../react-dom/src/shared/ReactDOMUnknownPropertyHook.js | 2 +- scripts/rollup/results.json | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js index 0622ac67e42b6..67589233e9652 100644 --- a/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMAttribute-test.js @@ -88,7 +88,7 @@ describe('ReactDOM unknown attribute', () => { expectDev( normalizeCodeLocInfo(console.error.calls.argsFor(0)[0]), ).toMatch( - 'Warning: Received NaN for a numeric attribute `unknown`. ' + + 'Warning: Received NaN for the `unknown` attribute. ' + 'If this is expected, cast the value to a string.\n' + ' in div (at **)', ); diff --git a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js index 0566873998807..01d2e9eb5ee2f 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js @@ -2132,7 +2132,7 @@ describe('ReactDOMComponent', () => { expect(el.getAttribute('whatever')).toBe('NaN'); expectDev(console.error.calls.argsFor(0)[0]).toContain( - 'Warning: Received NaN for a numeric attribute `whatever`. If this is ' + + 'Warning: Received NaN for the `whatever` attribute. If this is ' + 'expected, cast the value to a string.\n in div', ); }); diff --git a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js index 1732e0780bbee..10c2d6aedb443 100644 --- a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js @@ -137,7 +137,7 @@ if (__DEV__) { if (typeof value === 'number' && isNaN(value)) { warning( false, - 'Received NaN for a numeric attribute `%s`. If this is expected, cast ' + + 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.%s', name, getStackAddendum(), diff --git a/scripts/rollup/results.json b/scripts/rollup/results.json index 513aadf84ef04..4d82529d67972 100644 --- a/scripts/rollup/results.json +++ b/scripts/rollup/results.json @@ -25,8 +25,8 @@ "gzip": 6713 }, "react-dom.development.js (UMD_DEV)": { - "size": 629078, - "gzip": 144076 + "size": 629542, + "gzip": 144174 }, "react-dom.production.min.js (UMD_PROD)": { "size": 101020, @@ -81,8 +81,8 @@ "gzip": 15545 }, "react-dom-server.browser.development.js (UMD_DEV)": { - "size": 124902, - "gzip": 32255 + "size": 125399, + "gzip": 32363 }, "react-dom-server.browser.production.min.js (UMD_PROD)": { "size": 15337, From c841d41899e801354ca50ec9b743b5dfcc2403eb Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 31 Oct 2017 12:54:37 +0000 Subject: [PATCH 19/22] Tweak the message for more clarity --- packages/react-dom/src/__tests__/ReactDOMComponent-test.js | 2 +- packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js index 01d2e9eb5ee2f..d807b41817870 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js @@ -2292,7 +2292,7 @@ describe('ReactDOMComponent', () => { 'Received `false` for a non-boolean attribute `whatever`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + 'whatever="false" or whatever={value.toString()}.\n\n' + - 'If you conditionally omit it with whatever={condition && value}, ' + + 'If you used to conditionally omit it with whatever={condition && value}, ' + 'pass whatever={condition ? value : undefined} instead.', ); }); diff --git a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js index 10c2d6aedb443..3b660b90ad0ce 100644 --- a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js @@ -203,7 +203,7 @@ if (__DEV__) { 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + - 'If you conditionally omit it with %s={condition && value}, ' + + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.%s', value, name, From da204772913abeb087e5b524f750a4a49a406b44 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 31 Oct 2017 12:58:26 +0000 Subject: [PATCH 20/22] Add a special message for false event handlers --- .../src/__tests__/ReactDOMFiber-test.js | 18 +++++++++++++ .../src/client/ReactDOMFiberComponent.js | 27 ++++++++++++++----- 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMFiber-test.js b/packages/react-dom/src/__tests__/ReactDOMFiber-test.js index 36f63a3b4f095..7f9fb6cf58237 100644 --- a/packages/react-dom/src/__tests__/ReactDOMFiber-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMFiber-test.js @@ -945,6 +945,24 @@ describe('ReactDOMFiber', () => { ); }); + it('should warn with a special message for `false` event listeners', () => { + spyOn(console, 'error'); + class Example extends React.Component { + render() { + return
; + } + } + ReactDOM.render(, container); + expectDev(console.error.calls.count()).toBe(1); + expectDev( + normalizeCodeLocInfo(console.error.calls.argsFor(0)[0]), + ).toContain( + 'Expected `onClick` listener to be a function, instead got `false`.\n\n' + + 'If you used to conditionally omit it with onClick={condition && value}, ' + + 'pass onClick={condition ? value : undefined} instead.\n', + ' in div (at **)\n' + ' in Example (at **)', + ); + }); it('should not update event handlers until commit', () => { let ops = []; const handlerA = () => ops.push('A'); diff --git a/packages/react-dom/src/client/ReactDOMFiberComponent.js b/packages/react-dom/src/client/ReactDOMFiberComponent.js index 3ad08af4b59e8..4d2b2dd102cac 100644 --- a/packages/react-dom/src/client/ReactDOMFiberComponent.js +++ b/packages/react-dom/src/client/ReactDOMFiberComponent.js @@ -160,13 +160,26 @@ if (__DEV__) { }; var warnForInvalidEventListener = function(registrationName, listener) { - warning( - false, - 'Expected `%s` listener to be a function, instead got a value of `%s` type.%s', - registrationName, - typeof listener, - getCurrentFiberStackAddendum(), - ); + if (listener === false) { + warning( + false, + 'Expected `%s` listener to be a function, instead got `false`.\n\n' + + 'If you used to conditionally omit it with %s={condition && value}, ' + + 'pass %s={condition ? value : undefined} instead.%s', + registrationName, + registrationName, + registrationName, + getCurrentFiberStackAddendum(), + ); + } else { + warning( + false, + 'Expected `%s` listener to be a function, instead got a value of `%s` type.%s', + registrationName, + typeof listener, + getCurrentFiberStackAddendum(), + ); + } }; // Parse the HTML and read it back to normalize the HTML string so that it From 5b994bfe072800629cb34ecd06e83321e8759866 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 31 Oct 2017 13:01:04 +0000 Subject: [PATCH 21/22] Add missing whitespace --- packages/react-dom/src/__tests__/ReactDOMFiber-test.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-dom/src/__tests__/ReactDOMFiber-test.js b/packages/react-dom/src/__tests__/ReactDOMFiber-test.js index 7f9fb6cf58237..d208cb5861877 100644 --- a/packages/react-dom/src/__tests__/ReactDOMFiber-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMFiber-test.js @@ -963,6 +963,7 @@ describe('ReactDOMFiber', () => { ' in div (at **)\n' + ' in Example (at **)', ); }); + it('should not update event handlers until commit', () => { let ops = []; const handlerA = () => ops.push('A'); From 425c00b27564bb93f0605eda8e01cead68c7dcf6 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 31 Oct 2017 13:01:50 +0000 Subject: [PATCH 22/22] Revert size changes --- scripts/rollup/results.json | 258 +++++++++++++++++------------------- 1 file changed, 121 insertions(+), 137 deletions(-) diff --git a/scripts/rollup/results.json b/scripts/rollup/results.json index 4d82529d67972..bb3a9727879e8 100644 --- a/scripts/rollup/results.json +++ b/scripts/rollup/results.json @@ -1,228 +1,212 @@ { "bundleSizes": { "react.development.js (UMD_DEV)": { - "size": 54803, - "gzip": 14350 + "size": 54533, + "gzip": 14280 }, "react.production.min.js (UMD_PROD)": { - "size": 6634, - "gzip": 2764 + "size": 6630, + "gzip": 2763 }, "react.development.js (NODE_DEV)": { - "size": 45707, - "gzip": 12095 + "size": 45437, + "gzip": 12025 }, "react.production.min.js (NODE_PROD)": { "size": 5611, "gzip": 2364 }, "React-dev.js (FB_DEV)": { - "size": 43033, - "gzip": 11331 + "size": 42912, + "gzip": 11311 }, "React-prod.js (FB_PROD)": { - "size": 24848, - "gzip": 6713 + "size": 24830, + "gzip": 6719 }, "react-dom.development.js (UMD_DEV)": { - "size": 629542, - "gzip": 144174 + "size": 628548, + "gzip": 144062 }, "react-dom.production.min.js (UMD_PROD)": { - "size": 101020, - "gzip": 31886 + "size": 100908, + "gzip": 31646 }, "react-dom.development.js (NODE_DEV)": { - "size": 591361, - "gzip": 135305 + "size": 590784, + "gzip": 135367 }, "react-dom.production.min.js (NODE_PROD)": { - "size": 107254, - "gzip": 33591 + "size": 107149, + "gzip": 33143 }, - "ReactDOMFiber-dev.js (FB_DEV)": { - "size": 588633, - "gzip": 134646 + "ReactDOM-dev.js (FB_DEV)": { + "size": 590759, + "gzip": 135629 }, - "ReactDOMFiber-prod.js (FB_PROD)": { - "size": 418791, - "gzip": 93017 + "ReactDOM-prod.js (FB_PROD)": { + "size": 421333, + "gzip": 93558 }, "react-dom-test-utils.development.js (NODE_DEV)": { - "size": 41743, - "gzip": 11118 + "size": 41553, + "gzip": 11076 + }, + "react-dom-test-utils.production.min.js (NODE_PROD)": { + "size": 11609, + "gzip": 4250 }, "ReactTestUtils-dev.js (FB_DEV)": { - "size": 41569, - "gzip": 11069 + "size": 41171, + "gzip": 11041 }, "react-dom-unstable-native-dependencies.development.js (UMD_DEV)": { - "size": 84961, - "gzip": 21296 + "size": 84862, + "gzip": 21152 }, "react-dom-unstable-native-dependencies.production.min.js (UMD_PROD)": { "size": 14441, - "gzip": 4650 + "gzip": 4652 }, "react-dom-unstable-native-dependencies.development.js (NODE_DEV)": { - "size": 80754, - "gzip": 19972 + "size": 80643, + "gzip": 19924 }, "react-dom-unstable-native-dependencies.production.min.js (NODE_PROD)": { - "size": 14003, - "gzip": 4510 + "size": 14002, + "gzip": 4509 }, "ReactDOMUnstableNativeDependencies-dev.js (FB_DEV)": { - "size": 80207, - "gzip": 19890 + "size": 80136, + "gzip": 19870 }, "ReactDOMUnstableNativeDependencies-prod.js (FB_PROD)": { - "size": 65181, - "gzip": 15545 + "size": 65144, + "gzip": 15547 }, "react-dom-server.browser.development.js (UMD_DEV)": { - "size": 125399, - "gzip": 32363 + "size": 124541, + "gzip": 32144 }, "react-dom-server.browser.production.min.js (UMD_PROD)": { "size": 15337, - "gzip": 5967 + "gzip": 5975 }, "react-dom-server.browser.development.js (NODE_DEV)": { - "size": 94822, - "gzip": 25134 + "size": 94428, + "gzip": 24913 }, "react-dom-server.browser.production.min.js (NODE_PROD)": { - "size": 15063, - "gzip": 5899 + "size": 15066, + "gzip": 5893 }, "ReactDOMServer-dev.js (FB_DEV)": { - "size": 94499, - "gzip": 25066 + "size": 93904, + "gzip": 24858 }, "ReactDOMServer-prod.js (FB_PROD)": { - "size": 42463, - "gzip": 11846 + "size": 42609, + "gzip": 11796 }, "react-dom-server.node.development.js (NODE_DEV)": { - "size": 97084, - "gzip": 25683 + "size": 96701, + "gzip": 25447 }, "react-dom-server.node.production.min.js (NODE_PROD)": { - "size": 15988, - "gzip": 6235 + "size": 15991, + "gzip": 6227 }, "react-art.development.js (UMD_DEV)": { - "size": 376390, - "gzip": 82374 + "size": 374492, + "gzip": 82196 }, "react-art.production.min.js (UMD_PROD)": { - "size": 83413, - "gzip": 25876 + "size": 82762, + "gzip": 25785 }, "react-art.development.js (NODE_DEV)": { - "size": 300749, - "gzip": 63250 + "size": 300260, + "gzip": 63352 }, "react-art.production.min.js (NODE_PROD)": { - "size": 54504, - "gzip": 17048 - }, - "ReactARTFiber-dev.js (FB_DEV)": { - "size": 299674, - "gzip": 63165 - }, - "ReactARTFiber-prod.js (FB_PROD)": { - "size": 224360, - "gzip": 46067 - }, - "ReactNativeFiber-dev.js (RN_DEV)": { - "size": 286193, - "gzip": 49282 + "size": 54391, + "gzip": 17050 }, - "ReactNativeFiber-prod.js (RN_PROD)": { - "size": 223893, - "gzip": 38520 - }, - "react-test-renderer.development.js (NODE_DEV)": { - "size": 304437, - "gzip": 63667 - }, - "ReactTestRendererFiber-dev.js (FB_DEV)": { - "size": 303323, - "gzip": 63582 - }, - "react-test-renderer-shallow.development.js (NODE_DEV)": { - "size": 9364, - "gzip": 2335 + "ReactART-dev.js (FB_DEV)": { + "size": 298866, + "gzip": 63281 }, - "ReactShallowRenderer-dev.js (FB_DEV)": { - "size": 9037, - "gzip": 2262 + "ReactART-prod.js (FB_PROD)": { + "size": 223988, + "gzip": 45978 }, - "react-noop-renderer.development.js (NODE_DEV)": { - "size": 293646, - "gzip": 60851 + "ReactNativeRenderer-dev.js (RN_DEV)": { + "size": 286160, + "gzip": 49086 }, - "react-dom-server.development.js (UMD_DEV)": { - "size": 120897, - "gzip": 30672 + "ReactNativeRenderer-prod.js (RN_PROD)": { + "size": 223851, + "gzip": 38395 }, - "react-dom-server.production.min.js (UMD_PROD)": { - "size": 20136, - "gzip": 7672 + "ReactRTRenderer-dev.js (RN_DEV)": { + "size": 218007, + "gzip": 36780 }, - "react-dom-server.development.js (NODE_DEV)": { - "size": 90047, - "gzip": 23257 + "ReactRTRenderer-prod.js (RN_PROD)": { + "size": 165490, + "gzip": 27606 }, - "react-dom-server.production.min.js (NODE_PROD)": { - "size": 18718, - "gzip": 7197 + "ReactCSRenderer-dev.js (RN_DEV)": { + "size": 210392, + "gzip": 35120 }, - "react-dom-node-stream.development.js (NODE_DEV)": { - "size": 91741, - "gzip": 23757 + "ReactCSRenderer-prod.js (RN_PROD)": { + "size": 160483, + "gzip": 26404 }, - "react-dom-node-stream.production.min.js (NODE_PROD)": { - "size": 19585, - "gzip": 7520 + "react-test-renderer.development.js (NODE_DEV)": { + "size": 304118, + "gzip": 63787 }, - "ReactNativeRTFiber-dev.js (RN_DEV)": { - "size": 218056, - "gzip": 36811 + "react-test-renderer.production.min.js (NODE_PROD)": { + "size": 55985, + "gzip": 17315 }, - "ReactNativeRTFiber-prod.js (RN_PROD)": { - "size": 165542, - "gzip": 27540 + "ReactTestRenderer-dev.js (FB_DEV)": { + "size": 302714, + "gzip": 63724 }, - "react-test-renderer.production.min.js (NODE_PROD)": { - "size": 56061, - "gzip": 17256 + "react-test-renderer-shallow.development.js (NODE_DEV)": { + "size": 9246, + "gzip": 2306 }, "react-test-renderer-shallow.production.min.js (NODE_PROD)": { - "size": 4630, - "gzip": 1665 + "size": 4634, + "gzip": 1667 }, - "react-dom-test-utils.production.min.js (NODE_PROD)": { - "size": 11608, - "gzip": 4241 + "ReactShallowRenderer-dev.js (FB_DEV)": { + "size": 8958, + "gzip": 2250 + }, + "react-noop-renderer.development.js (NODE_DEV)": { + "size": 293399, + "gzip": 61042 }, "react-reconciler.development.js (NODE_DEV)": { - "size": 279318, - "gzip": 57691 + "size": 278999, + "gzip": 57818 }, "react-reconciler.production.min.js (NODE_PROD)": { - "size": 38320, - "gzip": 11959 + "size": 38245, + "gzip": 11943 }, - "ReactNativeCSFiber-dev.js (RN_DEV)": { - "size": 210477, - "gzip": 35055 + "react-call-return.development.js (NODE_DEV)": { + "size": 2721, + "gzip": 943 }, - "ReactNativeCSFiber-prod.js (RN_PROD)": { - "size": 160537, - "gzip": 26346 + "react-call-return.production.min.js (NODE_PROD)": { + "size": 845, + "gzip": 484 } } } \ No newline at end of file