Skip to content

Commit a09d158

Browse files
authored
Don't bundle ReactComponentTreeHook in production (#7653)
Fixes #7492. This was a build size regression introduced in #7164.
1 parent 9d9af63 commit a09d158

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/umd/ReactUMDEntry.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,17 @@ var React = require('React');
1717
var ReactUMDEntry = Object.assign({
1818
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
1919
ReactCurrentOwner: require('ReactCurrentOwner'),
20-
ReactComponentTreeHook: require('ReactComponentTreeHook'),
2120
},
2221
}, React);
2322

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+
2433
module.exports = ReactUMDEntry;

src/umd/ReactWithAddonsUMDEntry.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,17 @@ var ReactWithAddons = require('ReactWithAddons');
1717
var ReactWithAddonsUMDEntry = Object.assign({
1818
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
1919
ReactCurrentOwner: require('ReactCurrentOwner'),
20-
ReactComponentTreeHook: require('ReactComponentTreeHook'),
2120
},
2221
}, ReactWithAddons);
2322

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+
2433
module.exports = ReactWithAddonsUMDEntry;

0 commit comments

Comments
 (0)