Skip to content

Commit

Permalink
Addressed Ben's PR feedback:
Browse files Browse the repository at this point in the history
1) Added dependencies for create-react-class/prop-types to packages/react*/package.json
2) Renamed a warning let
3) Expanded on an inline comment example
  • Loading branch information
Brian Vaughn committed Apr 11, 2017
1 parent cf49cfd commit d34109a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"coffee-script": "^1.8.0",
"core-js": "^2.2.1",
"coveralls": "^2.11.6",
"create-react-class": "^15.5.2",
"del": "^2.0.2",
"derequire": "^2.0.3",
"escape-string-regexp": "^1.0.5",
Expand Down Expand Up @@ -72,6 +73,7 @@
"object-assign": "^4.1.1",
"platform": "^1.1.0",
"prettier": "^0.22.0",
"prop-types": "^15.5.6",
"rimraf": "^2.6.1",
"rollup": "^0.41.6",
"rollup-plugin-alias": "^1.2.1",
Expand All @@ -93,10 +95,6 @@
"node": "4.x || 5.x || 6.x || 7.x",
"npm": "2.x || 3.x || 4.x"
},
"dependencies": {
"create-react-class": "^15.5.2",
"prop-types": "^15.5.6"
},
"commonerConfig": {
"version": 7
},
Expand Down
3 changes: 2 additions & 1 deletion packages/react-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"dependencies": {
"fbjs": "^0.8.9",
"loose-envify": "^1.1.0",
"object-assign": "^4.1.0"
"object-assign": "^4.1.0",
"prop-types": "^15.5.6"
},
"peerDependencies": {
"react": "^16.0.0-alpha.8"
Expand Down
4 changes: 3 additions & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
"node": ">=0.10.0"
},
"dependencies": {
"create-react-class": "^15.5.2",
"fbjs": "^0.8.9",
"loose-envify": "^1.1.0",
"object-assign": "^4.1.0"
"object-assign": "^4.1.0",
"prop-types": "^15.5.6"
},
"browserify": {
"transform": [
Expand Down
3 changes: 2 additions & 1 deletion scripts/rollup/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ const devOnlyFilesToStubOut = [

// Ordering of these imports is important;
// The default import must follow deep imports or Rollup breaks.
// eg 'prop-types/index.js/checkPropTypes.js'
// eg if 'prop-types' comes before 'prop-types/checkPropTypes',
// Then Rollup might try to requite 'prop-types/index.js/checkPropTypes.js'
const legacyModules = {
'create-react-class/factory': 'create-react-class/factory.js',
'create-react-class': 'create-react-class/index.js',
Expand Down
12 changes: 6 additions & 6 deletions scripts/rollup/results.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"branch": "prop-types",
"bundleSizes": {
"react.development.js (UMD_DEV)": {
"size": 120940,
"gzip": 30496
"size": 120916,
"gzip": 30481
},
"react.production.min.js (UMD_PROD)": {
"size": 15685,
Expand Down Expand Up @@ -34,16 +34,16 @@
"gzip": 28991
},
"react.development.js (NODE_DEV)": {
"size": 69636,
"gzip": 17533
"size": 69612,
"gzip": 17522
},
"react.production.min.js (NODE_PROD)": {
"size": 9226,
"gzip": 3623
},
"React-dev.js (FB_DEV)": {
"size": 71493,
"gzip": 18168
"size": 71469,
"gzip": 18157
},
"React-prod.js (FB_PROD)": {
"size": 36701,
Expand Down
6 changes: 3 additions & 3 deletions src/isomorphic/React.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ var cloneElement = ReactElement.cloneElement;
if (__DEV__) {
var warning = require('fbjs/lib/warning');
var canDefineProperty = require('canDefineProperty');
var didWarnPropTypesDeprecated = false;
var ReactElementValidator = require('ReactElementValidator');
createElement = ReactElementValidator.createElement;
createFactory = ReactElementValidator.createFactory;
Expand Down Expand Up @@ -87,6 +86,7 @@ if (__DEV__) {

let warnedForCreateMixin = false;
let warnedForCreateClass = false;
let warnedForPropTypes = false;

React.createMixin = function(mixin) {
warning(
Expand Down Expand Up @@ -117,11 +117,11 @@ if (__DEV__) {
Object.defineProperty(React, 'PropTypes', {
get() {
warning(
didWarnPropTypesDeprecated,
warnedForPropTypes,
'PropTypes have moved out of the react package. ' +
'Use the prop-types package from npm instead.',
);
didWarnPropTypesDeprecated = true;
warnedForPropTypes = true;
return ReactPropTypes;
},
});
Expand Down

0 comments on commit d34109a

Please sign in to comment.