Skip to content

Commit 7296d3c

Browse files
authored
Port examples to use Create React App (#1883)
* Rename examples => examples_old * Port counter and counter-vanilla * Port async example * Port todos example * Port todos-with-undo example * Port some tests over * Add todomvc example * Ported shopping-cart example * Ported tree-view * Ported real-world * Add missing dep * Temp fix install until examples get an equivalent to buildAll.js * Restore example build scripts. * Bump react-scripts * Finish porting examples
1 parent 947e5dd commit 7296d3c

File tree

176 files changed

+823
-1124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+823
-1124
lines changed

examples/async/.babelrc

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/async/.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# dependencies
4+
node_modules
5+
6+
# production
7+
build
8+
9+
# misc
10+
.DS_Store
11+
npm-debug.log

examples/async/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Redux Async Example
2+
3+
This project template was built with [Create React App](https://github.com/facebookincubator/create-react-app).
4+
5+
## Available Scripts
6+
7+
In the project directory, you can run:
8+
9+
### `npm start`
10+
11+
Runs the app in the development mode.<br>
12+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13+
14+
The page will reload if you make edits.<br>
15+
You will also see any lint errors in the console.
16+
17+
### `npm run build`
18+
19+
Builds the app for production to the `build` folder.<br>
20+
It correctly bundles React in production mode and optimizes the build for the best performance.
21+
22+
The build is minified and the filenames include the hashes.<br>
23+
Your app is ready to be deployed!
24+
25+
### `npm run eject`
26+
27+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
28+
29+
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
30+
31+
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
32+
33+
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
34+

examples/async/index.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1-
<!DOCTYPE html>
2-
<html>
1+
<!doctype html>
2+
<html lang="en">
33
<head>
4-
<title>Redux async example</title>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>Redux Async Example</title>
57
</head>
68
<body>
7-
<div id="root">
8-
</div>
9-
<script src="/static/bundle.js"></script>
9+
<div id="root"></div>
10+
<!--
11+
This HTML file is a template.
12+
If you open it directly in the browser, you will see an empty page.
13+
14+
You can add webfonts, meta tags, or analytics to this file.
15+
The build step will place the bundled scripts into the <body> tag.
16+
17+
To begin the development, run `npm start` in this folder.
18+
To create a production bundle, use `npm run build`.
19+
-->
1020
</body>
1121
</html>

examples/async/index.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

examples/async/package.json

Lines changed: 18 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,24 @@
11
{
2-
"name": "redux-async-example",
3-
"version": "0.0.0",
4-
"description": "Redux async example",
5-
"scripts": {
6-
"start": "node server.js"
7-
},
8-
"repository": {
9-
"type": "git",
10-
"url": "https://github.com/reactjs/redux.git"
11-
},
12-
"keywords": [
13-
"react",
14-
"reactjs",
15-
"hot",
16-
"reload",
17-
"hmr",
18-
"live",
19-
"edit",
20-
"webpack",
21-
"flux"
22-
],
23-
"license": "MIT",
24-
"bugs": {
25-
"url": "https://github.com/reactjs/redux/issues"
2+
"name": "async",
3+
"version": "0.0.1",
4+
"private": true,
5+
"devDependencies": {
6+
"react-scripts": "^0.4.0",
7+
"redux-logger": "^2.6.1"
268
},
27-
"homepage": "http://redux.js.org",
289
"dependencies": {
29-
"babel-polyfill": "^6.3.14",
30-
"isomorphic-fetch": "^2.1.1",
31-
"react": "^0.14.7",
32-
"react-dom": "^0.14.7",
33-
"react-redux": "^4.2.1",
34-
"redux": "^3.2.1",
35-
"redux-logger": "^2.4.0",
36-
"redux-thunk": "^1.0.3"
10+
"react": "^15.3.0",
11+
"react-dom": "^15.3.0",
12+
"react-redux": "^4.4.5",
13+
"redux": "^3.5.2",
14+
"redux-thunk": "^2.1.0"
3715
},
38-
"devDependencies": {
39-
"babel-core": "^6.3.15",
40-
"babel-loader": "^6.2.0",
41-
"babel-preset-es2015": "^6.3.13",
42-
"babel-preset-react": "^6.3.13",
43-
"babel-preset-react-hmre": "^1.1.1",
44-
"expect": "^1.6.0",
45-
"express": "^4.13.3",
46-
"node-libs-browser": "^0.5.2",
47-
"webpack": "^1.9.11",
48-
"webpack-dev-middleware": "^1.2.0",
49-
"webpack-hot-middleware": "^2.9.1"
16+
"scripts": {
17+
"start": "react-scripts start",
18+
"build": "react-scripts build",
19+
"eject": "react-scripts eject"
20+
},
21+
"eslintConfig": {
22+
"extends": "./node_modules/react-scripts/config/eslint.js"
5023
}
5124
}

examples/async/server.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

examples/async/actions/index.js renamed to examples/async/src/actions/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import fetch from 'isomorphic-fetch'
2-
31
export const REQUEST_POSTS = 'REQUEST_POSTS'
42
export const RECEIVE_POSTS = 'RECEIVE_POSTS'
53
export const SELECT_REDDIT = 'SELECT_REDDIT'
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)