Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Task use prop types #898

Merged
merged 3 commits into from
May 5, 2017
Merged

Task use prop types #898

merged 3 commits into from
May 5, 2017

Conversation

stefvhuynh
Copy link
Contributor

@stefvhuynh stefvhuynh commented Apr 28, 2017

Addresses #895

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 96.236% when pulling fec7150 on task-usePropTypes into e69986a on master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 96.236% when pulling fec7150 on task-usePropTypes into e69986a on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 96.236% when pulling fec7150 on task-usePropTypes into e69986a on master.

@stefvhuynh stefvhuynh requested a review from mhink April 28, 2017 01:25
@voxmatt
Copy link

voxmatt commented May 5, 2017

@mhink would be great to get a review of this

@mhink
Copy link
Contributor

mhink commented May 5, 2017

Looks good to me. I double-checked with @stefvhuynh offline that there aren't any versioning problems related to using [email protected] with [email protected] (there are no problems), grepped through the source tree for any files still using PropTypes from react (there are none) and ran yarn examples to check for any warnings (there are none).

Hence, approved.

@voxmatt
Copy link

voxmatt commented May 5, 2017

Sorry to be a pest, just really eager to suppress all these warnings (especially in tests): could someone please cut a new release for this when possible. Thanks so much!

@kylecesmat kylecesmat deleted the task-usePropTypes branch May 5, 2017 21:48
@MichaelDeBoey
Copy link

@mhink Any idea when this will be released?

@mhink
Copy link
Contributor

mhink commented May 10, 2017

@ianobermiller would probably know more than me on this one.

@MichaelDeBoey
Copy link

@ianobermiller Any idea when this will be released? 🙂

@ianobermiller
Copy link
Contributor

Sorry, I'm no longer actively maintaining Radium. cc @ryan-roemer

@noahpresler
Copy link

Would also very much like to see this released. @ryan-roemer, thank you!

@ryan-roemer
Copy link
Member

Roger. We're on it. Will aim to get this published tomorrow.

/cc @mhink @stefvhuynh

@ryan-roemer
Copy link
Member

Released in [email protected]

Thanks @mhink and @stefvhuynh !

@MichaelDeBoey
Copy link

@ryan-roemer package.json is still on 0.18.2

@ryan-roemer
Copy link
Member

The published version package.json is correct: https://unpkg.com/[email protected]/package.json

I suspect we have an unpushed release git + tag.

Here's the registry diff (created using publish-diff -o [email protected] -n [email protected]):

Index: CHANGELOG.md
===================================================================
--- CHANGELOG.md  [email protected]
+++ CHANGELOG.md  [email protected]
@@ -1,6 +1,11 @@
 # Radium Changelog
 
