Skip to content

Commit

Permalink
Use prop-types instead of prop-types factory (#9526)
Browse files Browse the repository at this point in the history
Latest versions of prop-types don't depend on React, so the factory is
not necessary, and in fact bloats the build because it is intended for
15.5 and so doesn't strip out the checkers in prod.
  • Loading branch information
acdlite committed Apr 25, 2017
1 parent 09a9c64 commit 8ba820a
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 117 deletions.
20 changes: 10 additions & 10 deletions scripts/fiber/tests-passing.txt
Expand Up @@ -212,11 +212,11 @@ src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js
* should not warn for valid values
* should be implicitly optional and not warn without values
* should warn for missing required values
* should warn if called manually in development
* should throw if called manually in development
* should should accept any value
* should be implicitly optional and not warn without values
* should warn for missing required values
* should warn if called manually in development
* should throw if called manually in development
* should fail for invalid argument
* should support the arrayOf propTypes
* should support arrayOf with complex types
Expand All @@ -226,27 +226,27 @@ src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js
* should not warn when passing an empty array
* should be implicitly optional and not warn without values
* should warn for missing required values
* should warn if called manually in development
* should throw if called manually in development
* should support components
* should not support multiple components or scalar values
* should be able to define a single child as label
* should warn when passing no label and isRequired is set
* should be implicitly optional and not warn without values
* should warn for missing required values
* should warn if called manually in development
* should throw if called manually in development
* should warn for invalid instances
* should not warn for valid values
* should be implicitly optional and not warn without values
* should warn for missing required values
* should warn if called manually in development
* should throw if called manually in development
* should warn for invalid values
* should not warn for valid values
* should not warn for iterables
* should not warn for entry iterables
* should not warn for null/undefined if not required
* should warn for missing required values
* should accept empty array for required props
* should warn if called manually in development
* should throw if called manually in development
* should fail for invalid argument
* should support the objectOf propTypes
* should support objectOf with complex types
Expand All @@ -256,19 +256,19 @@ src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js
* should not warn when passing an empty object
* should be implicitly optional and not warn without values
* should warn for missing required values
* should warn if called manually in development
* should throw if called manually in development
* should warn but not error for invalid argument
* should warn for invalid values
* should not warn for valid values
* should be implicitly optional and not warn without values
* should warn for missing required values
* should warn if called manually in development
* should throw if called manually in development
* should warn but not error for invalid argument
* should warn if none of the types are valid
* should not warn if one of the types are valid
* should be implicitly optional and not warn without values
* should warn for missing required values
* should warn if called manually in development
* should throw if called manually in development
* should warn for non objects
* should not warn for empty values
* should not warn for an empty object
Expand All @@ -279,7 +279,7 @@ src/isomorphic/classic/types/__tests__/ReactPropTypes-test.js
* should warn for invalid key types
* should be implicitly optional and not warn without values
* should warn for missing required values
* should warn if called manually in development
* should throw if called manually in development
* should warn for non-symbol
* should not warn for a polyfilled Symbol
* should have been called with the right params
Expand Down
1 change: 0 additions & 1 deletion scripts/rollup/bundles.js
Expand Up @@ -49,7 +49,6 @@ const bundles = [
'create-react-class/factory',
'prop-types',
'prop-types/checkPropTypes',
'prop-types/factory',
],
fbEntry: 'src/fb/ReactFBEntry.js',
hasteName: 'React',
Expand Down
1 change: 0 additions & 1 deletion scripts/rollup/modules.js
Expand Up @@ -57,7 +57,6 @@ const legacyModules = [
'create-react-class/factory',
'prop-types',
'prop-types/checkPropTypes',
'prop-types/factory',
];

// this function builds up a very niave Haste-like moduleMap
Expand Down
5 changes: 1 addition & 4 deletions src/isomorphic/classic/types/ReactPropTypes.js
Expand Up @@ -11,7 +11,4 @@

'use strict';

var {isValidElement} = require('ReactElement');
var factory = require('prop-types/factory');

module.exports = factory(isValidElement);
module.exports = require('prop-types');

0 comments on commit 8ba820a

Please sign in to comment.