Skip to content

Commit

Permalink
First pass of 0.14 fixes
Browse files Browse the repository at this point in the history
Still need to convert certain components to the new function format.
  • Loading branch information
bebraw committed Oct 15, 2015
1 parent 170ee6c commit 98da873
Show file tree
Hide file tree
Showing 23 changed files with 87 additions and 65 deletions.
9 changes: 6 additions & 3 deletions manuscript/03_webpack_and_react.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,12 @@ This setup provides you more control over Babel's behavior depending on the envi
It is time to add a first application level dependency to our project. Hit

```bash
npm i react --save
npm i react react-dom --save
```

to get React installed. This will save React to `dependencies` section of *package.json*. Later on we'll use this to generate a vendor build for the production version. It's a good practice to separate application and development level dependencies this way.
to get React installed. This will save React to the `dependencies` section of *package.json*. Later on we'll use this information to generate a vendor build for the production version. It's a good practice to separate application and development level dependencies this way.

*react-dom* is needed as React can be used to target multiple systems (DOM, mobile, terminal, i.e.,). Given we're dealing with the browser, *react-dom* is the correct choice here.

Now that we got that out of the way, we can start to develop our Kanban application. First we should define the `App`. This will be the core of our application. It represents the high level view of our app and works as an entry point. Later on it will orchestrate the entire app.

Expand Down Expand Up @@ -238,6 +240,7 @@ We'll need to adjust our `index.js` to render the component correctly. Note that
import './main.css';

import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/App.jsx';