+## 0.18.3 (May 15, 2017)
+- Update dependencies
+- Update deprecated React syntax in examples
+- Use React "prop-types" package
+
 ## 0.18.2 (March 15, 2017)
 
 ### Improvements
 - Update `inline-style-prefixer` to v2.0.5 (#880).

Index: README.md
===================================================================
--- README.md [email protected]
+++ README.md [email protected]
@@ -64,9 +64,9 @@
 
 @Radium
 class Button extends React.Component {
   static propTypes = {
-    kind: React.PropTypes.oneOf(['primary', 'warning']).isRequired
+    kind: PropTypes.oneOf(['primary', 'warning']).isRequired
   };
 
   render() {
     // Radium extends the style attribute to accept an array. It will merge

Index: dist/radium.js
===================================================================
--- dist/radium.js  [email protected]
+++ dist/radium.js  [email protected]
SNIPPED

Index: dist/radium.min.js
===================================================================
--- dist/radium.min.js  [email protected]
+++ dist/radium.min.js  [email protected]
SNIPPED

Index: docs/comparison/README.md
===================================================================
--- docs/comparison/README.md [email protected]
+++ docs/comparison/README.md [email protected]
SNIPPED

Index: docs/faq/README.md
===================================================================
--- docs/faq/README.md  [email protected]
+++ docs/faq/README.md  [email protected]
@@ -109,9 +109,9 @@
 
 @Radium
 class Button extends React.Component {
   static propTypes = {
-    kind: React.PropTypes.oneOf(['primary', 'warning']).isRequired
+    kind: PropTypes.oneOf(['primary', 'warning']).isRequired
   }
 
   render() {
     return (

Index: lib/components/style-root.js
===================================================================
--- lib/components/style-root.js  [email protected]
+++ lib/components/style-root.js  [email protected]
@@ -7,8 +7,12 @@
 var _react = require('react');
 
 var _react2 = _interopRequireDefault(_react);
 
+var _propTypes = require('prop-types');
+
+var _propTypes2 = _interopRequireDefault(_propTypes);
+
 var _enhancer = require('../enhancer');
 
 var _enhancer2 = _interopRequireDefault(_enhancer);
 
@@ -74,14 +78,14 @@
   return StyleRoot;
 }(_react.PureComponent);
 
 StyleRoot.contextTypes = {
-  _radiumConfig: _react.PropTypes.object,
-  _radiumStyleKeeper: _react.PropTypes.instanceOf(_styleKeeper2.default)
+  _radiumConfig: _propTypes2.default.object,
+  _radiumStyleKeeper: _propTypes2.default.instanceOf(_styleKeeper2.default)
 };
 
 StyleRoot.childContextTypes = {
-  _radiumStyleKeeper: _react.PropTypes.instanceOf(_styleKeeper2.default)
+  _radiumStyleKeeper: _propTypes2.default.instanceOf(_styleKeeper2.default)
 };
 
 StyleRoot = (0, _enhancer2.default)(StyleRoot);
 

Index: lib/components/style-sheet.js
===================================================================
--- lib/components/style-sheet.js [email protected]
+++ lib/components/style-sheet.js [email protected]
@@ -10,8 +10,12 @@
 var _react = require('react');
 
 var _react2 = _interopRequireDefault(_react);
 
+var _propTypes = require('prop-types');
+
+var _propTypes2 = _interopRequireDefault(_propTypes);
+
 var _styleKeeper = require('../style-keeper');
 
 var _styleKeeper2 = _interopRequireDefault(_styleKeeper);
 
@@ -63,8 +67,8 @@
   };
 
   return StyleSheet;
 }(_react.PureComponent), _class.contextTypes = {
-  _radiumStyleKeeper: _react2.default.PropTypes.instanceOf(_styleKeeper2.default)
+  _radiumStyleKeeper: _propTypes2.default.instanceOf(_styleKeeper2.default)
 }, _temp);
 exports.default = StyleSheet;
 module.exports = exports['default'];
\ No newline at end of file

Index: lib/components/style.js
===================================================================
--- lib/components/style.js [email protected]
+++ lib/components/style.js [email protected]
@@ -15,8 +15,12 @@
 var _react = require('react');
 
 var _react2 = _interopRequireDefault(_react);
 
+var _propTypes = require('prop-types');
+
+var _propTypes2 = _interopRequireDefault(_propTypes);
+
 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 
 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
 
@@ -89,13 +93,13 @@
   };
 
   return Style;
 }(_react.PureComponent), _class.propTypes = {
-  radiumConfig: _react.PropTypes.object,
-  rules: _react.PropTypes.object,
-  scopeSelector: _react.PropTypes.string
+  radiumConfig: _propTypes2.default.object,
+  rules: _propTypes2.default.object,
+  scopeSelector: _propTypes2.default.string
 }, _class.contextTypes = {
-  _radiumConfig: _react.PropTypes.object
+  _radiumConfig: _propTypes2.default.object
 }, _class.defaultProps = {
   scopeSelector: ''
 }, _temp);
 exports.default = Style;

Index: lib/enhancer.js
===================================================================
--- lib/enhancer.js [email protected]
+++ lib/enhancer.js [email protected]
@@ -9,8 +9,12 @@
 exports.default = enhanceWithRadium;
 
 var _react = require('react');
 
+var _propTypes = require('prop-types');
+
+var _propTypes2 = _interopRequireDefault(_propTypes);
+
 var _styleKeeper = require('./style-keeper.js');
 
 var _styleKeeper2 = _interopRequireDefault(_styleKeeper);
 
@@ -153,22 +157,22 @@
   }
 
   if (RadiumEnhancer.propTypes && RadiumEnhancer.propTypes.style) {
     RadiumEnhancer.propTypes = _extends({}, RadiumEnhancer.propTypes, {
-      style: _react.PropTypes.oneOfType([_react.PropTypes.array, _react.PropTypes.object])
+      style: _propTypes2.default.oneOfType([_propTypes2.default.array, _propTypes2.default.object])
     });
   }
 
   RadiumEnhancer.displayName = component.displayName || component.name || 'Component';
 
   RadiumEnhancer.contextTypes = _extends({}, RadiumEnhancer.contextTypes, {
-    _radiumConfig: _react.PropTypes.object,
-    _radiumStyleKeeper: _react.PropTypes.instanceOf(_styleKeeper2.default)
+    _radiumConfig: _propTypes2.default.object,
+    _radiumStyleKeeper: _propTypes2.default.instanceOf(_styleKeeper2.default)
   });
 
   RadiumEnhancer.childContextTypes = _extends({}, RadiumEnhancer.childContextTypes, {
-    _radiumConfig: _react.PropTypes.object,
-    _radiumStyleKeeper: _react.PropTypes.instanceOf(_styleKeeper2.default)
+    _radiumConfig: _propTypes2.default.object,
+    _radiumStyleKeeper: _propTypes2.default.instanceOf(_styleKeeper2.default)
   });
 
   return RadiumEnhancer;
 }

