Skip to content

Commit

Permalink
Don't bundle ReactComponentTreeHook in production (#7653)
Browse files Browse the repository at this point in the history
Fixes #7492.
This was a build size regression introduced in #7164.
  • Loading branch information
gaearon committed Sep 3, 2016
1 parent 9d9af63 commit a09d158
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/umd/ReactUMDEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,17 @@ var React = require('React');
var ReactUMDEntry = Object.assign({
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
ReactCurrentOwner: require('ReactCurrentOwner'),
ReactComponentTreeHook: require('ReactComponentTreeHook'),
},
}, React);

if (__DEV__) {
Object.assign(
ReactUMDEntry.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
{
// ReactComponentTreeHook should not be included in production.
ReactComponentTreeHook: require('ReactComponentTreeHook'),
}
);
}

module.exports = ReactUMDEntry;
11 changes: 10 additions & 1 deletion src/umd/ReactWithAddonsUMDEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,17 @@ var ReactWithAddons = require('ReactWithAddons');
var ReactWithAddonsUMDEntry = Object.assign({
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
ReactCurrentOwner: require('ReactCurrentOwner'),
ReactComponentTreeHook: require('ReactComponentTreeHook'),
},
}, ReactWithAddons);

if (__DEV__) {
Object.assign(
ReactWithAddonsUMDEntry.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
{
// ReactComponentTreeHook should not be included in production.
ReactComponentTreeHook: require('ReactComponentTreeHook'),
}
);
}

module.exports = ReactWithAddonsUMDEntry;

0 comments on commit a09d158

Please sign in to comment.