-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds React/Redux example #1706
Closed
Closed
Adds React/Redux example #1706
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
644ec09
Adds React/Redux example
paguillama 466e103
Uses hashHistory on router and hides footer and main when no todos
paguillama 816c15d
Adds React + Redux to learn.json
paguillama e714c96
Uses react-router v3.0.0-beta.1
paguillama 4abf220
Excludes dist and reducers from jscs
paguillama 2b7af41
Fixes pluralization and todo edition
paguillama 6e63851
[Review comments]
paguillama File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/node_modules/* | ||
|
||
!/node_modules/todomvc-common/ | ||
/node_modules/todomvc-common/* | ||
!/node_modules/todomvc-common/base.css | ||
|
||
!/node_modules/todomvc-app-css/ | ||
/node_modules/todomvc-app-css/* | ||
!/node_modules/todomvc-app-css/index.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "../../.jshintrc", | ||
"strict": false, | ||
"esversion": 6, | ||
"esnext": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# React / Redux • [TodoMVC](http://todomvc.com) | ||
|
||
> React is a JavaScript library for creating user interfaces. Its core principles are declarative code, efficiency, and flexibility. Simply specify what your component looks like and React will keep it up-to-date when the underlying data changes. | ||
|
||
> Redux is a predictable state container for JavaScript apps. It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test. On top of that, it provides a great developer experience, such as live code editing combined with a time traveling debugger. | ||
|
||
## Resources | ||
- [React Website](https://facebook.github.io/react/) | ||
- [Redux Website](http://redux.js.org/) | ||
|
||
### Articles | ||
- [Getting Started with React](https://facebook.github.io/react/docs/getting-started.html) | ||
- [Getting Started with Redux](https://egghead.io/courses/getting-started-with-redux) | ||
- [Building React Applications with Idiomatic Redux](https://egghead.io/courses/building-react-applications-with-idiomatic-redux) | ||
|
||
### Support | ||
- [React Stack Overflow](http://stackoverflow.com/questions/tagged/react) | ||
- [Redux Stack Overflow](http://stackoverflow.com/questions/tagged/redux) | ||
|
||
## Implementation | ||
This is an implementation of the [Redux Todo app example](https://github.com/reactjs/redux/tree/master/examples/todomvc). | ||
In order to show React and Redux in a simple way, some cool features that are not directly related to React/Redux like multiple environments, a development server, CSS loading with webpack, etc, were not included. | ||
Also, some [todomvc.com](http://todomvc.com) features (eg: clear completed) were implemented in order to comply with the app specs. | ||
|
||
|
||
You can check it with any static web server (eg: `python -m SimpleHTTPServer`). The index.html file uses the bundled version by Babel created with `npm run dist` under the `dist` folder, but this bundle contains source maps to the JS source code located under the `js` folder, so developers can see and debug the application with the original code. | ||
|
||
## Credit | ||
Created by [paguillama](https://github.com/paguillama) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These reducers use object spread operator.
Adding the
esnext
option to jscs works but I couldn't find a way to extend a jscs configuration or use a specific one on thejs
folder in order to override this option. I also tried disabling jscs with inline comments (/* jscs: disable */
) and didn't work. So I removed reducers from linting :|There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check http://stackoverflow.com/questions/25223149/is-there-any-way-for-jscs-to-ignore-rules-per-file-block-or-line
Quoting:
To ignore all rules
// Code here will be linted with JSCS.
// jscs:disable
// Code here will be ignored by JSCS.
// jscs:enable
To ignore a specific rule:
// Code here will be linted with JSCS.
// jscs:disable specificRule
// Code here will be ignored by JSCS.
// jscs:enable specificRule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it, but it didn't work. The only way I found to make it work is with the
esnext
flag.