Index: package.json
===================================================================
--- package.json  [email protected]
+++ package.json  [email protected]
@@ -1,7 +1,7 @@
 {
   "name": "radium",
-  "version": "0.18.2",
+  "version": "0.18.3",
   "description": "A set of tools to manage inline styles on React elements",
   "main": "lib/index.js",
   "repository": {
     "type": "git",
@@ -39,8 +39,12 @@
     "exenv": "^1.2.1",
     "inline-style-prefixer": "^2.0.5",
     "rimraf": "^2.6.1"
   },
+  "peerDependencies": {
+    "prop-types": "^15.5.8",
+    "react": "^15.3.0"
+  },
   "devDependencies": {
     "babel-eslint": "^7.1.1",
     "babel-loader": "^6.4.0",
     "chai": "^3.5.0",
@@ -73,12 +77,13 @@
     "nodemon": "^1.11.0",
     "object-assign": "^4.1.1",
     "phantomjs-prebuilt": "^2.1.14",
     "prettier": "^0.22.0",
+    "prop-types": "^15.5.8",
     "react": "^15.4.2",
     "react-addons-test-utils": "^15.4.2",
     "react-dom": "^15.4.2",
-    "sinon": "^2.0.0",
+    "sinon": "^1.17.7",
     "sinon-chai": "^2.8.0",
     "webpack": "^2.2.1",
     "webpack-dev-server": "^2.4.2",
     "babel-cli": "^6.24.0",

Index: src/__tests__/radium-test.js
===================================================================
--- src/__tests__/radium-test.js  [email protected]
+++ src/__tests__/radium-test.js  [email protected]
@@ -1,9 +1,10 @@
 /* eslint-disable react/prop-types */
 
 import Radium from 'index.js';
 import MouseUpListener from 'plugins/mouse-up-listener.js';
-import React, {Component, PropTypes} from 'react';
+import React, {Component} from 'react';
+import PropTypes from 'prop-types';
 import ReactDOM from 'react-dom';
 import TestUtils from 'react-addons-test-utils';
 import {getRenderOutput, getElement} from 'test-helpers';
 

Index: src/components/style-root.js
===================================================================
--- src/components/style-root.js  [email protected]
+++ src/components/style-root.js  [email protected]
@@ -1,7 +1,8 @@
 /* @flow */
 
-import React, {PureComponent, PropTypes} from 'react';
+import React, {PureComponent} from 'react';
+import PropTypes from 'prop-types';
 
 import Enhancer from '../enhancer';
 import StyleKeeper from '../style-keeper';
 import StyleSheet from './style-sheet';

Index: src/components/style-sheet.js
===================================================================
--- src/components/style-sheet.js [email protected]
+++ src/components/style-sheet.js [email protected]
@@ -1,13 +1,14 @@
 /* @flow */
 
 import React, {PureComponent} from 'react';
+import PropTypes from 'prop-types';
 
 import StyleKeeper from '../style-keeper';
 
 export default class StyleSheet extends PureComponent {
   static contextTypes = {
-    _radiumStyleKeeper: React.PropTypes.instanceOf(StyleKeeper),
+    _radiumStyleKeeper: PropTypes.instanceOf(StyleKeeper),
   };
 
   constructor() {
     super(...arguments);

Index: src/components/style.js
===================================================================
--- src/components/style.js [email protected]
+++ src/components/style.js [email protected]
@@ -1,9 +1,10 @@
 /* @flow */
 
 import cssRuleSetToString from '../css-rule-set-to-string';
 
-import React, {PropTypes, PureComponent} from 'react';
+import React, {PureComponent} from 'react';
+import PropTypes from 'prop-types';
 
 class Style extends PureComponent {
   static propTypes = {
     radiumConfig: PropTypes.object,

Index: src/enhancer.js
===================================================================
--- src/enhancer.js [email protected]
+++ src/enhancer.js [email protected]
@@ -1,7 +1,8 @@
 /* @flow */
 
-import {Component, PropTypes} from 'react';
+import {Component} from 'react';
+import PropTypes from 'prop-types';
 
 import StyleKeeper from './style-keeper.js';
 import resolveStyles from './resolve-styles.js';

@danmactough
Copy link

This broke all of our builds that did not already have prop-types as a dependency.

@ryan-roemer
Copy link
Member

Ugh. Sorry, yeah in retrospect I think we should have major versioned this. Also hey @danmactough !!!

@alexlande @mhink -- One corrective action we could take is:

  1. Minor version 0.18.4 with a revert to effectively 0.18.2
  2. Cut a new 0.19.0 with effectively master

Thoughts?

@danmactough
Copy link

👋

@danmactough
Copy link

@ryan-roemer maybe deprecate 0.18.3 and publish 0.18.2 as 0.18.4 immediately?

@ryan-roemer
Copy link
Member

@danmactough -- Yep, we're doing a rollback for 0.18.4 and new 0.19.0

mhink pushed a commit that referenced this pull request May 17, 2017
mhink pushed a commit that referenced this pull request May 17, 2017
@ryan-roemer
Copy link
Member

Alrighty, v0.18.4 is the revert, and v0.19.0 takes us forward!!!

@danmactough
Copy link

thanks for the quick response @ryan-roemer & @mhink ✌️

@MichaelDeBoey
Copy link

@ryan-roemer Why is prop-types a peerDepencency?
I think prop-types should be a regular dependency
If someone's using React without the prop-types package, they would have it as a dependency just for this package, which is cluttering their package.json

@ryan-roemer
Copy link
Member

@MichaelDeBoey -- moved to dependencies in [email protected]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants