Skip to content

Commit 2a0d357

Browse files
committed
Update everything to React 15.1
1 parent ac2784a commit 2a0d357

File tree

10 files changed

+85
-82
lines changed

10 files changed

+85
-82
lines changed

.eslintrc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
},
1010
"parser": "babel-eslint",
1111
"plugins": [
12-
"react",
13-
"babel"
12+
"react"
1413
],
1514
"rules": {
1615
"constructor-super": 2,
@@ -22,7 +21,6 @@
2221
"no-underscore-dangle": 0,
2322
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
2423
"no-var": 2,
25-
"babel/object-shorthand": 2,
2624
"quotes": [2, "single", "avoid-escape"],
2725
"react/display-name": 0,
2826
"react/jsx-boolean-value": [2, "never"],

examples/App.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
2-
import { findDOMNode } from 'react-dom';
2+
import ReactDOM, { findDOMNode } from 'react-dom';
33
import Button from 'react-bootstrap/lib/Button';
4-
import Editor from '@jquense/component-playground';
4+
import Playground from '@monastic.panic/component-playground';
55

66
import PropTable from './PropTable';
77

@@ -27,7 +27,7 @@ import './styles.less';
2727
import injectCss from './injectCss';
2828

2929
let scope = {
30-
React, findDOMNode, Button, injectCss, ...ReactOverlays, getOffset
30+
React, ReactDOM, findDOMNode, Button, injectCss, ...ReactOverlays, getOffset
3131
};
3232

3333
const Anchor = React.createClass({
@@ -52,14 +52,17 @@ const ExampleEditor = React.createClass({
5252
},
5353
render() {
5454
return (
55-
<Editor
55+
<Playground
5656
className='overlay-example'
5757
lineNumbers={false}
5858
lang="js"
5959
theme="neo"
6060
scope={scope}
6161
codeText={this.props.codeText}
6262
collapsableCode
63+
babelConfig={{
64+
presets: ['es2015-loose', 'react', 'stage-0']
65+
}}
6366
/>
6467
);
6568
}
@@ -159,4 +162,4 @@ const Example = React.createClass({
159162
}
160163
});
161164

162-
React.render(<Example/>, document.getElementById('app-container'));
165+
ReactDOM.render(<Example/>, document.getElementById('app-container'));

examples/PropTable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import merge from 'lodash/object/merge';
1+
import merge from 'lodash/merge';
22
import React from 'react';
33

44
import Label from 'react-bootstrap/lib/Label';

examples/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ let config = require('../webpack/examples.config');
44

55
new WebpackDevServer(webpack(config), {
66

7+
contentBase: 'examples',
78
publicPath: '/static/',
89
hot: true,
9-
historyApiFallback: true,
1010
quiet: false,
1111
progress: true,
1212
stats: {

package.json

Lines changed: 52 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"license": "MIT",
88
"main": "lib/index.js",
99
"files": [
10-
"lib/",
11-
"CHANGELOG.md"
10+
"lib"
1211
],
1312
"keywords": [
1413
"react-overlays",
@@ -28,71 +27,71 @@
2827
"build:examples": "npm run clean:examples && babel-node ./webpack/run-webpack --config docs.config.js",
2928
"examples": "npm run clean:examples && babel-node ./examples/server.js",
3029
"lint": "eslint src test",
31-
"test": "npm run lint && karma start --single-run",
30+
"test": "npm run lint && npm run testonly",
31+
"testonly": "karma start --single-run",
3232
"tdd": "karma start",
33-
"coverage": "COVERAGE=true karma start --single-run",
33+
"coverage": "COVERAGE=true npm run testonly",
3434
"release": "release"
3535
},
3636
"peerDependencies": {
3737
"react": ">=0.14.0",
3838
"react-dom": ">=0.14.0"
3939
},
4040
"devDependencies": {
41-
"@jquense/component-playground": "jquense/component-playground",
42-
"babel": "5.6.14",
43-
"babel-core": "^5.8.34",
44-
"babel-eslint": "^4.1.6",
45-
"babel-loader": "^5.3.0",
41+
"@monastic.panic/component-playground": "jquense/component-playground",
42+
"babel": "^5.8.38",
43+
"babel-core": "^5.8.38",
44+
"babel-eslint": "^6.1.0",
45+
"babel-loader": "^5.4.0",
4646
"babel-plugin-object-assign": "^1.2.1",
47-
"chai": "^3.2.0",
48-
"component-metadata-loader": "^2.0.0",
49-
"css-loader": "^0.15.6",
50-
"es5-shim": "^4.1.7",
51-
"eslint": "^1.10.1",
52-
"eslint-plugin-babel": "^3.0.0",
53-
"eslint-plugin-mocha": "^1.1.0",
54-
"eslint-plugin-react": "^3.1.0",
55-
"isparta-loader": "^0.2.0",
56-
"jquery": "^2.1.4",
57-
"karma": "^0.13.3",
58-
"karma-chrome-launcher": "^0.2.0",
59-
"karma-cli": "^0.1.0",
60-
"karma-coverage": "^0.4.2",
61-
"karma-coveralls": "^1.1.0",
62-
"karma-mocha": "^0.2.0",
63-
"karma-mocha-reporter": "^1.0.4",
64-
"karma-sinon-chai": "^1.0.0",
65-
"karma-sourcemap-loader": "^0.3.5",
47+
"chai": "^3.5.0",
48+
"component-metadata-loader": "^2.0.3",
49+
"css-loader": "^0.23.1",
50+
"es5-shim": "^4.5.9",
51+
"eslint": "^3.0.1",
52+
"eslint-plugin-mocha": "^4.0.0",
53+
"eslint-plugin-react": "^5.2.2",
54+
"isparta-loader": "^1.0.0",
55+
"jquery": "^3.1.0",
56+
"karma": "^1.1.1",
57+
"karma-chrome-launcher": "^1.0.1",
58+
"karma-cli": "^1.0.1",
59+
"karma-coverage": "^1.1.0",
60+
"karma-coveralls": "^1.1.2",
61+
"karma-mocha": "^1.1.1",
62+
"karma-mocha-reporter": "^2.0.4",
63+
"karma-sinon-chai": "^1.2.2",
64+
"karma-sourcemap-loader": "^0.3.7",
6665
"karma-webpack": "^1.7.0",
67-
"less": "^2.5.1",
68-
"less-loader": "^2.2.0",
69-
"lodash": "^3.10.0",
70-
"lolex": "^1.4.0",
66+
"less": "^2.7.1",
67+
"less-loader": "^2.2.3",
68+
"lodash": "^4.13.1",
69+
"lolex": "^1.5.0",
7170
"marked": "^0.3.5",
72-
"mocha": "^2.2.5",
73-
"node-libs-browser": "^0.5.2",
71+
"mocha": "^2.5.3",
72+
"node-libs-browser": "^1.0.0",
7473
"raw-loader": "^0.5.1",
75-
"react": "^0.14.0",
76-
"react-addons-test-utils": "^0.14.0",
77-
"react-bootstrap": "^0.27.3",
78-
"react-component-metadata": "^1.2.2",
79-
"react-dom": "^0.14.0",
80-
"react-hot-loader": "^1.2.7",
81-
"release-script": "^0.2.1",
82-
"rimraf": "^2.4.2",
83-
"simulant": "^0.1.5",
84-
"sinon": "^1.15.4",
74+
"react": "~15.1.0",
75+
"react-addons-test-utils": "~15.1.0",
76+
"react-bootstrap": "^0.29.5",
77+
"react-component-metadata": "^2.1.1",
78+
"react-dom": "~15.1.0",
79+
"react-hot-loader": "^1.3.0",
80+
"release-script": "^1.0.2",
81+
"rimraf": "^2.5.3",
82+
"simulant": "^0.2.2",
83+
"sinon": "^1.17.4",
8584
"sinon-chai": "^2.8.0",
86-
"style-loader": "^0.12.3",
87-
"teaspoon": "^6.1.1",
88-
"webpack": "^1.12.2",
89-
"webpack-dev-server": "^1.12.0",
90-
"yargs": "^3.14.0"
85+
"style-loader": "^0.13.1",
86+
"teaspoon": "^6.4.1",
87+
"webpack": "^1.13.1",
88+
"webpack-dev-server": "^1.14.1",
89+
"yargs": "^4.7.1"
9190
},
9291
"dependencies": {
93-
"classnames": "^2.1.3",
94-
"dom-helpers": "^2.3.0",
95-
"react-prop-types": "^0.2.1",
96-
"warning": "^2.1.0"
92+
"classnames": "^2.2.5",
93+
"dom-helpers": "^2.4.0",
94+
"react-prop-types": "^0.3.2",
95+
"warning": "^3.0.0"
9796
}
9897
}

src/AutoAffix.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,11 @@ class AutoAffix extends React.Component {
116116
}
117117

118118
render() {
119-
const {container, autoWidth, viewportOffsetTop, children, ...props} =
120-
this.props;
119+
const {autoWidth, viewportOffsetTop, children, ...props} = this.props;
121120
const {offsetTop, offsetBottom, width} = this.state;
122121

122+
delete props.container;
123+
123124
const effectiveOffsetTop = Math.max(offsetTop, viewportOffsetTop || 0);
124125

125126
let {affixStyle, bottomStyle} = this.props;

src/Modal.js

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -199,26 +199,30 @@ const Modal = React.createClass({
199199
},
200200

201201
render() {
202-
let {
202+
const {
203+
show,
204+
container,
203205
children,
204206
transition: Transition,
205207
backdrop,
206208
dialogTransitionTimeout,
207-
...props } = this.props;
208-
209-
let { onExit, onExiting, onEnter, onEntering, onEntered } = props;
210-
211-
let show = !!props.show;
212-
let dialog = React.Children.only(this.props.children);
209+
className,
210+
style,
211+
onExit,
212+
onExiting,
213+
onEnter,
214+
onEntering,
215+
onEntered,
216+
} = this.props;
213217

218+
let dialog = React.Children.only(children);
214219

215220
const mountModal = show || (Transition && !this.state.exited);
216-
217221
if (!mountModal) {
218222
return null;
219223
}
220224

221-
let { role, tabIndex } = dialog.props;
225+
const { role, tabIndex } = dialog.props;
222226

223227
if (role === undefined || tabIndex === undefined) {
224228
dialog = cloneElement(dialog, {
@@ -249,13 +253,13 @@ const Modal = React.createClass({
249253
return (
250254
<Portal
251255
ref={this.setMountNode}
252-
container={props.container}
256+
container={container}
253257
>
254258
<div
255259
ref={'modal'}
256-
role={props.role || 'dialog'}
257-
style={props.style}
258-
className={props.className}
260+
role={role || 'dialog'}
261+
style={style}
262+
className={className}
259263
>
260264
{ backdrop && this.renderBackdrop() }
261265
{ dialog }

test/AffixSpec.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ describe('<Affix>', () => {
3030
}
3131

3232
class Content extends React.Component {
33-
static renderCount;
34-
3533
render() {
3634
++Content.renderCount;
3735
return <div {...this.props}>Content</div>;

test/PositionSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import pick from 'lodash/object/pick';
1+
import pick from 'lodash/pick';
22
import React from 'react';
33
import ReactDOM from 'react-dom';
44
import ReactTestUtils from 'react-addons-test-utils';

webpack/example-loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function exampleLoader(source){
66

77
source = source
88
.replace(/import.+$/gm, '') //remove imports
9-
.replace(/export default (\w+)/g, (_, name) => `React.render(<${name}/>, mountNode)`)
9+
.replace(/export default (\w+)/g, (_, name) => `ReactDOM.render(<${name}/>, mountNode)`)
1010
.trim(); //transform export
1111

1212
return source;

0 commit comments

Comments
 (0)