diff --git a/.babelrc b/.babelrc index 0578679..554d2ac 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,10 @@ { - "presets": ["react", "es2015"] + "presets": ["react"], + "plugins": [ + ["transform-es2015-modules-commonjs", { "loose": true }], + "transform-es2015-block-scoping", + "transform-es2015-function-name", + "transform-es3-property-literals", + "check-es2015-constants" + ] } diff --git a/CHANGELOG.md b/CHANGELOG.md index 6733e86..8bd91c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.6.2 - Apr 23 2016 + +* Configure Babel transforms so the bundled output works in IE8. Thanks [@SimenB](https://github.com/SimenB)! + ## v0.6.1 - Apr 8 2016 * Allow React 15.x as a peer dependency diff --git a/package.json b/package.json index 395ee5b..c3dd6dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-spin", - "version": "0.6.1", + "version": "0.6.2", "description": "A React component wrapper for spin.js", "main": "lib/main.js", "scripts": { @@ -19,7 +19,11 @@ "babel-cli": "^6.6.0", "babel-eslint": "^5.0.0", "babel-loader": "^6.2.4", - "babel-preset-es2015": "^6.6.0", + "babel-plugin-check-es2015-constants": "^6.7.2", + "babel-plugin-transform-es2015-block-scoping": "^6.7.1", + "babel-plugin-transform-es2015-function-name": "^6.5.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.7.0", + "babel-plugin-transform-es3-property-literals": "^6.5.0", "babel-preset-react": "^6.5.0", "eslint": "^1.10.3", "eslint-plugin-react": "^4.1.0", @@ -38,6 +42,8 @@ "webpack": "^1.12.14" }, "dependencies": { + "create-react-class": "^15.5.3", + "prop-types": "^15.5.10", "spin.js": "^2.0.1" }, "peerDependencies": { diff --git a/src/main.js b/src/main.js index 5bca4ac..173bc9d 100644 --- a/src/main.js +++ b/src/main.js @@ -1,10 +1,12 @@ import React from 'react'; +import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; import Spinner from 'spin.js'; -const ReactSpinner = React.createClass({ +const ReactSpinner = createReactClass({ propTypes: { - config: React.PropTypes.object, - stopped: React.PropTypes.bool + config: PropTypes.object, + stopped: PropTypes.bool }, componentDidMount: function() {