Addressed Ben's PR feedback:

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
This commit is contained in:
Brian Vaughn
2017-04-11 11:12:39 -07:00
parent cf49cfd9b4
commit d34109a2be
6 changed files with 18 additions and 16 deletions
+2 -4
View File
@@ -43,6 +43,7 @@
"coffee-script": "^1.8.0", "coffee-script": "^1.8.0",
"core-js": "^2.2.1", "core-js": "^2.2.1",
"coveralls": "^2.11.6", "coveralls": "^2.11.6",
"create-react-class": "^15.5.2",
"del": "^2.0.2", "del": "^2.0.2",
"derequire": "^2.0.3", "derequire": "^2.0.3",
"escape-string-regexp": "^1.0.5", "escape-string-regexp": "^1.0.5",
@@ -72,6 +73,7 @@
"object-assign": "^4.1.1", "object-assign": "^4.1.1",
"platform": "^1.1.0", "platform": "^1.1.0",
"prettier": "^0.22.0", "prettier": "^0.22.0",
"prop-types": "^15.5.6",
"rimraf": "^2.6.1", "rimraf": "^2.6.1",
"rollup": "^0.41.6", "rollup": "^0.41.6",
"rollup-plugin-alias": "^1.2.1", "rollup-plugin-alias": "^1.2.1",
@@ -93,10 +95,6 @@
"node": "4.x || 5.x || 6.x || 7.x", "node": "4.x || 5.x || 6.x || 7.x",
"npm": "2.x || 3.x || 4.x" "npm": "2.x || 3.x || 4.x"
}, },
"dependencies": {
"create-react-class": "^15.5.2",
"prop-types": "^15.5.6"
},
"commonerConfig": { "commonerConfig": {
"version": 7 "version": 7
}, },
+2 -1
View File
@@ -15,7 +15,8 @@
"dependencies": { "dependencies": {
"fbjs": "^0.8.9", "fbjs": "^0.8.9",
"loose-envify": "^1.1.0", "loose-envify": "^1.1.0",
"object-assign": "^4.1.0" "object-assign": "^4.1.0",
"prop-types": "^15.5.6"
}, },
"peerDependencies": { "peerDependencies": {
"react": "^16.0.0-alpha.8" "react": "^16.0.0-alpha.8"
+3 -1
View File
@@ -22,9 +22,11 @@
"node": ">=0.10.0" "node": ">=0.10.0"
}, },
"dependencies": { "dependencies": {
"create-react-class": "^15.5.2",
"fbjs": "^0.8.9", "fbjs": "^0.8.9",
"loose-envify": "^1.1.0", "loose-envify": "^1.1.0",
"object-assign": "^4.1.0" "object-assign": "^4.1.0",
"prop-types": "^15.5.6"
}, },
"browserify": { "browserify": {
"transform": [ "transform": [
+2 -1
View File
@@ -54,7 +54,8 @@ const devOnlyFilesToStubOut = [
// Ordering of these imports is important; // Ordering of these imports is important;
// The default import must follow deep imports or Rollup breaks. // 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 = { const legacyModules = {
'create-react-class/factory': 'create-react-class/factory.js', 'create-react-class/factory': 'create-react-class/factory.js',
'create-react-class': 'create-react-class/index.js', 'create-react-class': 'create-react-class/index.js',
+6 -6
View File
@@ -2,8 +2,8 @@
"branch": "prop-types", "branch": "prop-types",
"bundleSizes": { "bundleSizes": {
"react.development.js (UMD_DEV)": { "react.development.js (UMD_DEV)": {
"size": 120940, "size": 120916,
"gzip": 30496 "gzip": 30481
}, },
"react.production.min.js (UMD_PROD)": { "react.production.min.js (UMD_PROD)": {
"size": 15685, "size": 15685,
@@ -34,16 +34,16 @@
"gzip": 28991 "gzip": 28991
}, },
"react.development.js (NODE_DEV)": { "react.development.js (NODE_DEV)": {
"size": 69636, "size": 69612,
"gzip": 17533 "gzip": 17522
}, },
"react.production.min.js (NODE_PROD)": { "react.production.min.js (NODE_PROD)": {
"size": 9226, "size": 9226,
"gzip": 3623 "gzip": 3623
}, },
"React-dev.js (FB_DEV)": { "React-dev.js (FB_DEV)": {
"size": 71493, "size": 71469,
"gzip": 18168 "gzip": 18157
}, },
"React-prod.js (FB_PROD)": { "React-prod.js (FB_PROD)": {
"size": 36701, "size": 36701,
+3 -3
View File
@@ -29,7 +29,6 @@ var cloneElement = ReactElement.cloneElement;
if (__DEV__) { if (__DEV__) {
var warning = require('fbjs/lib/warning'); var warning = require('fbjs/lib/warning');
var canDefineProperty = require('canDefineProperty'); var canDefineProperty = require('canDefineProperty');
var didWarnPropTypesDeprecated = false;
var ReactElementValidator = require('ReactElementValidator'); var ReactElementValidator = require('ReactElementValidator');
createElement = ReactElementValidator.createElement; createElement = ReactElementValidator.createElement;
createFactory = ReactElementValidator.createFactory; createFactory = ReactElementValidator.createFactory;
@@ -87,6 +86,7 @@ if (__DEV__) {
let warnedForCreateMixin = false; let warnedForCreateMixin = false;
let warnedForCreateClass = false; let warnedForCreateClass = false;
let warnedForPropTypes = false;
React.createMixin = function(mixin) { React.createMixin = function(mixin) {
warning( warning(
@@ -117,11 +117,11 @@ if (__DEV__) {
Object.defineProperty(React, 'PropTypes', { Object.defineProperty(React, 'PropTypes', {
get() { get() {
warning( warning(
didWarnPropTypesDeprecated, warnedForPropTypes,
'PropTypes have moved out of the react package. ' + 'PropTypes have moved out of the react package. ' +
'Use the prop-types package from npm instead.', 'Use the prop-types package from npm instead.',
); );
didWarnPropTypesDeprecated = true; warnedForPropTypes = true;
return ReactPropTypes; return ReactPropTypes;
}, },
}); });