Skip to content

Commit

Permalink
Added stack renderer to react-test-renderer bundle temporarily (#9514)
Browse files Browse the repository at this point in the history
Also fixed an error in a temporary export property that had been added to the React object
  • Loading branch information
bvaughn authored Apr 25, 2017
1 parent 4cbadd3 commit e71b308
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/react-test-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"README.md",
"index.js",
"shallow.js",
"stack.js",
"cjs/"
]
}
7 changes: 7 additions & 0 deletions packages/react-test-renderer/stack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
throw Error('test renderer is not available in production mode.');
} else {
module.exports = require('./cjs/react-test-renderer-stack.development');
}
4 changes: 2 additions & 2 deletions scripts/rollup/bundles.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ const bundles = [
},
{
babelOpts: babelOptsReact,
bundleTypes: [FB_DEV],
bundleTypes: [FB_DEV, NODE_DEV],
config: {
destDir: 'build/',
moduleName: 'ReactTestRenderer',
Expand All @@ -374,7 +374,7 @@ const bundles = [
isRenderer: true,
label: 'test-stack',
manglePropertiesOnProd: false,
name: 'react-test-renderer-stack',
name: 'react-test-renderer/stack',
paths: [
'src/renderers/native/**/*.js',
'src/renderers/shared/**/*.js',
Expand Down
4 changes: 2 additions & 2 deletions src/isomorphic/React.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ if (__DEV__) {
return mixin;
};

// TODO (bvaughn) Remove both of these deprecation warnings before 16.0.0
// TODO (bvaughn) Remove all of these accessors before 16.0.0
if (canDefineProperty) {
Object.defineProperty(React, 'checkPropTypes', {
get() {
Expand All @@ -113,7 +113,7 @@ if (__DEV__) {
'(https://fb.me/migrating-from-react-proptypes)',
);
warnedForCheckPropTypes = true;
return ReactPropTypes;
return checkPropTypes;
},
});

Expand Down

0 comments on commit e71b308

Please sign in to comment.