@samitouri / QOS-React-2 / commits / dce3c28ccb

Prevent process polyfill to be included in builds because of process guards preventing code replace (#9518)

Mateusz Burzyński committed Apr 26, 2017 at 14:47 UTC dce3c28ccb5b03a66580bec30b721fdbfcf73f31
1 file changed +1 -18
src/isomorphic/children/flattenChildren.js
+1 -18
@@ -15,21 +15,7 @@
15 var KeyEscapeUtils = require('KeyEscapeUtils');
16 var traverseAllChildren = require('traverseAllChildren');
17 var warning = require('fbjs/lib/warning');
18 -
19 -var ReactComponentTreeHook;
20 -
21 -if (
22 - typeof process !== 'undefined' &&
23 - process.env &&
24 - process.env.NODE_ENV === 'test'
25 -) {
26 - // Temporary hack.
27 - // Inline requires don't work well with Jest:
28 - // https://github.com/facebook/react/issues/7240
29 - // Remove the inline requires when we don't need them anymore:
30 - // https://github.com/facebook/react/pull/7178
31 - ReactComponentTreeHook = require('ReactComponentTreeHook');
32 -}
18 +var ReactComponentTreeHook = require('ReactComponentTreeHook');
19
20 /**
21 * @param {function} traverseContext Context passed through traversal.
@@ -48,9 +34,6 @@ function flattenSingleChildIntoContext(
34 const result = traverseContext;
35 const keyUnique = result[name] === undefined;
36 if (__DEV__) {
51 - if (!ReactComponentTreeHook) {
52 - ReactComponentTreeHook = require('ReactComponentTreeHook');
53 - }
37 if (!keyUnique) {
38 warning(
39 false,