main();
Expand All @@ -247,7 +250,7 @@ function main() {

document.body.appendChild(app);

React.render(<App />, app);
ReactDOM.render(<App />, app);
}
```

Expand Down
3 changes: 2 additions & 1 deletion project_source/03_webpack_and_react/kanban_app/app/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import './main.css';

import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/App.jsx';

main();
Expand All @@ -10,5 +11,5 @@ function main() {

document.body.appendChild(app);

React.render(<App />, app);
ReactDOM.render(<App />, app);
}
3 changes: 2 additions & 1 deletion project_source/03_webpack_and_react/kanban_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"webpack-merge": "^0.1.2"
},
"dependencies": {
"react": "^0.13.3"
"react": "^0.14.0",
"react-dom": "^0.14.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'array.prototype.findindex';
import './main.css';

import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/App.jsx';

main();
Expand All @@ -11,5 +12,5 @@ function main() {

document.body.appendChild(app);

React.render(<App />, app);
ReactDOM.render(<App />, app);
}
3 changes: 2 additions & 1 deletion project_source/04_implementing_notes/kanban_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"dependencies": {
"array.prototype.findindex": "^1.0.0",
"node-uuid": "^1.4.3",
"react": "^0.13.3"
"react": "^0.14.0",
"react-dom": "^0.14.0"
}
}
3 changes: 2 additions & 1 deletion project_source/05_react_and_flux/kanban_app/app/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'array.prototype.findindex';
import './main.css';

import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/App.jsx';
import alt from './libs/alt';
import storage from './libs/storage';
Expand All @@ -15,5 +16,5 @@ function main() {

document.body.appendChild(app);

React.render(<App />, app);
ReactDOM.render(<App />, app);
}
5 changes: 3 additions & 2 deletions project_source/05_react_and_flux/kanban_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
"webpack-merge": "^0.1.2"
},
"dependencies": {
"alt": "^0.17.1",
"alt": "^0.17.4",
"array.prototype.findindex": "^1.0.0",
"node-uuid": "^1.4.3",
"react": "^0.13.3"
"react": "^0.14.0",
"react-dom": "^0.14.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'array.prototype.findindex';
import './main.css';

import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/App.jsx';
import alt from './libs/alt';
import storage from './libs/storage';
Expand All @@ -15,5 +16,5 @@ function main() {

document.body.appendChild(app);

React.render(<App />, app);
ReactDOM.render(<App />, app);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
"webpack-merge": "^0.1.2"
},
"dependencies": {
"alt": "^0.17.1",
"alt": "^0.17.4",
"array.prototype.findindex": "^1.0.0",
"node-uuid": "^1.4.3",
"react": "^0.13.3"
"react": "^0.14.0",
"react-dom": "^0.14.0"
}
}
3 changes: 2 additions & 1 deletion project_source/07_implementing_dnd/kanban_app/app/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'array.prototype.findindex';
import './main.css';

import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/App.jsx';
import alt from './libs/alt';
import storage from './libs/storage';
Expand All @@ -15,5 +16,5 @@ function main() {

document.body.appendChild(app);

React.render(<App />, app);
ReactDOM.render(<App />, app);
}
7 changes: 4 additions & 3 deletions project_source/07_implementing_dnd/kanban_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
"webpack-merge": "^0.1.2"
},
"dependencies": {
"alt": "^0.17.1",
"alt": "^0.17.4",
"array.prototype.findindex": "^1.0.0",
"node-uuid": "^1.4.3",
"react": "^0.13.3",
"react-dnd": "^1.1.4"
"react": "^0.14.0",
"react-dnd": "^1.1.4",
"react-dom": "^0.14.0"
}
}
3 changes: 2 additions & 1 deletion project_source/08_building_kanban/kanban_app/app/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'array.prototype.findindex';
import './main.css';

import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/App.jsx';
import alt from './libs/alt';
import storage from './libs/storage';
Expand All @@ -15,5 +16,5 @@ function main() {

document.body.appendChild(app);

React.render(<App />, app);
ReactDOM.render(<App />, app);
}
7 changes: 4 additions & 3 deletions project_source/08_building_kanban/kanban_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
"webpack-merge": "^0.1.2"
},
"dependencies": {
"alt": "^0.17.1",
"alt": "^0.17.4",
"array.prototype.findindex": "^1.0.0",
"node-uuid": "^1.4.3",
"react": "^0.13.3",
"react-dnd": "^1.1.4"
"react": "^0.14.0",
"react-dnd": "^1.1.4",
"react-dom": "^0.14.0"
}
}
3 changes: 2 additions & 1 deletion project_source/09_testing_react/kanban_app/app/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'array.prototype.findindex';
import './main.css';

import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/App.jsx';
import alt from './libs/alt';
import storage from './libs/storage';
Expand All @@ -15,5 +16,5 @@ function main() {

document.body.appendChild(app);

React.render(<App />, app);
ReactDOM.render(<App />, app);
}
8 changes: 5 additions & 3 deletions project_source/09_testing_react/kanban_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,19 @@
"mocha": "^2.3.2",
"phantomjs": "^1.9.18",
"phantomjs-polyfill": "0.0.1",
"react-addons-test-utils": "^0.14.0",
"react-transform-hmr": "^1.0.1",
"style-loader": "^0.12.3",
"webpack": "^1.10.1",
"webpack-dev-server": "^1.10.1",
"webpack-merge": "^0.1.2"
},
"dependencies": {
"alt": "^0.17.1",
"alt": "^0.17.4",
"array.prototype.findindex": "^1.0.0",
"node-uuid": "^1.4.3",
"react": "^0.13.3",
"react-dnd": "^1.1.4"
"react": "^0.14.0",
"react-dnd": "^1.1.4",
"react-dom": "^0.14.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React from 'react/addons';
import assert from 'assert';
import Editable from 'app/components/Editable.jsx';

const {
import React from 'react';
import {
renderIntoDocument,
findRenderedDOMComponentWithClass,
findRenderedDOMComponentWithTag,
Simulate
} = React.addons.TestUtils;
} from 'react-addons-test-utils';
import assert from 'assert';
import Editable from 'app/components/Editable.jsx';

describe('Editable', () => {
it('renders value', () => {
Expand All @@ -18,7 +17,7 @@ describe('Editable', () => {

const valueComponent = findRenderedDOMComponentWithClass(component, 'value');

assert.equal(valueComponent.getDOMNode().textContent, value);
assert.equal(valueComponent.textContent, value);
});

it('enters edit mode', () => {
Expand All @@ -32,7 +31,7 @@ describe('Editable', () => {

const input = findRenderedDOMComponentWithTag(component, 'input');

assert.equal(input.getDOMNode().value, value);
assert.equal(input.value, value);
});

it('triggers onEdit', () => {
Expand Down
7 changes: 4 additions & 3 deletions project_source/09_testing_react/kanban_app/tests/note_test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react/addons';
import React from 'react';
import {
renderIntoDocument
} from 'react-addons-test-utils';
import TestBackend from 'react-dnd/modules/backends/Test';
import {DragDropContext} from 'react-dnd';
import assert from 'assert';
import Note from 'app/components/Note.jsx';

const {renderIntoDocument} = React.addons.TestUtils;

describe('Note', () => {
it('renders children', () => {
const test = 'test';
Expand Down
8 changes: 5 additions & 3 deletions project_source/10_typing_with_react/flow_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,19 @@
"mocha": "^2.3.2",
"phantomjs": "^1.9.18",
"phantomjs-polyfill": "0.0.1",
"react-addons-test-utils": "^0.14.0",
"react-transform-hmr": "^1.0.1",
"style-loader": "^0.12.3",
"webpack": "^1.10.1",
"webpack-dev-server": "^1.10.1",
"webpack-merge": "^0.1.2"
},
"dependencies": {
"alt": "^0.17.1",
"alt": "^0.17.4",
"array.prototype.findindex": "^1.0.0",
"node-uuid": "^1.4.3",
"react": "^0.13.3",
"react-dnd": "^1.1.4"
"react": "^0.14.0",
"react-dnd": "^1.1.4",
"react-dom": "^0.14.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React from 'react/addons';
import assert from 'assert';
import Editable from 'app/components/Editable.jsx';

const {
import React from 'react';
import {
renderIntoDocument,
findRenderedDOMComponentWithClass,
findRenderedDOMComponentWithTag,
Simulate
} = React.addons.TestUtils;
} from 'react-addons-test-utils';
import assert from 'assert';
import Editable from 'app/components/Editable.jsx';

describe('Editable', () => {
it('renders value', () => {
Expand All @@ -18,7 +17,7 @@ describe('Editable', () => {

const valueComponent = findRenderedDOMComponentWithClass(component, 'value');

assert.equal(valueComponent.getDOMNode().textContent, value);
assert.equal(valueComponent.textContent, value);
});

it('enters edit mode', () => {
Expand All @@ -32,7 +31,7 @@ describe('Editable', () => {

const input = findRenderedDOMComponentWithTag(component, 'input');

assert.equal(input.getDOMNode().value, value);
assert.equal(input.value, value);
});

it('triggers onEdit', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react/addons';
import React from 'react';
import {
renderIntoDocument
} from 'react-addons-test-utils';
import TestBackend from 'react-dnd/modules/backends/Test';
import {DragDropContext} from 'react-dnd';
import assert from 'assert';
import Note from 'app/components/Note.jsx';

const {renderIntoDocument} = React.addons.TestUtils;

describe('Note', () => {
it('renders children', () => {
const test = 'test';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,19 @@
"mocha": "^2.3.2",
"phantomjs": "^1.9.18",
"phantomjs-polyfill": "0.0.1",
"react-addons-test-utils": "^0.14.0",
"react-transform-hmr": "^1.0.1",
"style-loader": "^0.12.3",
"webpack": "^1.10.1",
"webpack-dev-server": "^1.10.1",
"webpack-merge": "^0.1.2"
},
"dependencies": {
"alt": "^0.17.1",
"alt": "^0.17.4",
"array.prototype.findindex": "^1.0.0",
"node-uuid": "^1.4.3",
"react": "^0.13.3",
"react-dnd": "^1.1.4"
"react": "^0.14.0",
"react-dnd": "^1.1.4",
"react-dom": "^0.14.0"
}
}
Loading

0 comments on commit 98da873

Please sign in to comment.