Skip to content

Commit 4046a16

Browse files
committed
Merge pull request jaysoo#1 from niieani/master
Update to latest React & Redux
2 parents ed01bb3 + aa61622 commit 4046a16

File tree

9 files changed

+84
-37
lines changed

9 files changed

+84
-37
lines changed

client/actions/__spec__/todos-spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/// <reference path='../../../test.d.ts'/>
1+
/// <reference path='../../../typings/mocha/mocha.d.ts'/>
2+
/// <reference path='../../../typings/chai/chai.d.ts'/>
23

34
import { expect } from 'chai';
45

client/components/Footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference path='../../typings/react/react.d.ts'/>
22
/// <reference path='../../typings/classnames/classnames.d.ts'/>
33
import * as React from 'react';
4-
import * as classNames from 'classnames';
4+
import classNames from 'classnames';
55

66
import {
77
SHOW_ALL,

client/components/TodoItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/// <reference path='../../typings/classnames/classnames.d.ts'/>
33

44
import * as React from 'react';
5-
import * as classNames from 'classnames';
5+
import classNames from 'classnames';
66

77
import { Todo } from '../models/todos';
88
import TodoTextInput from './TodoTextInput';

client/components/TodoTextInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/// <reference path='../../typings/classnames/classnames.d.ts'/>
33

44
import * as React from 'react';
5-
import * as classNames from 'classnames';
5+
import classNames from 'classnames';
66

77
interface TodoTextInputProps {
88
onSave: Function;
@@ -59,4 +59,4 @@ class TodoTextInput extends React.Component<TodoTextInputProps, any> {
5959
}
6060

6161

62-
export default TodoTextInput;
62+
export default TodoTextInput;

client/main.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/// <reference path='../typings/react/react.d.ts'/>
2+
/// <reference path='../typings/react-dom/react-dom.d.ts'/>
23
/// <reference path='../typings/redux-actions/redux-actions.d.ts'/>
34
/// <reference path='../typings/redux/redux.d.ts'/>
45
/// <reference path='../typings/react-redux/react-redux.d.ts'/>
56

67
import * as React from 'react';
8+
import * as ReactDOM from 'react-dom';
9+
import '../src-scss/main.css!';
710

811
import {
912
Store,
@@ -18,18 +21,16 @@ import {
1821
} from 'react-redux';
1922
import { Action } from 'redux-actions';
2023

21-
import App from './containers/App.tsx';
22-
import { rootReducer } from './reducers/rootReducer.ts';
24+
import App from './containers/App';
25+
import { rootReducer } from './reducers/rootReducer';
2326

24-
const initialState = {
25-
};
27+
const initialState = {};
2628

2729
const store: Store = createStore(rootReducer, initialState);
2830

29-
React.render(
31+
ReactDOM.render(
3032
<Provider store={store}>
31-
{() => <App />}
33+
<App />
3234
</Provider>,
3335
document.getElementById('app')
3436
);
35-

client/reducers/__spec__/todos-spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/// <reference path='../../../test.d.ts'/>
1+
/// <reference path='../../../typings/mocha/mocha.d.ts'/>
2+
/// <reference path='../../../typings/chai/chai.d.ts'/>
23

34
import { expect } from 'chai';
45

package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,38 @@
1616
"author": "Jack Hsu <jack.hsu@gmail.com>",
1717
"license": "ISC",
1818
"dependencies": {
19-
"classnames": "2.1.3",
20-
"express": "4.7.2",
21-
"extract-text-webpack-plugin": "0.8.0",
22-
"lodash": "3.2.0",
23-
"react": "0.13.3",
24-
"react-redux": "0.9.0",
25-
"redux": "1.0.1",
19+
"classnames": "2.2.0",
20+
"express": "4.13.3",
21+
"extract-text-webpack-plugin": "0.9.1",
22+
"lodash": "3.10.1",
23+
"react": "0.14.2",
24+
"react-redux": "4.0.0",
25+
"redux": "3.0.4",
2626
"redux-actions": "0.8.0",
27-
"serve-static": "1.9.2",
27+
"serve-static": "1.10.0",
2828
"todomvc-app-css": "2.0.1",
29-
"yargs": "3.5.3"
29+
"yargs": "3.29.0"
3030
},
3131
"devDependencies": {
3232
"babel": "5.2.17",
3333
"babel-core": "5.2.17",
3434
"babel-loader": "5.0.0",
3535
"babel-runtime": "5.2.17",
36-
"chai": "2.3.0",
37-
"css-loader": "0.14.0",
38-
"eslint-plugin-react": "3.3.0",
39-
"file-loader": "0.8.1",
40-
"jsdom": "3.1.2",
36+
"chai": "3.4.1",
37+
"css-loader": "0.22.0",
38+
"eslint-plugin-react": "3.8.0",
39+
"file-loader": "0.8.4",
40+
"jsdom": "7.0.2",
4141
"mocha": "2.3.3",
42-
"react-hot-loader": "1.2.9",
43-
"redux-devtools": "1.0.2",
42+
"react-hot-loader": "1.3.0",
43+
"redux-devtools": "2.1.5",
4444
"socket.io": "1.3.7",
45-
"stats-webpack-plugin": "0.1.2",
46-
"style-loader": "0.12.0",
47-
"ts-loader": "0.5.5",
45+
"stats-webpack-plugin": "0.2.2",
46+
"style-loader": "0.13.0",
47+
"ts-loader": "0.6.1",
4848
"typescript": "1.6.2",
4949
"typescript-require": "0.2.9-1",
50-
"webpack": "1.9.4",
51-
"webpack-dev-server": "1.11.0"
50+
"webpack": "1.12.3",
51+
"webpack-dev-server": "1.12.1"
5252
}
5353
}

typings/classnames/classnames.d.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
// Type definitions for classnames
22
// Project: https://github.com/JedWatson/classnames
3-
// Definitions by: Dave Keen <http://www.keendevelopment.ch>, Adi Dahiya <https://github.com/adidahiya>
3+
// Definitions by: Dave Keen <http://www.keendevelopment.ch>, Adi Dahiya <https://github.com/adidahiya>, Jason Killian <https://github.com/JKillian>
44
// Definitions: https://github.com/borisyankov/DefinitelyTyped
55

6+
declare type ClassValue = string | number | ClassDictionary | ClassArray;
7+
68
interface ClassDictionary {
79
[id: string]: boolean;
810
}
911

12+
interface ClassArray extends Array<ClassValue> { }
13+
1014
interface ClassNamesFn {
11-
(...classes: (string | ClassDictionary)[]): string;
15+
(...classes: ClassValue[]): string;
1216
}
1317

1418
declare var classNames: ClassNamesFn;
1519

1620
declare module "classnames" {
17-
export = classNames
21+
export default classNames
1822
}

typings/react-dom/react-dom.d.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Type definitions for React-DOM v0.14.0-rc
2+
// Project: https://www.npmjs.com/package/react-dom
3+
// Definitions by: Stefan-Bieliauskas <http://www.conts.de>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
/// <reference path="./../react/react.d.ts" />
7+
8+
declare namespace __ReactDom {
9+
function render<P>(
10+
element: __React.DOMElement<P>,
11+
container: Element,
12+
callback?: () => any): __React.DOMComponent<P>;
13+
function render<P, S>(
14+
element: __React.ClassicElement<P>,
15+
container: Element,
16+
callback?: () => any): __React.ClassicComponent<P, S>;
17+
function render<P, S>(
18+
element: __React.ReactElement<P>,
19+
container: Element,
20+
callback?: () => any): __React.Component<P, S>;
21+
22+
function findDOMNode<TElement extends Element>(
23+
componentOrElement: __React.Component<any, any> | Element): TElement;
24+
function findDOMNode(
25+
componentOrElement: __React.Component<any, any> | Element): Element;
26+
27+
function unmountComponentAtNode(container: Element): boolean;
28+
}
29+
30+
declare namespace __ReactDomServer {
31+
function renderToString(element: __React.ReactElement<any>): string;
32+
function renderToStaticMarkup(element: __React.ReactElement<any>): string;
33+
}
34+
declare module "react-dom" {
35+
export = __ReactDom
36+
}
37+
38+
declare module "react-dom/server" {
39+
export = __ReactDomServer
40+
}

0 commit comments

Comments
 (0)