From 75168f9873284c6ab9ead156af1a124b4edab9da Mon Sep 17 00:00:00 2001 From: Nicolas Straub Date: Wed, 23 Aug 2017 01:18:52 -0300 Subject: [PATCH 1/6] enables ctrl + enter for keypress event on browsers other than firefox --- .../events/__tests__/getEventCharCode-test.js | 19 ++ .../react-dom/src/events/getEventCharCode.js | 4 + scripts/fiber/tests-passing.txt | 179 ++++++++++--- scripts/rollup/results.json | 250 ++++++++---------- 4 files changed, 285 insertions(+), 167 deletions(-) diff --git a/packages/react-dom/src/events/__tests__/getEventCharCode-test.js b/packages/react-dom/src/events/__tests__/getEventCharCode-test.js index 552286b8d0a17..1a97dbda3b70a 100644 --- a/packages/react-dom/src/events/__tests__/getEventCharCode-test.js +++ b/packages/react-dom/src/events/__tests__/getEventCharCode-test.js @@ -50,6 +50,25 @@ describe('getEventCharCode', () => { expect(getEventCharCode(nativeEvent)).toBe(0); }); }); + + describe('when charCode is 10', () => { + it('returns 13', () => { + var nativeEvent = new KeyboardEvent('keypress', {charCode: 10}); + + expect(getEventCharCode(nativeEvent)).toBe(13); + }); + + describe('when ctrl key is pressed', () => { + it('returns 13', () => { + var nativeEvent = new KeyboardEvent('keypress', { + charCode: 10, + ctrlKey: true, + }); + + expect(getEventCharCode(nativeEvent)).toBe(13); + }); + }); + }); }); }); }); diff --git a/packages/react-dom/src/events/getEventCharCode.js b/packages/react-dom/src/events/getEventCharCode.js index 5fce467f538cb..4fb153966724f 100644 --- a/packages/react-dom/src/events/getEventCharCode.js +++ b/packages/react-dom/src/events/getEventCharCode.js @@ -31,6 +31,10 @@ function getEventCharCode(nativeEvent) { charCode = keyCode; } + // Chrome, IE 11 and Edge report Enter as charCode 10 when ctrl is pressed. + if (charCode === 10) { + charCode = 13; + } // Some non-printable keys are reported in `charCode`/`keyCode`, discard them. // Must not discard the (non-)printable Enter-key. if (charCode >= 32 || charCode === 13) { diff --git a/scripts/fiber/tests-passing.txt b/scripts/fiber/tests-passing.txt index bc6fa9036edb1..fdeeff46f54df 100644 --- a/scripts/fiber/tests-passing.txt +++ b/scripts/fiber/tests-passing.txt @@ -685,6 +685,7 @@ src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js * throws if non-element passed to top-level render * throws if something other than false, null, or an element is returned from render * treats mocked render functions as if they return null +* throws if the React package cannot be loaded src/renderers/dom/fiber/__tests__/ReactDOMFiberAsync-test.js * renders synchronously by default @@ -822,6 +823,7 @@ src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js * should treat menuitem as a void element but still create the closing tag * should validate against multiple children props * should validate against use of innerHTML +* should validate against use of innerHTML without case sensitivity * should validate use of dangerouslySetInnerHTML * should validate use of dangerouslySetInnerHTML * should allow {__html: null} @@ -856,7 +858,9 @@ src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js * should warn about class * should warn about class (ssr) * should warn about props that are no longer supported +* should warn about props that are no longer supported without case sensitivity * should warn about props that are no longer supported (ssr) +* should warn about props that are no longer supported without case sensitivity (ssr) * gives source code refs for unknown prop warning * gives source code refs for unknown prop warning (ssr) * gives source code refs for unknown prop warning for update render @@ -868,6 +872,29 @@ src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js * should suggest property name if available (ssr) * renders innerHTML and preserves whitespace * render and then updates innerHTML and preserves whitespace +* sets aliased attributes on HTML attributes +* sets incorrectly cased aliased attributes on HTML attributes with a warning +* sets aliased attributes on SVG elements with a warning +* sets aliased attributes on custom elements +* aliased attributes on custom elements with bad casing +* updates aliased attributes on custom elements +* allows assignment of custom attributes with string values +* removes custom attributes +* does not assign a boolean custom attributes as a string +* does not assign an implicit boolean custom attributes +* assigns a numeric custom attributes as a string +* will not assign a function custom attributes +* will assign an object custom attributes +* allows cased data attributes +* allows cased custom attributes +* warns on NaN attributes +* removes a property when it becomes invalid +* allows objects on known properties +* should pass objects as attributes if they define toString +* passes objects on known SVG attributes if they do not define toString +* passes objects on custom attributes if they do not define toString +* allows objects that inherit a custom toString method +* assigns ajaxify (an important internal FB attribute) src/renderers/dom/shared/__tests__/ReactDOMComponentTree-test.js * finds nodes for instances @@ -886,6 +913,8 @@ src/renderers/dom/shared/__tests__/ReactDOMInvalidARIAHook-test.js * should warn for one invalid aria-* prop * should warn for many invalid aria-* props * should warn for an improperly cased aria-* prop +* should warn for use of recognized camel case aria attributes +* should warn for use of unrecognized camel case aria attributes src/renderers/dom/shared/__tests__/ReactDOMSVG-test.js * creates initial namespaced markup @@ -955,16 +984,16 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js * renders simple strings with clean client render * renders simple strings with client render on top of good server markup * renders simple strings with client render on top of bad server markup -* renders string prop with true value with server string render -* renders string prop with true value with server stream render -* renders string prop with true value with clean client render -* renders string prop with true value with client render on top of good server markup -* renders string prop with true value with client render on top of bad server markup -* renders string prop with false value with server string render -* renders string prop with false value with server stream render -* renders string prop with false value with clean client render -* renders string prop with false value with client render on top of good server markup -* renders string prop with false value with client render on top of bad server markup +* renders no string prop with true value with server string render +* renders no string prop with true value with server stream render +* renders no string prop with true value with clean client render +* renders no string prop with true value with client render on top of good server markup +* renders no string prop with true value with client render on top of bad server markup +* renders no string prop with false value with server string render +* renders no string prop with false value with server stream render +* renders no string prop with false value with clean client render +* renders no string prop with false value with client render on top of good server markup +* renders no string prop with false value with client render on top of bad server markup * renders no string prop with null value with server string render * renders no string prop with null value with server stream render * renders no string prop with null value with clean client render @@ -1085,11 +1114,41 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js * renders no className prop with null value with clean client render * renders no className prop with null value with client render on top of good server markup * renders no className prop with null value with client render on top of bad server markup +* renders no badly cased className with a warning with server string render +* renders no badly cased className with a warning with server stream render +* renders no badly cased className with a warning with clean client render +* renders no badly cased className with a warning with client render on top of good server markup +* renders no badly cased className with a warning with client render on top of bad server markup +* renders className prop when given the alias with server string render +* renders className prop when given the alias with server stream render +* renders className prop when given the alias with clean client render +* renders className prop when given the alias with client render on top of good server markup +* renders className prop when given the alias with client render on top of bad server markup +* renders no className prop when given a badly cased alias with server string render +* renders no className prop when given a badly cased alias with server stream render +* renders no className prop when given a badly cased alias with clean client render +* renders no className prop when given a badly cased alias with client render on top of good server markup +* renders no className prop when given a badly cased alias with client render on top of bad server markup +* renders class for custom elements with server string render +* renders class for custom elements with server stream render +* renders class for custom elements with clean client render +* renders class for custom elements with client render on top of good server markup +* renders class for custom elements with client render on top of bad server markup +* renders className for custom elements with server string render +* renders className for custom elements with server stream render +* renders className for custom elements with clean client render +* renders className for custom elements with client render on top of good server markup +* renders className for custom elements with client render on top of bad server markup * renders htmlFor with string value with server string render * renders htmlFor with string value with server stream render * renders htmlFor with string value with clean client render * renders htmlFor with string value with client render on top of good server markup * renders htmlFor with string value with client render on top of bad server markup +* renders no badly cased htmlfor with server string render +* renders no badly cased htmlfor with server stream render +* renders no badly cased htmlfor with clean client render +* renders no badly cased htmlfor with client render on top of good server markup +* renders no badly cased htmlfor with client render on top of bad server markup * renders htmlFor with an empty string with server string render * renders htmlFor with an empty string with server stream render * renders htmlFor with an empty string with clean client render @@ -1110,6 +1169,16 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js * renders no htmlFor prop with null value with clean client render * renders no htmlFor prop with null value with client render on top of good server markup * renders no htmlFor prop with null value with client render on top of bad server markup +* renders htmlFor attribute on custom elements with server string render +* renders htmlFor attribute on custom elements with server stream render +* renders htmlFor attribute on custom elements with clean client render +* renders htmlFor attribute on custom elements with client render on top of good server markup +* renders htmlFor attribute on custom elements with client render on top of bad server markup +* renders for attribute on custom elements with server string render +* renders for attribute on custom elements with server stream render +* renders for attribute on custom elements with clean client render +* renders for attribute on custom elements with client render on top of good server markup +* renders for attribute on custom elements with client render on top of bad server markup * renders positive numeric property with positive value with server string render * renders positive numeric property with positive value with server stream render * renders positive numeric property with positive value with clean client render @@ -1190,11 +1259,31 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js * renders no aria prop with null value with clean client render * renders no aria prop with null value with client render on top of good server markup * renders no aria prop with null value with client render on top of bad server markup -* renders no unknown attributes with server string render -* renders no unknown attributes with server stream render -* renders no unknown attributes with clean client render -* renders no unknown attributes with client render on top of good server markup -* renders no unknown attributes with client render on top of bad server markup +* renders badly cased aliased HTML attribute with a warning with server string render +* renders badly cased aliased HTML attribute with a warning with server stream render +* renders badly cased aliased HTML attribute with a warning with clean client render +* renders badly cased aliased HTML attribute with a warning with client render on top of good server markup +* renders badly cased aliased HTML attribute with a warning with client render on top of bad server markup +* renders badly cased SVG attribute with a warning with server string render +* renders badly cased SVG attribute with a warning with server stream render +* renders badly cased SVG attribute with a warning with clean client render +* renders badly cased SVG attribute with a warning with client render on top of good server markup +* renders badly cased SVG attribute with a warning with client render on top of bad server markup +* renders no badly cased aliased SVG attribute alias with server string render +* renders no badly cased aliased SVG attribute alias with server stream render +* renders no badly cased aliased SVG attribute alias with clean client render +* renders no badly cased aliased SVG attribute alias with client render on top of good server markup +* renders no badly cased aliased SVG attribute alias with client render on top of bad server markup +* renders no badly cased original SVG attribute that is aliased with server string render +* renders no badly cased original SVG attribute that is aliased with server stream render +* renders no badly cased original SVG attribute that is aliased with clean client render +* renders no badly cased original SVG attribute that is aliased with client render on top of good server markup +* renders no badly cased original SVG attribute that is aliased with client render on top of bad server markup +* renders unknown attributes with server string render +* renders unknown attributes with server stream render +* renders unknown attributes with clean client render +* renders unknown attributes with client render on top of good server markup +* renders unknown attributes with client render on top of bad server markup * renders unknown data- attributes with server string render * renders unknown data- attributes with server stream render * renders unknown data- attributes with clean client render @@ -1205,11 +1294,31 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js * renders no unknown data- attributes with null value with clean client render * renders no unknown data- attributes with null value with client render on top of good server markup * renders no unknown data- attributes with null value with client render on top of bad server markup -* renders no unknown attributes for non-standard elements with server string render -* renders no unknown attributes for non-standard elements with server stream render -* renders no unknown attributes for non-standard elements with clean client render -* renders no unknown attributes for non-standard elements with client render on top of good server markup -* renders no unknown attributes for non-standard elements with client render on top of bad server markup +* renders unknown data- attributes with casing with server string render +* renders unknown data- attributes with casing with server stream render +* renders unknown data- attributes with casing with clean client render +* renders unknown data- attributes with casing with client render on top of good server markup +* renders unknown data- attributes with casing with client render on top of bad server markup +* renders unknown data- attributes with boolean true with server string render +* renders unknown data- attributes with boolean true with server stream render +* renders unknown data- attributes with boolean true with clean client render +* renders unknown data- attributes with boolean true with client render on top of good server markup +* renders unknown data- attributes with boolean true with client render on top of bad server markup +* renders unknown data- attributes with boolean false with server string render +* renders unknown data- attributes with boolean false with server stream render +* renders unknown data- attributes with boolean false with clean client render +* renders unknown data- attributes with boolean false with client render on top of good server markup +* renders unknown data- attributes with boolean false with client render on top of bad server markup +* renders no unknown data- attributes with casing and null value with server string render +* renders no unknown data- attributes with casing and null value with server stream render +* renders no unknown data- attributes with casing and null value with clean client render +* renders no unknown data- attributes with casing and null value with client render on top of good server markup +* renders no unknown data- attributes with casing and null value with client render on top of bad server markup +* renders custom attributes for non-standard elements with server string render +* renders custom attributes for non-standard elements with server stream render +* renders custom attributes for non-standard elements with clean client render +* renders custom attributes for non-standard elements with client render on top of good server markup +* renders custom attributes for non-standard elements with client render on top of bad server markup * renders unknown attributes for custom elements with server string render * renders unknown attributes for custom elements with server stream render * renders unknown attributes for custom elements with clean client render @@ -1230,6 +1339,11 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js * renders no unknown attributes for custom elements using is with null value with clean client render * renders no unknown attributes for custom elements using is with null value with client render on top of good server markup * renders no unknown attributes for custom elements using is with null value with client render on top of bad server markup +* renders cased custom attributes with server string render +* renders cased custom attributes with server stream render +* renders cased custom attributes with clean client render +* renders cased custom attributes with client render on top of good server markup +* renders cased custom attributes with client render on top of bad server markup * renders no HTML events with server string render * renders no HTML events with server stream render * renders no HTML events with clean client render @@ -1350,11 +1464,16 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js * renders an svg element with clean client render * renders an svg element with client render on top of good server markup * renders an svg element with client render on top of bad server markup -* renders svg element with an xlink with server string render -* renders svg element with an xlink with server stream render -* renders svg element with an xlink with clean client render -* renders svg element with an xlink with client render on top of good server markup -* renders svg element with an xlink with client render on top of bad server markup +* renders svg child element with server string render +* renders svg child element with server stream render +* renders svg child element with clean client render +* renders svg child element with client render on top of good server markup +* renders svg child element with client render on top of bad server markup +* renders no svg child element with a badly cased with server string render +* renders no svg child element with a badly cased with server stream render +* renders no svg child element with a badly cased with clean client render +* renders no svg child element with a badly cased with client render on top of good server markup +* renders no svg child element with a badly cased with client render on top of bad server markup * renders a math element with server string render * renders a math element with server stream render * renders a math element with clean client render @@ -1709,11 +1828,6 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js * can distinguish an empty component from a dom node * can distinguish an empty component from an empty text component * should error reconnecting a div with different dangerouslySetInnerHTML -* renders injected attributes with server string render -* renders injected attributes with server stream render -* renders injected attributes with clean client render -* renders injected attributes with client render on top of good server markup -* renders injected attributes with client render on top of bad server markup src/renderers/dom/shared/__tests__/ReactDOMTextComponent-test.js * updates a mounted text component in place @@ -1791,6 +1905,7 @@ src/renderers/dom/shared/__tests__/ReactServerRendering-test.js * warns with a no-op when an async setState is triggered * warns with a no-op when an async forceUpdate is triggered * should warn when children are mutated during render +* warns about lowercase html but not in svg tags src/renderers/dom/shared/__tests__/ReactServerRenderingBrowser-test.js * provides the same top-level API as react-dom/server @@ -1841,6 +1956,7 @@ src/renderers/dom/shared/__tests__/renderSubtreeIntoContainer-test.js * should render portal with non-context-provider parent * should get context through non-context-provider parent * should get context through middle non-context-provider layer +* fails gracefully when mixing React 15 and 16 src/renderers/dom/shared/__tests__/validateDOMNesting-test.js * allows any tag with no context @@ -1950,6 +2066,8 @@ src/renderers/dom/shared/utils/__tests__/getEventCharCode-test.js * returns charCode * returns 13 * returns 0 +* returns 13 +* returns 13 * returns keyCode * returns 13 * returns 0 @@ -2083,6 +2201,7 @@ src/renderers/dom/shared/wrappers/__tests__/ReactDOMSelect-test.js * should warn if value and defaultValue props are specified * should be able to safely remove select onChange * should select grandchild options nested inside an optgroup +* should allow controlling `value` in a nested render src/renderers/dom/shared/wrappers/__tests__/ReactDOMTextarea-test.js * should allow setting `defaultValue` diff --git a/scripts/rollup/results.json b/scripts/rollup/results.json index 24c1533ab2368..2a31b8003ff4a 100644 --- a/scripts/rollup/results.json +++ b/scripts/rollup/results.json @@ -1,224 +1,200 @@ { "bundleSizes": { "react.development.js (UMD_DEV)": { - "size": 54810, - "gzip": 14962 + "size": 66229, + "gzip": 16806 }, "react.production.min.js (UMD_PROD)": { - "size": 6603, - "gzip": 2820 + "size": 6359, + "gzip": 2597 }, "react.development.js (NODE_DEV)": { - "size": 45228, - "gzip": 12654 + "size": 56636, + "gzip": 14457 }, "react.production.min.js (NODE_PROD)": { - "size": 5399, - "gzip": 2385 + "size": 5382, + "gzip": 2230 }, "React-dev.js (FB_DEV)": { - "size": 44902, - "gzip": 12309 + "size": 53788, + "gzip": 13694 }, "React-prod.js (FB_PROD)": { - "size": 12778, - "gzip": 3446 + "size": 25014, + "gzip": 6703 }, "react-dom.development.js (UMD_DEV)": { - "size": 569313, - "gzip": 132931 + "size": 643705, + "gzip": 146822 }, "react-dom.production.min.js (UMD_PROD)": { - "size": 94831, - "gzip": 30731 + "size": 103098, + "gzip": 32161 }, "react-dom.development.js (NODE_DEV)": { - "size": 550933, - "gzip": 128104 + "size": 602513, + "gzip": 137120 }, "react-dom.production.min.js (NODE_PROD)": { - "size": 93102, - "gzip": 29993 + "size": 107074, + "gzip": 33571 }, - "ReactDOM-dev.js (FB_DEV)": { - "size": 575937, - "gzip": 132396 + "ReactDOMFiber-dev.js (FB_DEV)": { + "size": 599283, + "gzip": 136595 }, - "ReactDOM-prod.js (FB_PROD)": { - "size": 272856, - "gzip": 51733 + "ReactDOMFiber-prod.js (FB_PROD)": { + "size": 417365, + "gzip": 93302 }, "react-dom-test-utils.development.js (NODE_DEV)": { - "size": 36193, - "gzip": 10294 - }, - "react-dom-test-utils.production.min.js (NODE_PROD)": { - "size": 10189, - "gzip": 3836 + "size": 53571, + "gzip": 13412 }, "ReactTestUtils-dev.js (FB_DEV)": { - "size": 36913, - "gzip": 10379 + "size": 53353, + "gzip": 13400 }, "react-dom-unstable-native-dependencies.development.js (UMD_DEV)": { - "size": 63419, - "gzip": 16542 + "size": 88399, + "gzip": 22250 }, "react-dom-unstable-native-dependencies.production.min.js (UMD_PROD)": { - "size": 11366, - "gzip": 3901 + "size": 15149, + "gzip": 4910 }, "react-dom-unstable-native-dependencies.development.js (NODE_DEV)": { - "size": 58981, - "gzip": 15257 + "size": 81936, + "gzip": 20299 }, "react-dom-unstable-native-dependencies.production.min.js (NODE_PROD)": { - "size": 10910, - "gzip": 3773 + "size": 13926, + "gzip": 4403 }, "ReactDOMUnstableNativeDependencies-dev.js (FB_DEV)": { - "size": 60056, - "gzip": 15406 + "size": 81625, + "gzip": 20283 }, "ReactDOMUnstableNativeDependencies-prod.js (FB_PROD)": { - "size": 26610, - "gzip": 5327 + "size": 66066, + "gzip": 15736 }, "react-dom-server.browser.development.js (UMD_DEV)": { - "size": 94825, - "gzip": 25613 + "size": 132040, + "gzip": 33467 }, "react-dom-server.browser.production.min.js (UMD_PROD)": { - "size": 14785, - "gzip": 5865 + "size": 14805, + "gzip": 5834 }, "react-dom-server.browser.development.js (NODE_DEV)": { - "size": 83924, - "gzip": 22831 + "size": 100322, + "gzip": 25762 }, "react-dom-server.browser.production.min.js (NODE_PROD)": { - "size": 14235, - "gzip": 5744 + "size": 14095, + "gzip": 5614 }, "ReactDOMServer-dev.js (FB_DEV)": { - "size": 87596, - "gzip": 23087 + "size": 99495, + "gzip": 25683 }, "ReactDOMServer-prod.js (FB_PROD)": { - "size": 31671, - "gzip": 8156 + "size": 42774, + "gzip": 12117 }, "react-dom-server.node.development.js (NODE_DEV)": { - "size": 85892, - "gzip": 23339 + "size": 103107, + "gzip": 26324 }, "react-dom-server.node.production.min.js (NODE_PROD)": { - "size": 15060, - "gzip": 6052 + "size": 15152, + "gzip": 5954 }, "react-art.development.js (UMD_DEV)": { - "size": 359556, - "gzip": 79609 + "size": 308692, + "gzip": 66945 }, "react-art.production.min.js (UMD_PROD)": { - "size": 83658, - "gzip": 25785 + "size": 47486, + "gzip": 14835 }, "react-art.development.js (NODE_DEV)": { - "size": 283832, - "gzip": 60561 + "size": 296021, + "gzip": 63031 }, "react-art.production.min.js (NODE_PROD)": { - "size": 47706, - "gzip": 14932 - }, - "ReactART-dev.js (FB_DEV)": { - "size": 294853, - "gzip": 62366 - }, - "ReactART-prod.js (FB_PROD)": { - "size": 148156, - "gzip": 25307 + "size": 52508, + "gzip": 16415 }, - "ReactNativeRenderer-dev.js (RN_DEV)": { - "size": 411393, - "gzip": 90175 + "ReactARTFiber-dev.js (FB_DEV)": { + "size": 294942, + "gzip": 63116 }, - "ReactNativeRenderer-prod.js (RN_PROD)": { - "size": 201148, - "gzip": 34670 + "ReactARTFiber-prod.js (FB_PROD)": { + "size": 220257, + "gzip": 45845 }, - "ReactRTRenderer-dev.js (RN_DEV)": { - "size": 289123, - "gzip": 61376 + "ReactNativeStack-dev.js (RN_DEV)": { + "size": 200820, + "gzip": 37267 }, - "ReactRTRenderer-prod.js (RN_PROD)": { - "size": 138136, - "gzip": 23262 + "ReactNativeStack-prod.js (RN_PROD)": { + "size": 137149, + "gzip": 26290 }, - "ReactCSRenderer-dev.js (RN_DEV)": { - "size": 278819, - "gzip": 58205 + "ReactNativeFiber-dev.js (RN_DEV)": { + "size": 306294, + "gzip": 53069 }, - "ReactCSRenderer-prod.js (RN_PROD)": { - "size": 130459, - "gzip": 21823 + "ReactNativeFiber-prod.js (RN_PROD)": { + "size": 221406, + "gzip": 38324 }, "react-test-renderer.development.js (NODE_DEV)": { - "size": 280400, - "gzip": 59367 + "size": 300523, + "gzip": 63485 }, - "react-test-renderer.production.min.js (NODE_PROD)": { - "size": 46062, - "gzip": 14232 - }, - "ReactTestRenderer-dev.js (FB_DEV)": { - "size": 291517, - "gzip": 61172 + "ReactTestRendererFiber-dev.js (FB_DEV)": { + "size": 299429, + "gzip": 63577 }, "react-test-renderer-shallow.development.js (NODE_DEV)": { - "size": 10233, - "gzip": 2761 - }, - "react-test-renderer-shallow.production.min.js (NODE_PROD)": { - "size": 5159, - "gzip": 1880 + "size": 9586, + "gzip": 2382 }, "ReactShallowRenderer-dev.js (FB_DEV)": { - "size": 9917, - "gzip": 2596 + "size": 9484, + "gzip": 2363 }, "react-noop-renderer.development.js (NODE_DEV)": { - "size": 277870, - "gzip": 58556 - }, - "react-reconciler.development.js (NODE_DEV)": { - "size": 262259, - "gzip": 54981 + "size": 287732, + "gzip": 60341 }, - "react-reconciler.production.min.js (NODE_PROD)": { - "size": 39382, - "gzip": 12251 + "react-dom-server.development.js (UMD_DEV)": { + "size": 120897, + "gzip": 30672 }, - "react-call-return.development.js (NODE_DEV)": { - "size": 2465, - "gzip": 919 + "react-dom-server.production.min.js (UMD_PROD)": { + "size": 20136, + "gzip": 7672 }, - "react-call-return.production.min.js (NODE_PROD)": { - "size": 881, - "gzip": 500 + "react-dom-server.development.js (NODE_DEV)": { + "size": 90047, + "gzip": 23257 }, - "react-dom-test-utils.development.js (UMD_DEV)": { - "size": 41456, - "gzip": 11754 + "react-dom-server.production.min.js (NODE_PROD)": { + "size": 18718, + "gzip": 7197 }, - "react-dom-test-utils.production.min.js (UMD_PROD)": { - "size": 10617, - "gzip": 3917 + "react-dom-node-stream.development.js (NODE_DEV)": { + "size": 91741, + "gzip": 23757 }, - "react-noop-renderer.production.min.js (NODE_PROD)": { - "size": 45070, - "gzip": 14103 + "react-dom-node-stream.production.min.js (NODE_PROD)": { + "size": 19585, + "gzip": 7520 } } } \ No newline at end of file From 6091f40e6847103babac1032ee48641dc6b350af Mon Sep 17 00:00:00 2001 From: Nicolas Straub Date: Sat, 26 Aug 2017 18:30:41 -0300 Subject: [PATCH 2/6] makes comment more descriptive as to affected platforms --- packages/react-dom/src/events/getEventCharCode.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-dom/src/events/getEventCharCode.js b/packages/react-dom/src/events/getEventCharCode.js index 4fb153966724f..44bb43ab19a3b 100644 --- a/packages/react-dom/src/events/getEventCharCode.js +++ b/packages/react-dom/src/events/getEventCharCode.js @@ -31,10 +31,12 @@ function getEventCharCode(nativeEvent) { charCode = keyCode; } - // Chrome, IE 11 and Edge report Enter as charCode 10 when ctrl is pressed. + // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux) + // report Enter as charCode 10 when ctrl is pressed. if (charCode === 10) { charCode = 13; } + // Some non-printable keys are reported in `charCode`/`keyCode`, discard them. // Must not discard the (non-)printable Enter-key. if (charCode >= 32 || charCode === 13) { From 2d652ec6418e59c8f9cfeaa16ea912c113e14dc8 Mon Sep 17 00:00:00 2001 From: Nicolas Straub Date: Wed, 22 Nov 2017 00:31:54 -0300 Subject: [PATCH 3/6] reverting fiber results --- scripts/fiber/tests-passing.txt | 179 ++++++-------------------------- 1 file changed, 30 insertions(+), 149 deletions(-) diff --git a/scripts/fiber/tests-passing.txt b/scripts/fiber/tests-passing.txt index fdeeff46f54df..bc6fa9036edb1 100644 --- a/scripts/fiber/tests-passing.txt +++ b/scripts/fiber/tests-passing.txt @@ -685,7 +685,6 @@ src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js * throws if non-element passed to top-level render * throws if something other than false, null, or an element is returned from render * treats mocked render functions as if they return null -* throws if the React package cannot be loaded src/renderers/dom/fiber/__tests__/ReactDOMFiberAsync-test.js * renders synchronously by default @@ -823,7 +822,6 @@ src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js * should treat menuitem as a void element but still create the closing tag * should validate against multiple children props * should validate against use of innerHTML -* should validate against use of innerHTML without case sensitivity * should validate use of dangerouslySetInnerHTML * should validate use of dangerouslySetInnerHTML * should allow {__html: null} @@ -858,9 +856,7 @@ src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js * should warn about class * should warn about class (ssr) * should warn about props that are no longer supported -* should warn about props that are no longer supported without case sensitivity * should warn about props that are no longer supported (ssr) -* should warn about props that are no longer supported without case sensitivity (ssr) * gives source code refs for unknown prop warning * gives source code refs for unknown prop warning (ssr) * gives source code refs for unknown prop warning for update render @@ -872,29 +868,6 @@ src/renderers/dom/shared/__tests__/ReactDOMComponent-test.js * should suggest property name if available (ssr) * renders innerHTML and preserves whitespace * render and then updates innerHTML and preserves whitespace -* sets aliased attributes on HTML attributes -* sets incorrectly cased aliased attributes on HTML attributes with a warning -* sets aliased attributes on SVG elements with a warning -* sets aliased attributes on custom elements -* aliased attributes on custom elements with bad casing -* updates aliased attributes on custom elements -* allows assignment of custom attributes with string values -* removes custom attributes -* does not assign a boolean custom attributes as a string -* does not assign an implicit boolean custom attributes -* assigns a numeric custom attributes as a string -* will not assign a function custom attributes -* will assign an object custom attributes -* allows cased data attributes -* allows cased custom attributes -* warns on NaN attributes -* removes a property when it becomes invalid -* allows objects on known properties -* should pass objects as attributes if they define toString -* passes objects on known SVG attributes if they do not define toString -* passes objects on custom attributes if they do not define toString -* allows objects that inherit a custom toString method -* assigns ajaxify (an important internal FB attribute) src/renderers/dom/shared/__tests__/ReactDOMComponentTree-test.js * finds nodes for instances @@ -913,8 +886,6 @@ src/renderers/dom/shared/__tests__/ReactDOMInvalidARIAHook-test.js * should warn for one invalid aria-* prop * should warn for many invalid aria-* props * should warn for an improperly cased aria-* prop -* should warn for use of recognized camel case aria attributes -* should warn for use of unrecognized camel case aria attributes src/renderers/dom/shared/__tests__/ReactDOMSVG-test.js * creates initial namespaced markup @@ -984,16 +955,16 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js * renders simple strings with clean client render * renders simple strings with client render on top of good server markup * renders simple strings with client render on top of bad server markup -* renders no string prop with true value with server string render -* renders no string prop with true value with server stream render -* renders no string prop with true value with clean client render -* renders no string prop with true value with client render on top of good server markup -* renders no string prop with true value with client render on top of bad server markup -* renders no string prop with false value with server string render -* renders no string prop with false value with server stream render -* renders no string prop with false value with clean client render -* renders no string prop with false value with client render on top of good server markup -* renders no string prop with false value with client render on top of bad server markup +* renders string prop with true value with server string render +* renders string prop with true value with server stream render +* renders string prop with true value with clean client render +* renders string prop with true value with client render on top of good server markup +* renders string prop with true value with client render on top of bad server markup +* renders string prop with false value with server string render +* renders string prop with false value with server stream render +* renders string prop with false value with clean client render +* renders string prop with false value with client render on top of good server markup +* renders string prop with false value with client render on top of bad server markup * renders no string prop with null value with server string render * renders no string prop with null value with server stream render * renders no string prop with null value with clean client render @@ -1114,41 +1085,11 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js * renders no className prop with null value with clean client render * renders no className prop with null value with client render on top of good server markup * renders no className prop with null value with client render on top of bad server markup -* renders no badly cased className with a warning with server string render -* renders no badly cased className with a warning with server stream render -* renders no badly cased className with a warning with clean client render -* renders no badly cased className with a warning with client render on top of good server markup -* renders no badly cased className with a warning with client render on top of bad server markup -* renders className prop when given the alias with server string render -* renders className prop when given the alias with server stream render -* renders className prop when given the alias with clean client render -* renders className prop when given the alias with client render on top of good server markup -* renders className prop when given the alias with client render on top of bad server markup -* renders no className prop when given a badly cased alias with server string render -* renders no className prop when given a badly cased alias with server stream render -* renders no className prop when given a badly cased alias with clean client render -* renders no className prop when given a badly cased alias with client render on top of good server markup -* renders no className prop when given a badly cased alias with client render on top of bad server markup -* renders class for custom elements with server string render -* renders class for custom elements with server stream render -* renders class for custom elements with clean client render -* renders class for custom elements with client render on top of good server markup -* renders class for custom elements with client render on top of bad server markup -* renders className for custom elements with server string render -* renders className for custom elements with server stream render -* renders className for custom elements with clean client render -* renders className for custom elements with client render on top of good server markup -* renders className for custom elements with client render on top of bad server markup * renders htmlFor with string value with server string render * renders htmlFor with string value with server stream render * renders htmlFor with string value with clean client render * renders htmlFor with string value with client render on top of good server markup * renders htmlFor with string value with client render on top of bad server markup -* renders no badly cased htmlfor with server string render -* renders no badly cased htmlfor with server stream render -* renders no badly cased htmlfor with clean client render -* renders no badly cased htmlfor with client render on top of good server markup -* renders no badly cased htmlfor with client render on top of bad server markup * renders htmlFor with an empty string with server string render * renders htmlFor with an empty string with server stream render * renders htmlFor with an empty string with clean client render @@ -1169,16 +1110,6 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js * renders no htmlFor prop with null value with clean client render * renders no htmlFor prop with null value with client render on top of good server markup * renders no htmlFor prop with null value with client render on top of bad server markup -* renders htmlFor attribute on custom elements with server string render -* renders htmlFor attribute on custom elements with server stream render -* renders htmlFor attribute on custom elements with clean client render -* renders htmlFor attribute on custom elements with client render on top of good server markup -* renders htmlFor attribute on custom elements with client render on top of bad server markup -* renders for attribute on custom elements with server string render -* renders for attribute on custom elements with server stream render -* renders for attribute on custom elements with clean client render -* renders for attribute on custom elements with client render on top of good server markup -* renders for attribute on custom elements with client render on top of bad server markup * renders positive numeric property with positive value with server string render * renders positive numeric property with positive value with server stream render * renders positive numeric property with positive value with clean client render @@ -1259,31 +1190,11 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js * renders no aria prop with null value with clean client render * renders no aria prop with null value with client render on top of good server markup * renders no aria prop with null value with client render on top of bad server markup -* renders badly cased aliased HTML attribute with a warning with server string render -* renders badly cased aliased HTML attribute with a warning with server stream render -* renders badly cased aliased HTML attribute with a warning with clean client render -* renders badly cased aliased HTML attribute with a warning with client render on top of good server markup -* renders badly cased aliased HTML attribute with a warning with client render on top of bad server markup -* renders badly cased SVG attribute with a warning with server string render -* renders badly cased SVG attribute with a warning with server stream render -* renders badly cased SVG attribute with a warning with clean client render -* renders badly cased SVG attribute with a warning with client render on top of good server markup -* renders badly cased SVG attribute with a warning with client render on top of bad server markup -* renders no badly cased aliased SVG attribute alias with server string render -* renders no badly cased aliased SVG attribute alias with server stream render -* renders no badly cased aliased SVG attribute alias with clean client render -* renders no badly cased aliased SVG attribute alias with client render on top of good server markup -* renders no badly cased aliased SVG attribute alias with client render on top of bad server markup -* renders no badly cased original SVG attribute that is aliased with server string render -* renders no badly cased original SVG attribute that is aliased with server stream render -* renders no badly cased original SVG attribute that is aliased with clean client render -* renders no badly cased original SVG attribute that is aliased with client render on top of good server markup -* renders no badly cased original SVG attribute that is aliased with client render on top of bad server markup -* renders unknown attributes with server string render -* renders unknown attributes with server stream render -* renders unknown attributes with clean client render -* renders unknown attributes with client render on top of good server markup -* renders unknown attributes with client render on top of bad server markup +* renders no unknown attributes with server string render +* renders no unknown attributes with server stream render +* renders no unknown attributes with clean client render +* renders no unknown attributes with client render on top of good server markup +* renders no unknown attributes with client render on top of bad server markup * renders unknown data- attributes with server string render * renders unknown data- attributes with server stream render * renders unknown data- attributes with clean client render @@ -1294,31 +1205,11 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js * renders no unknown data- attributes with null value with clean client render * renders no unknown data- attributes with null value with client render on top of good server markup * renders no unknown data- attributes with null value with client render on top of bad server markup -* renders unknown data- attributes with casing with server string render -* renders unknown data- attributes with casing with server stream render -* renders unknown data- attributes with casing with clean client render -* renders unknown data- attributes with casing with client render on top of good server markup -* renders unknown data- attributes with casing with client render on top of bad server markup -* renders unknown data- attributes with boolean true with server string render -* renders unknown data- attributes with boolean true with server stream render -* renders unknown data- attributes with boolean true with clean client render -* renders unknown data- attributes with boolean true with client render on top of good server markup -* renders unknown data- attributes with boolean true with client render on top of bad server markup -* renders unknown data- attributes with boolean false with server string render -* renders unknown data- attributes with boolean false with server stream render -* renders unknown data- attributes with boolean false with clean client render -* renders unknown data- attributes with boolean false with client render on top of good server markup -* renders unknown data- attributes with boolean false with client render on top of bad server markup -* renders no unknown data- attributes with casing and null value with server string render -* renders no unknown data- attributes with casing and null value with server stream render -* renders no unknown data- attributes with casing and null value with clean client render -* renders no unknown data- attributes with casing and null value with client render on top of good server markup -* renders no unknown data- attributes with casing and null value with client render on top of bad server markup -* renders custom attributes for non-standard elements with server string render -* renders custom attributes for non-standard elements with server stream render -* renders custom attributes for non-standard elements with clean client render -* renders custom attributes for non-standard elements with client render on top of good server markup -* renders custom attributes for non-standard elements with client render on top of bad server markup +* renders no unknown attributes for non-standard elements with server string render +* renders no unknown attributes for non-standard elements with server stream render +* renders no unknown attributes for non-standard elements with clean client render +* renders no unknown attributes for non-standard elements with client render on top of good server markup +* renders no unknown attributes for non-standard elements with client render on top of bad server markup * renders unknown attributes for custom elements with server string render * renders unknown attributes for custom elements with server stream render * renders unknown attributes for custom elements with clean client render @@ -1339,11 +1230,6 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js * renders no unknown attributes for custom elements using is with null value with clean client render * renders no unknown attributes for custom elements using is with null value with client render on top of good server markup * renders no unknown attributes for custom elements using is with null value with client render on top of bad server markup -* renders cased custom attributes with server string render -* renders cased custom attributes with server stream render -* renders cased custom attributes with clean client render -* renders cased custom attributes with client render on top of good server markup -* renders cased custom attributes with client render on top of bad server markup * renders no HTML events with server string render * renders no HTML events with server stream render * renders no HTML events with clean client render @@ -1464,16 +1350,11 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js * renders an svg element with clean client render * renders an svg element with client render on top of good server markup * renders an svg element with client render on top of bad server markup -* renders svg child element with server string render -* renders svg child element with server stream render -* renders svg child element with clean client render -* renders svg child element with client render on top of good server markup -* renders svg child element with client render on top of bad server markup -* renders no svg child element with a badly cased with server string render -* renders no svg child element with a badly cased with server stream render -* renders no svg child element with a badly cased with clean client render -* renders no svg child element with a badly cased with client render on top of good server markup -* renders no svg child element with a badly cased with client render on top of bad server markup +* renders svg element with an xlink with server string render +* renders svg element with an xlink with server stream render +* renders svg element with an xlink with clean client render +* renders svg element with an xlink with client render on top of good server markup +* renders svg element with an xlink with client render on top of bad server markup * renders a math element with server string render * renders a math element with server stream render * renders a math element with clean client render @@ -1828,6 +1709,11 @@ src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js * can distinguish an empty component from a dom node * can distinguish an empty component from an empty text component * should error reconnecting a div with different dangerouslySetInnerHTML +* renders injected attributes with server string render +* renders injected attributes with server stream render +* renders injected attributes with clean client render +* renders injected attributes with client render on top of good server markup +* renders injected attributes with client render on top of bad server markup src/renderers/dom/shared/__tests__/ReactDOMTextComponent-test.js * updates a mounted text component in place @@ -1905,7 +1791,6 @@ src/renderers/dom/shared/__tests__/ReactServerRendering-test.js * warns with a no-op when an async setState is triggered * warns with a no-op when an async forceUpdate is triggered * should warn when children are mutated during render -* warns about lowercase html but not in svg tags src/renderers/dom/shared/__tests__/ReactServerRenderingBrowser-test.js * provides the same top-level API as react-dom/server @@ -1956,7 +1841,6 @@ src/renderers/dom/shared/__tests__/renderSubtreeIntoContainer-test.js * should render portal with non-context-provider parent * should get context through non-context-provider parent * should get context through middle non-context-provider layer -* fails gracefully when mixing React 15 and 16 src/renderers/dom/shared/__tests__/validateDOMNesting-test.js * allows any tag with no context @@ -2066,8 +1950,6 @@ src/renderers/dom/shared/utils/__tests__/getEventCharCode-test.js * returns charCode * returns 13 * returns 0 -* returns 13 -* returns 13 * returns keyCode * returns 13 * returns 0 @@ -2201,7 +2083,6 @@ src/renderers/dom/shared/wrappers/__tests__/ReactDOMSelect-test.js * should warn if value and defaultValue props are specified * should be able to safely remove select onChange * should select grandchild options nested inside an optgroup -* should allow controlling `value` in a nested render src/renderers/dom/shared/wrappers/__tests__/ReactDOMTextarea-test.js * should allow setting `defaultValue` From e45e1bbd75652d0404cfa089dbb54f8c69df0c4e Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Fri, 5 Jan 2018 16:07:39 +0000 Subject: [PATCH 4/6] Reset changes to results.json --- scripts/rollup/results.json | 597 ++++++++++++++++++++++++------------ 1 file changed, 400 insertions(+), 197 deletions(-) diff --git a/scripts/rollup/results.json b/scripts/rollup/results.json index 2a31b8003ff4a..7dc84e2642fc4 100644 --- a/scripts/rollup/results.json +++ b/scripts/rollup/results.json @@ -1,200 +1,403 @@ { - "bundleSizes": { - "react.development.js (UMD_DEV)": { - "size": 66229, - "gzip": 16806 - }, - "react.production.min.js (UMD_PROD)": { - "size": 6359, - "gzip": 2597 - }, - "react.development.js (NODE_DEV)": { - "size": 56636, - "gzip": 14457 - }, - "react.production.min.js (NODE_PROD)": { - "size": 5382, - "gzip": 2230 - }, - "React-dev.js (FB_DEV)": { - "size": 53788, - "gzip": 13694 - }, - "React-prod.js (FB_PROD)": { - "size": 25014, - "gzip": 6703 - }, - "react-dom.development.js (UMD_DEV)": { - "size": 643705, - "gzip": 146822 - }, - "react-dom.production.min.js (UMD_PROD)": { - "size": 103098, - "gzip": 32161 - }, - "react-dom.development.js (NODE_DEV)": { - "size": 602513, - "gzip": 137120 - }, - "react-dom.production.min.js (NODE_PROD)": { - "size": 107074, - "gzip": 33571 - }, - "ReactDOMFiber-dev.js (FB_DEV)": { - "size": 599283, - "gzip": 136595 - }, - "ReactDOMFiber-prod.js (FB_PROD)": { - "size": 417365, - "gzip": 93302 - }, - "react-dom-test-utils.development.js (NODE_DEV)": { - "size": 53571, - "gzip": 13412 - }, - "ReactTestUtils-dev.js (FB_DEV)": { - "size": 53353, - "gzip": 13400 - }, - "react-dom-unstable-native-dependencies.development.js (UMD_DEV)": { - "size": 88399, - "gzip": 22250 - }, - "react-dom-unstable-native-dependencies.production.min.js (UMD_PROD)": { - "size": 15149, - "gzip": 4910 - }, - "react-dom-unstable-native-dependencies.development.js (NODE_DEV)": { - "size": 81936, - "gzip": 20299 - }, - "react-dom-unstable-native-dependencies.production.min.js (NODE_PROD)": { - "size": 13926, - "gzip": 4403 - }, - "ReactDOMUnstableNativeDependencies-dev.js (FB_DEV)": { - "size": 81625, - "gzip": 20283 - }, - "ReactDOMUnstableNativeDependencies-prod.js (FB_PROD)": { - "size": 66066, - "gzip": 15736 - }, - "react-dom-server.browser.development.js (UMD_DEV)": { - "size": 132040, - "gzip": 33467 - }, - "react-dom-server.browser.production.min.js (UMD_PROD)": { - "size": 14805, - "gzip": 5834 - }, - "react-dom-server.browser.development.js (NODE_DEV)": { - "size": 100322, - "gzip": 25762 - }, - "react-dom-server.browser.production.min.js (NODE_PROD)": { - "size": 14095, - "gzip": 5614 - }, - "ReactDOMServer-dev.js (FB_DEV)": { - "size": 99495, - "gzip": 25683 - }, - "ReactDOMServer-prod.js (FB_PROD)": { - "size": 42774, - "gzip": 12117 - }, - "react-dom-server.node.development.js (NODE_DEV)": { - "size": 103107, - "gzip": 26324 - }, - "react-dom-server.node.production.min.js (NODE_PROD)": { - "size": 15152, - "gzip": 5954 - }, - "react-art.development.js (UMD_DEV)": { - "size": 308692, - "gzip": 66945 - }, - "react-art.production.min.js (UMD_PROD)": { - "size": 47486, - "gzip": 14835 - }, - "react-art.development.js (NODE_DEV)": { - "size": 296021, - "gzip": 63031 - }, - "react-art.production.min.js (NODE_PROD)": { - "size": 52508, - "gzip": 16415 - }, - "ReactARTFiber-dev.js (FB_DEV)": { - "size": 294942, - "gzip": 63116 - }, - "ReactARTFiber-prod.js (FB_PROD)": { - "size": 220257, - "gzip": 45845 - }, - "ReactNativeStack-dev.js (RN_DEV)": { - "size": 200820, - "gzip": 37267 - }, - "ReactNativeStack-prod.js (RN_PROD)": { - "size": 137149, - "gzip": 26290 - }, - "ReactNativeFiber-dev.js (RN_DEV)": { - "size": 306294, - "gzip": 53069 - }, - "ReactNativeFiber-prod.js (RN_PROD)": { - "size": 221406, - "gzip": 38324 - }, - "react-test-renderer.development.js (NODE_DEV)": { - "size": 300523, - "gzip": 63485 - }, - "ReactTestRendererFiber-dev.js (FB_DEV)": { - "size": 299429, - "gzip": 63577 - }, - "react-test-renderer-shallow.development.js (NODE_DEV)": { - "size": 9586, - "gzip": 2382 - }, - "ReactShallowRenderer-dev.js (FB_DEV)": { - "size": 9484, - "gzip": 2363 - }, - "react-noop-renderer.development.js (NODE_DEV)": { - "size": 287732, - "gzip": 60341 - }, - "react-dom-server.development.js (UMD_DEV)": { - "size": 120897, - "gzip": 30672 - }, - "react-dom-server.production.min.js (UMD_PROD)": { - "size": 20136, - "gzip": 7672 - }, - "react-dom-server.development.js (NODE_DEV)": { - "size": 90047, - "gzip": 23257 - }, - "react-dom-server.production.min.js (NODE_PROD)": { - "size": 18718, - "gzip": 7197 - }, - "react-dom-node-stream.development.js (NODE_DEV)": { - "size": 91741, - "gzip": 23757 - }, - "react-dom-node-stream.production.min.js (NODE_PROD)": { - "size": 19585, - "gzip": 7520 + "bundleSizes": [ + { + "filename": "react.development.js", + "bundleType": "UMD_DEV", + "packageName": "react", + "size": 55396, + "gzip": 15025 + }, + { + "filename": "react.production.min.js", + "bundleType": "UMD_PROD", + "packageName": "react", + "size": 6546, + "gzip": 2789 + }, + { + "filename": "react.development.js", + "bundleType": "NODE_DEV", + "packageName": "react", + "size": 45812, + "gzip": 12711 + }, + { + "filename": "react.production.min.js", + "bundleType": "NODE_PROD", + "packageName": "react", + "size": 5341, + "gzip": 2343 + }, + { + "filename": "React-dev.js", + "bundleType": "FB_DEV", + "packageName": "react", + "size": 45150, + "gzip": 12229 + }, + { + "filename": "React-prod.js", + "bundleType": "FB_PROD", + "packageName": "react", + "size": 12675, + "gzip": 3412 + }, + { + "filename": "react-dom.development.js", + "bundleType": "UMD_DEV", + "packageName": "react-dom", + "size": 560105, + "gzip": 132646 + }, + { + "filename": "react-dom.production.min.js", + "bundleType": "UMD_PROD", + "packageName": "react-dom", + "size": 93530, + "gzip": 30695 + }, + { + "filename": "react-dom.development.js", + "bundleType": "NODE_DEV", + "packageName": "react-dom", + "size": 544138, + "gzip": 128866 + }, + { + "filename": "react-dom.production.min.js", + "bundleType": "NODE_PROD", + "packageName": "react-dom", + "size": 91951, + "gzip": 29748 + }, + { + "filename": "ReactDOM-dev.js", + "bundleType": "FB_DEV", + "packageName": "react-dom", + "size": 561584, + "gzip": 131098 + }, + { + "filename": "ReactDOM-prod.js", + "bundleType": "FB_PROD", + "packageName": "react-dom", + "size": 264984, + "gzip": 51187 + }, + { + "filename": "react-dom-test-utils.development.js", + "bundleType": "UMD_DEV", + "packageName": "react-dom", + "size": 41302, + "gzip": 11748 + }, + { + "filename": "react-dom-test-utils.production.min.js", + "bundleType": "UMD_PROD", + "packageName": "react-dom", + "size": 10583, + "gzip": 3916 + }, + { + "filename": "react-dom-test-utils.development.js", + "bundleType": "NODE_DEV", + "packageName": "react-dom", + "size": 36039, + "gzip": 10283 + }, + { + "filename": "react-dom-test-utils.production.min.js", + "bundleType": "NODE_PROD", + "packageName": "react-dom", + "size": 10160, + "gzip": 3834 + }, + { + "filename": "ReactTestUtils-dev.js", + "bundleType": "FB_DEV", + "packageName": "react-dom", + "size": 36754, + "gzip": 10368 + }, + { + "filename": "react-dom-unstable-native-dependencies.development.js", + "bundleType": "UMD_DEV", + "packageName": "react-dom", + "size": 63565, + "gzip": 16655 + }, + { + "filename": "react-dom-unstable-native-dependencies.production.min.js", + "bundleType": "UMD_PROD", + "packageName": "react-dom", + "size": 11337, + "gzip": 3913 + }, + { + "filename": "react-dom-unstable-native-dependencies.development.js", + "bundleType": "NODE_DEV", + "packageName": "react-dom", + "size": 59127, + "gzip": 15478 + }, + { + "filename": "react-dom-unstable-native-dependencies.production.min.js", + "bundleType": "NODE_PROD", + "packageName": "react-dom", + "size": 10884, + "gzip": 3780 + }, + { + "filename": "ReactDOMUnstableNativeDependencies-dev.js", + "bundleType": "FB_DEV", + "packageName": "react-dom", + "size": 58208, + "gzip": 14853 + }, + { + "filename": "ReactDOMUnstableNativeDependencies-prod.js", + "bundleType": "FB_PROD", + "packageName": "react-dom", + "size": 26829, + "gzip": 5410 + }, + { + "filename": "react-dom-server.browser.development.js", + "bundleType": "UMD_DEV", + "packageName": "react-dom", + "size": 93545, + "gzip": 25061 + }, + { + "filename": "react-dom-server.browser.production.min.js", + "bundleType": "UMD_PROD", + "packageName": "react-dom", + "size": 14258, + "gzip": 5749 + }, + { + "filename": "react-dom-server.browser.development.js", + "bundleType": "NODE_DEV", + "packageName": "react-dom", + "size": 82603, + "gzip": 22355 + }, + { + "filename": "react-dom-server.browser.production.min.js", + "bundleType": "NODE_PROD", + "packageName": "react-dom", + "size": 13600, + "gzip": 5503 + }, + { + "filename": "ReactDOMServer-dev.js", + "bundleType": "FB_DEV", + "packageName": "react-dom", + "size": 86081, + "gzip": 22377 + }, + { + "filename": "ReactDOMServer-prod.js", + "bundleType": "FB_PROD", + "packageName": "react-dom", + "size": 29791, + "gzip": 7706 + }, + { + "filename": "react-dom-server.node.development.js", + "bundleType": "NODE_DEV", + "packageName": "react-dom", + "size": 84571, + "gzip": 22859 + }, + { + "filename": "react-dom-server.node.production.min.js", + "bundleType": "NODE_PROD", + "packageName": "react-dom", + "size": 14424, + "gzip": 5812 + }, + { + "filename": "react-art.development.js", + "bundleType": "UMD_DEV", + "packageName": "react-art", + "size": 357417, + "gzip": 80218 + }, + { + "filename": "react-art.production.min.js", + "bundleType": "UMD_PROD", + "packageName": "react-art", + "size": 83166, + "gzip": 25969 + }, + { + "filename": "react-art.development.js", + "bundleType": "NODE_DEV", + "packageName": "react-art", + "size": 281504, + "gzip": 61113 + }, + { + "filename": "react-art.production.min.js", + "bundleType": "NODE_PROD", + "packageName": "react-art", + "size": 46841, + "gzip": 14915 + }, + { + "filename": "ReactART-dev.js", + "bundleType": "FB_DEV", + "packageName": "react-art", + "size": 285443, + "gzip": 60847 + }, + { + "filename": "ReactART-prod.js", + "bundleType": "FB_PROD", + "packageName": "react-art", + "size": 144091, + "gzip": 25195 + }, + { + "filename": "ReactNativeRenderer-dev.js", + "bundleType": "RN_DEV", + "packageName": "react-native-renderer", + "size": 410230, + "gzip": 91379 + }, + { + "filename": "ReactNativeRenderer-prod.js", + "bundleType": "RN_PROD", + "packageName": "react-native-renderer", + "size": 195919, + "gzip": 34255 + }, + { + "filename": "ReactRTRenderer-dev.js", + "bundleType": "RN_DEV", + "packageName": "react-rt-renderer", + "size": 285839, + "gzip": 61732 + }, + { + "filename": "ReactRTRenderer-prod.js", + "bundleType": "RN_PROD", + "packageName": "react-rt-renderer", + "size": 133043, + "gzip": 22879 + }, + { + "filename": "ReactCSRenderer-dev.js", + "bundleType": "RN_DEV", + "packageName": "react-cs-renderer", + "size": 276463, + "gzip": 58836 + }, + { + "filename": "ReactCSRenderer-prod.js", + "bundleType": "RN_PROD", + "packageName": "react-cs-renderer", + "size": 125807, + "gzip": 21577 + }, + { + "filename": "react-test-renderer.development.js", + "bundleType": "NODE_DEV", + "packageName": "react-test-renderer", + "size": 278075, + "gzip": 59901 + }, + { + "filename": "react-test-renderer.production.min.js", + "bundleType": "NODE_PROD", + "packageName": "react-test-renderer", + "size": 45203, + "gzip": 14330 + }, + { + "filename": "ReactTestRenderer-dev.js", + "bundleType": "FB_DEV", + "packageName": "react-test-renderer", + "size": 282110, + "gzip": 59647 + }, + { + "filename": "react-test-renderer-shallow.development.js", + "bundleType": "NODE_DEV", + "packageName": "react-test-renderer", + "size": 10995, + "gzip": 3014 + }, + { + "filename": "react-test-renderer-shallow.production.min.js", + "bundleType": "NODE_PROD", + "packageName": "react-test-renderer", + "size": 5522, + "gzip": 2004 + }, + { + "filename": "ReactShallowRenderer-dev.js", + "bundleType": "FB_DEV", + "packageName": "react-test-renderer", + "size": 11232, + "gzip": 2981 + }, + { + "filename": "react-noop-renderer.development.js", + "bundleType": "NODE_DEV", + "packageName": "react-noop-renderer", + "size": 18222, + "gzip": 5112 + }, + { + "filename": "react-noop-renderer.production.min.js", + "bundleType": "NODE_PROD", + "packageName": "react-noop-renderer", + "size": 6381, + "gzip": 2558 + }, + { + "filename": "react-reconciler.development.js", + "bundleType": "NODE_DEV", + "packageName": "react-reconciler", + "size": 259921, + "gzip": 55519 + }, + { + "filename": "react-reconciler.production.min.js", + "bundleType": "NODE_PROD", + "packageName": "react-reconciler", + "size": 38513, + "gzip": 12317 + }, + { + "filename": "react-reconciler-reflection.development.js", + "bundleType": "NODE_DEV", + "packageName": "react-reconciler", + "size": 10926, + "gzip": 3382 + }, + { + "filename": "react-reconciler-reflection.production.min.js", + "bundleType": "NODE_PROD", + "packageName": "react-reconciler", + "size": 2408, + "gzip": 1062 + }, + { + "filename": "react-call-return.development.js", + "bundleType": "NODE_DEV", + "packageName": "react-call-return", + "size": 2683, + "gzip": 958 + }, + { + "filename": "react-call-return.production.min.js", + "bundleType": "NODE_PROD", + "packageName": "react-call-return", + "size": 971, + "gzip": 525 } - } + ] } \ No newline at end of file From 364f3509c77012ff6247ef7d7d0d2504b295e09a Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Fri, 5 Jan 2018 16:08:10 +0000 Subject: [PATCH 5/6] Remove old test file --- .../events/__tests__/getEventCharCode-test.js | 108 ------------------ 1 file changed, 108 deletions(-) delete mode 100644 packages/react-dom/src/events/__tests__/getEventCharCode-test.js diff --git a/packages/react-dom/src/events/__tests__/getEventCharCode-test.js b/packages/react-dom/src/events/__tests__/getEventCharCode-test.js deleted file mode 100644 index 1a97dbda3b70a..0000000000000 --- a/packages/react-dom/src/events/__tests__/getEventCharCode-test.js +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Copyright (c) 2016-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @emails react-core - */ - -'use strict'; - -// TODO: can we express this test with only public API? -var getEventCharCode = require('../getEventCharCode').default; - -describe('getEventCharCode', () => { - describe('when charCode is present in nativeEvent', () => { - describe('when charCode is 0 and keyCode is 13', () => { - it('returns 13', () => { - var nativeEvent = new KeyboardEvent('keypress', { - charCode: 0, - keyCode: 13, - }); - - expect(getEventCharCode(nativeEvent)).toBe(13); - }); - }); - - describe('when charCode is not 0 and/or keyCode is not 13', () => { - describe('when charCode is 32 or bigger', () => { - it('returns charCode', () => { - var nativeEvent = new KeyboardEvent('keypress', {charCode: 32}); - - expect(getEventCharCode(nativeEvent)).toBe(32); - }); - }); - - describe('when charCode is smaller than 32', () => { - describe('when charCode is 13', () => { - it('returns 13', () => { - var nativeEvent = new KeyboardEvent('keypress', {charCode: 13}); - - expect(getEventCharCode(nativeEvent)).toBe(13); - }); - }); - - describe('when charCode is not 13', () => { - it('returns 0', () => { - var nativeEvent = new KeyboardEvent('keypress', {charCode: 31}); - - expect(getEventCharCode(nativeEvent)).toBe(0); - }); - }); - - describe('when charCode is 10', () => { - it('returns 13', () => { - var nativeEvent = new KeyboardEvent('keypress', {charCode: 10}); - - expect(getEventCharCode(nativeEvent)).toBe(13); - }); - - describe('when ctrl key is pressed', () => { - it('returns 13', () => { - var nativeEvent = new KeyboardEvent('keypress', { - charCode: 10, - ctrlKey: true, - }); - - expect(getEventCharCode(nativeEvent)).toBe(13); - }); - }); - }); - }); - }); - }); - - /** - nativeEvent is represented as a plain object here to ease testing, because - KeyboardEvent's 'charCode' event key cannot be deleted to simulate a missing - charCode key. - */ - describe('when charCode is not present in nativeEvent', () => { - describe('when keyCode is 32 or bigger', () => { - it('returns keyCode', () => { - var nativeEvent = {keyCode: 32}; - - expect(getEventCharCode(nativeEvent)).toBe(32); - }); - }); - - describe('when keyCode is smaller than 32', () => { - describe('when keyCode is 13', () => { - it('returns 13', () => { - var nativeEvent = {keyCode: 13}; - - expect(getEventCharCode(nativeEvent)).toBe(13); - }); - }); - - describe('when keyCode is not 13', () => { - it('returns 0', () => { - var nativeEvent = {keyCode: 31}; - - expect(getEventCharCode(nativeEvent)).toBe(0); - }); - }); - }); - }); -}); From f489a4c1911eaf45339d93bca4e3efddb2f68dd0 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Fri, 5 Jan 2018 16:13:10 +0000 Subject: [PATCH 6/6] Add tests in the right place --- .../__tests__/SyntheticKeyboardEvent-test.js | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/packages/react-dom/src/events/__tests__/SyntheticKeyboardEvent-test.js b/packages/react-dom/src/events/__tests__/SyntheticKeyboardEvent-test.js index c31912c3993c0..16fd4d757e28b 100644 --- a/packages/react-dom/src/events/__tests__/SyntheticKeyboardEvent-test.js +++ b/packages/react-dom/src/events/__tests__/SyntheticKeyboardEvent-test.js @@ -115,6 +115,47 @@ describe('SyntheticKeyboardEvent', () => { ); expect(called).toBe(false); }); + + it('when charCode is 10, returns 13', () => { + let charCode = null; + const node = ReactDOM.render( + { + charCode = e.charCode; + }} + />, + container, + ); + node.dispatchEvent( + new KeyboardEvent('keypress', { + charCode: 10, + bubbles: true, + cancelable: true, + }), + ); + expect(charCode).toBe(13); + }); + + it('when charCode is 10 and ctrl is pressed, returns 13', () => { + let charCode = null; + const node = ReactDOM.render( + { + charCode = e.charCode; + }} + />, + container, + ); + node.dispatchEvent( + new KeyboardEvent('keypress', { + charCode: 10, + ctrlKey: true, + bubbles: true, + cancelable: true, + }), + ); + expect(charCode).toBe(13); + }); }); // TODO: this seems IE8 specific.