From ff6f2739f0913ff8440b9209910e0e247100bb5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Wed, 2 Aug 2017 10:55:31 +0200 Subject: [PATCH 1/2] Fix error-codes not updating correctly --- scripts/error-codes/codes.json | 24 ++++++- scripts/error-codes/extract-errors.js | 13 ++-- scripts/rollup/results.json | 100 +++++++++++++------------- 3 files changed, 82 insertions(+), 55 deletions(-) diff --git a/scripts/error-codes/codes.json b/scripts/error-codes/codes.json index 94079696bc0e..067c77e31e47 100644 --- a/scripts/error-codes/codes.json +++ b/scripts/error-codes/codes.json @@ -197,5 +197,27 @@ "195": "The internal instance must be a React host component. This error is likely caused by a bug in React. Please file an issue.", "196": "Missing injection for fiber getContextForSubtree", "197": "Injected invokeGuardedCallback() must be a function.", - "198": "clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue." + "198": "clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.", + "199": "Fiber owners should not show up in Stack stack traces.", + "200": "Target container is not a DOM element.", + "201": "ReactDOM.render(): Invalid component element. Instead of passing a string like 'div', pass React.createElement('div') or
.", + "202": "ReactDOM.render(): Invalid component element. Instead of passing a class like Foo, pass React.createElement(Foo) or .", + "203": "ReactDOM.render(): Invalid component element. This may be caused by unintentionally loading two independent copies of React.", + "204": "ReactDOM.render(): Invalid component element.", + "205": "renderToStream(): Invalid component element.", + "206": "renderToStaticStream(): Invalid component element.", + "207": "renderToString(): Invalid component element.", + "208": "renderToStaticMarkup(): Invalid component element.", + "209": "Missing injection for fiber findDOMNode", + "210": "Missing injection for stack findDOMNode", + "211": "Element appears to be neither ReactComponent nor DOMNode. Keys: %s", + "212": "toTree() does not yet know how to handle nodes with tag=%s", + "213": "something went wrong", + "214": "Text children should already be flattened.", + "215": "ReactART does not support the type \"%s\"", + "216": "ReactART: Can not insert node before itself", + "217": "getInspectorDataForViewTag() is not available in production", + "218": "Container does not support insertBefore operation", + "219": "Tried to register two views with the same name %s", + "220": "View config not found for name %s" } diff --git a/scripts/error-codes/extract-errors.js b/scripts/error-codes/extract-errors.js index b437a9cbde3d..3d102189794b 100644 --- a/scripts/error-codes/extract-errors.js +++ b/scripts/error-codes/extract-errors.js @@ -40,10 +40,15 @@ module.exports = function(opts) { var errorMapFilePath = opts.errorMapFilePath; var existingErrorMap; try { - existingErrorMap = require(path.join( - __dirname, - path.basename(errorMapFilePath) - )); + // Using `fs.readFileSync` instead of `require` here, because `require()` + // calls are cached, and the cache map is not properly invalidated after + // file changes. + existingErrorMap = JSON.parse( + fs.readFileSync( + path.join(__dirname, path.basename(errorMapFilePath)), + 'utf8' + ) + ); } catch (e) { existingErrorMap = {}; } diff --git a/scripts/rollup/results.json b/scripts/rollup/results.json index c1174f632e6a..a63292212b28 100644 --- a/scripts/rollup/results.json +++ b/scripts/rollup/results.json @@ -25,28 +25,28 @@ "gzip": 6703 }, "react-dom.development.js (UMD_DEV)": { - "size": 635300, - "gzip": 145020 + "size": 639824, + "gzip": 145999 }, "react-dom.production.min.js (UMD_PROD)": { - "size": 121424, - "gzip": 38875 + "size": 121920, + "gzip": 38871 }, "react-dom.development.js (NODE_DEV)": { - "size": 594696, - "gzip": 135394 + "size": 599220, + "gzip": 136402 }, "react-dom.production.min.js (NODE_PROD)": { - "size": 118342, - "gzip": 37771 + "size": 118838, + "gzip": 37788 }, "ReactDOMFiber-dev.js (FB_DEV)": { - "size": 593376, - "gzip": 135602 + "size": 595749, + "gzip": 135868 }, "ReactDOMFiber-prod.js (FB_PROD)": { - "size": 429672, - "gzip": 96821 + "size": 431003, + "gzip": 96867 }, "react-dom-test-utils.development.js (NODE_DEV)": { "size": 56074, @@ -65,20 +65,20 @@ "gzip": 81957 }, "react-dom-server.development.js (UMD_DEV)": { - "size": 121124, - "gzip": 30746 + "size": 122993, + "gzip": 31032 }, "react-dom-server.production.min.js (UMD_PROD)": { - "size": 21826, - "gzip": 8304 + "size": 22819, + "gzip": 8627 }, "react-dom-server.development.js (NODE_DEV)": { - "size": 90276, - "gzip": 23309 + "size": 92141, + "gzip": 23593 }, "react-dom-server.production.min.js (NODE_PROD)": { - "size": 20599, - "gzip": 7826 + "size": 21214, + "gzip": 8026 }, "ReactDOMServerStream-dev.js (FB_DEV)": { "size": 264750, @@ -89,28 +89,28 @@ "gzip": 51047 }, "react-art.development.js (UMD_DEV)": { - "size": 372472, - "gzip": 82325 + "size": 373050, + "gzip": 82463 }, "react-art.production.min.js (UMD_PROD)": { - "size": 94128, - "gzip": 29132 + "size": 94183, + "gzip": 29145 }, "react-art.development.js (NODE_DEV)": { - "size": 293841, - "gzip": 62296 + "size": 294419, + "gzip": 62436 }, "react-art.production.min.js (NODE_PROD)": { - "size": 55693, - "gzip": 17236 + "size": 55748, + "gzip": 17250 }, "ReactARTFiber-dev.js (FB_DEV)": { - "size": 292701, - "gzip": 62358 + "size": 293279, + "gzip": 62507 }, "ReactARTFiber-prod.js (FB_PROD)": { - "size": 220005, - "gzip": 45510 + "size": 220571, + "gzip": 45660 }, "ReactNativeStack-dev.js (RN_DEV)": { "size": 188445, @@ -121,20 +121,20 @@ "gzip": 26398 }, "ReactNativeFiber-dev.js (RN_DEV)": { - "size": 289861, - "gzip": 52545 + "size": 290148, + "gzip": 52574 }, "ReactNativeFiber-prod.js (RN_PROD)": { - "size": 223857, - "gzip": 38878 + "size": 224144, + "gzip": 38909 }, "react-test-renderer.development.js (NODE_DEV)": { - "size": 291204, - "gzip": 61163 + "size": 291782, + "gzip": 61299 }, "ReactTestRendererFiber-dev.js (FB_DEV)": { - "size": 290022, - "gzip": 61239 + "size": 290600, + "gzip": 61383 }, "react-test-renderer-shallow.development.js (NODE_DEV)": { "size": 10302, @@ -145,8 +145,8 @@ "gzip": 2541 }, "react-noop-renderer.development.js (NODE_DEV)": { - "size": 285131, - "gzip": 59573 + "size": 285709, + "gzip": 59710 }, "ReactHTMLString-dev.js (FB_DEV)": { "size": 265654, @@ -181,20 +181,20 @@ "gzip": 50920 }, "ReactDOMServer-dev.js (FB_DEV)": { - "size": 89770, - "gzip": 23261 + "size": 91224, + "gzip": 23517 }, "ReactDOMServer-prod.js (FB_PROD)": { - "size": 53908, - "gzip": 14890 + "size": 55353, + "gzip": 15240 }, "react-dom-node-stream.development.js (NODE_DEV)": { - "size": 91970, - "gzip": 23799 + "size": 93872, + "gzip": 24085 }, "react-dom-node-stream.production.min.js (NODE_PROD)": { - "size": 21541, - "gzip": 8172 + "size": 22057, + "gzip": 8338 }, "ReactDOMNodeStream-dev.js (FB_DEV)": { "size": 264918, From 29abce961726a1aeca1de183bc4abd9bcc786090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Wed, 2 Aug 2017 11:36:19 +0200 Subject: [PATCH 2/2] Revert changes to codes.json --- scripts/error-codes/codes.json | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/scripts/error-codes/codes.json b/scripts/error-codes/codes.json index 067c77e31e47..94079696bc0e 100644 --- a/scripts/error-codes/codes.json +++ b/scripts/error-codes/codes.json @@ -197,27 +197,5 @@ "195": "The internal instance must be a React host component. This error is likely caused by a bug in React. Please file an issue.", "196": "Missing injection for fiber getContextForSubtree", "197": "Injected invokeGuardedCallback() must be a function.", - "198": "clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.", - "199": "Fiber owners should not show up in Stack stack traces.", - "200": "Target container is not a DOM element.", - "201": "ReactDOM.render(): Invalid component element. Instead of passing a string like 'div', pass React.createElement('div') or
.", - "202": "ReactDOM.render(): Invalid component element. Instead of passing a class like Foo, pass React.createElement(Foo) or .", - "203": "ReactDOM.render(): Invalid component element. This may be caused by unintentionally loading two independent copies of React.", - "204": "ReactDOM.render(): Invalid component element.", - "205": "renderToStream(): Invalid component element.", - "206": "renderToStaticStream(): Invalid component element.", - "207": "renderToString(): Invalid component element.", - "208": "renderToStaticMarkup(): Invalid component element.", - "209": "Missing injection for fiber findDOMNode", - "210": "Missing injection for stack findDOMNode", - "211": "Element appears to be neither ReactComponent nor DOMNode. Keys: %s", - "212": "toTree() does not yet know how to handle nodes with tag=%s", - "213": "something went wrong", - "214": "Text children should already be flattened.", - "215": "ReactART does not support the type \"%s\"", - "216": "ReactART: Can not insert node before itself", - "217": "getInspectorDataForViewTag() is not available in production", - "218": "Container does not support insertBefore operation", - "219": "Tried to register two views with the same name %s", - "220": "View config not found for name %s" + "198": "clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue." }