@samitouri / QOS-React / commits / a09d158a7c

Don't bundle ReactComponentTreeHook in production (#7653)

Fixes #7492. This was a build size regression introduced in #7164.

Dan Abramov committed Sep 3, 2016 at 22:32 UTC a09d158a7cc66634ae5c92649193c83fa69963c1
2 files changed +20 -2
src/umd/ReactUMDEntry.js
+10 -1
@@ -17,8 +17,17 @@ var React = require('React');
17 var ReactUMDEntry = Object.assign({
18 __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
19 ReactCurrentOwner: require('ReactCurrentOwner'),
20 - ReactComponentTreeHook: require('ReactComponentTreeHook'),
20 },
21 }, React);
22
23 +if (__DEV__) {
24 + Object.assign(
25 + ReactUMDEntry.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
26 + {
27 + // ReactComponentTreeHook should not be included in production.
28 + ReactComponentTreeHook: require('ReactComponentTreeHook'),
29 + }
30 + );
31 +}
32 +
33 module.exports = ReactUMDEntry;
src/umd/ReactWithAddonsUMDEntry.js
+10 -1
@@ -17,8 +17,17 @@ var ReactWithAddons = require('ReactWithAddons');
17 var ReactWithAddonsUMDEntry = Object.assign({
18 __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
19 ReactCurrentOwner: require('ReactCurrentOwner'),
20 - ReactComponentTreeHook: require('ReactComponentTreeHook'),
20 },
21 }, ReactWithAddons);
22
23 +if (__DEV__) {
24 + Object.assign(
25 + ReactWithAddonsUMDEntry.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
26 + {
27 + // ReactComponentTreeHook should not be included in production.
28 + ReactComponentTreeHook: require('ReactComponentTreeHook'),
29 + }
30 + );
31 +}
32 +
33 module.exports = ReactWithAddonsUMDEntry;