mirror of
https://github.com/facebook/react.git
synced 2026-02-25 05:03:03 +00:00
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:
@@ -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",
|
||||
@@ -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",
|
||||
@@ -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
|
||||
},
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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": [
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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,
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
@@ -87,6 +86,7 @@ if (__DEV__) {
|
||||
|
||||
let warnedForCreateMixin = false;
|
||||
let warnedForCreateClass = false;
|
||||
let warnedForPropTypes = false;
|
||||
|
||||
React.createMixin = function(mixin) {
|
||||
warning(
|
||||
@@ -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;
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user