This repository has been archived by the owner on Sep 11, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fractal Project Structure #684
Merged
Merged
Changes from 4 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
641ce78
refactor(app): Fractal Project Structure
3a22e34
Sync with master
33b256a
chore(docs): Update documentation
justingreenberg 6a30c23
refactor(store): update injectReducer api
0965e8c
Update README and createStore
f725c6b
chore(repo): sync with master
f5690de
Merge branch 'master' of https://github.com/davezuko/react-redux-star…
a4e1d2a
refactor(utils): Use path helpers, remove IIFE
811fdfe
refactor(deps): remove helmet and reselect
24d134f
chore(docs): update main README
1153389
refactor(server): Use config path helpers
16fc801
chore(components): Own directories
99dd0b7
refactor(counter): remove CounterView
f8f9770
refactor(main): Move routes into app entry
bc7f539
test(routes): Add some tests for Home
735fc9b
fix(misc): remove duplicate deploy
5950392
chore(router): Update router/async API
2bf1bf3
chore(git): sync with master
68a12a1
chore(git): sync with master
80b3d35
fix(ci): remove redux dir
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 |
---|---|---|
|
@@ -125,20 +125,6 @@ webpackConfig.module.loaders = [{ | |
plugins: ['transform-runtime'], | ||
presets: ['es2015', 'react', 'stage-0'], | ||
env: { | ||
development: { | ||
plugins: [ | ||
['react-transform', { | ||
transforms: [{ | ||
transform: 'react-transform-hmr', | ||
imports: ['react'], | ||
locals: ['module'] | ||
}, { | ||
transform: 'react-transform-catch-errors', | ||
imports: ['react', 'redbox-react'] | ||
}] | ||
}] | ||
] | ||
}, | ||
production: { | ||
plugins: [ | ||
'transform-react-remove-prop-types', | ||
|
@@ -280,7 +266,7 @@ if (!__DEV__) { | |
).forEach((loader) => { | ||
const [first, ...rest] = loader.loaders | ||
loader.loader = ExtractTextPlugin.extract(first, rest.join('!')) | ||
delete loader.loaders | ||
Reflect.deleteProperty(loader, 'loaders') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Woah, never seen this before. |
||
}) | ||
|
||
webpackConfig.plugins.push( | ||
|
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
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,37 @@ | ||
/* @flow */ | ||
import React from 'react' | ||
import classes from './Counter.scss' | ||
|
||
// FlowType annotations | ||
type Props = { | ||
counter: number, | ||
doubleAsync: Function, | ||
increment: Function | ||
} | ||
|
||
export const Counter = (props: Props) => ( | ||
<div> | ||
<h2 className={classes.counterContainer}> | ||
Counter: | ||
{' '} | ||
<span className={classes['counter--green']}> | ||
{props.counter} | ||
</span> | ||
</h2> | ||
<button className='btn btn-default' onClick={props.increment}> | ||
Increment | ||
</button> | ||
{' '} | ||
<button className='btn btn-default' onClick={props.doubleAsync}> | ||
Double (Async) | ||
</button> | ||
</div> | ||
) | ||
|
||
Counter.propTypes = { | ||
counter: React.PropTypes.number.isRequired, | ||
doubleAsync: React.PropTypes.func.isRequired, | ||
increment: React.PropTypes.func.isRequired | ||
} | ||
|
||
export default Counter |
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,18 @@ | ||
import React from 'react' | ||
import { IndexLink, Link } from 'react-router' | ||
import classes from './Header.scss' | ||
|
||
export const Header = () => ( | ||
<div> | ||
<h1>React Redux Starter Kit</h1> | ||
<IndexLink to='/' activeClassName={classes.activeRoute}> | ||
Home | ||
</IndexLink> | ||
{' · '} | ||
<Link to='/counter' activeClassName={classes.activeRoute}> | ||
Counter | ||
</Link> | ||
</div> | ||
) | ||
|
||
export default Header |
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,4 @@ | ||
.activeRoute { | ||
font-weight: bold; | ||
text-decoration: underline; | ||
} |
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,62 @@ | ||
## Components | ||
|
||
This is where we keep stateless presentational components that will be used throughout | ||
our application. | ||
|
||
### Super Simple Example | ||
|
||
```js | ||
import React from 'react' | ||
|
||
const today = new Date(); | ||
const year = today.getFullYear(); | ||
|
||
export default const FullYear = () => <span>{year}</span> | ||
``` | ||
|
||
### Counter Example (using FlowType) | ||
|
||
- component is using FlowType annotations to type check props | ||
- we can import | ||
|
||
```js | ||
/* @flow */ | ||
import React, { PropTypes } from 'react' | ||
import classes from './Counter.scss' | ||
|
||
// FlowType annotations | ||
type Props = { | ||
counter: number, | ||
doubleAsync: Function, | ||
increment: Function | ||
}; | ||
|
||
// We also recommend using react PropTypes | ||
const counterPropTypes = { | ||
counter: PropTypes.number.isRequired, | ||
doubleAsync: PropTypes.func.isRequired, | ||
increment: PropTypes.func.isRequired | ||
} | ||
|
||
export const Counter = (props: Props) => ( | ||
<div> | ||
<h2 className={classes.counterContainer}> | ||
'Counter: ' | ||
<span className={classes['counter--green']}> | ||
{props.counter} | ||
</span> | ||
</h2> | ||
<button className='btn btn-default' onClick={props.increment}> | ||
'Increment' | ||
</button> | ||
{' '} | ||
<button className='btn btn-default' onClick={props.doubleAsync}> | ||
'Double (Async)' | ||
</button> | ||
</div> | ||
) | ||
|
||
Counter.propTypes = counterPropTypes | ||
|
||
export default Counter | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.
Should just link to the section you added above?