Skip to content
This repository was archived by the owner on Jan 4, 2018. It is now read-only.

Commit a09a0ee

Browse files
committed
Merge pull request #52 from emmenko/babel-6
Babel 6
2 parents fdd0554 + a042d8a commit a09a0ee

28 files changed

+127
-106
lines changed

.babelrc

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
11
{
2-
"optional": ["runtime"],
3-
"stage": 0,
2+
"plugins": ["transform-runtime"],
3+
"presets": [ "es2015", "stage-0", "react" ],
44
"env": {
55
"development": {
6-
"plugins": ["react-transform"],
7-
"extra": {
8-
"react-transform": {
9-
"transforms": [{
10-
"transform": "react-transform-hmr",
11-
"imports": ["react"],
12-
"locals": ["module"]
13-
}]
14-
}
15-
}
6+
"plugins": [
7+
[ "react-transform", {
8+
"transforms": [
9+
{
10+
"transform": "react-transform-hmr",
11+
"imports": ["react"],
12+
"locals": ["module"]
13+
},
14+
{
15+
"transform": "react-transform-catch-errors",
16+
"imports": [ "react", "redbox-react" ]
17+
}
18+
]
19+
}]
20+
]
21+
},
22+
"i18n": {
23+
"plugins": [
24+
[ "react-intl", {
25+
"messagesDir": "./_translations",
26+
"enforceDescriptions": false
27+
}]
28+
]
1629
}
1730
}
1831
}

.babelrc.i18n

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

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
http://emmenko.github.io/redux-react-router-async-example
22

3-
This is a boilerplate example showcasing _mostly_ [Redux](https://github.com/gaearon/redux) and [React Router](https://github.com/rackt/react-router).
3+
This is a boilerplate example showcasing _mostly_ [Redux](https://github.com/gaearon/redux) and [React Router](https://github.com/rackt/react-router) and it aims to provide different examples or use cases with the two libraries.
44

5-
> Still a **WIP** but it aims to provide different examples or use cases with the two libraries.
5+
##### The project will be constantly updated and improved with the latest dependencies, features, best practices and so on.
6+
7+
> Check out the [migration to babel 6](https://github.com/emmenko/redux-react-router-async-example/pull/52).
68
79
## Features
810

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# TODO
22

33
- JSDoc
4-
- better error handling
4+
- loading spinner for data fetching
55
- use inline styles https://github.com/emmenko/redux-react-router-async-example/issues/7
66
- add use-case for `AsyncProps`
77
- add use-case for external plugin https://dl.dropboxusercontent.com/u/4803975/ReactEurope/slides.pdf

lib/Root.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function getRootChildren (props) {
4848
]
4949

5050
if (__DEVTOOLS__) {
51-
const DevTools = require('./components/DevTools')
51+
const DevTools = require('./components/DevTools').default
5252
rootChildren.push(<DevTools key="devtools" />)
5353
}
5454
return rootChildren
@@ -90,15 +90,16 @@ function logout (nextState, replaceState) {
9090
replaceState({}, '/login')
9191
}
9292

93-
@connect(({ application }) => ({ application }))
94-
export default class Root extends React.Component {
93+
class Root extends React.Component {
9594
static propTypes = {
9695
application: PropTypes.object.isRequired
97-
}
96+
};
9897

9998
render () {
10099
return (
101100
<div>{getRootChildren(this.props)}</div>
102101
)
103102
}
104103
}
104+
105+
export default connect(({ application }) => ({ application }))(Root)

lib/components/Application.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default class Application extends React.Component {
88

99
static propTypes = {
1010
children: PropTypes.any
11-
}
11+
};
1212

1313
constructor (props, context) {
1414
super(props, context)

lib/components/DevTools.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import DockMonitor from 'redux-devtools-dock-monitor'
55

66
export default createDevTools(
77
<DockMonitor
8-
toggleVisibilityKey='H'
9-
changePositionKey='Q'>
8+
toggleVisibilityKey='ctrl-h'
9+
changePositionKey='ctrl-q'>
1010
<LogMonitor />
1111
</DockMonitor>
1212
)

lib/components/DisplayError.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class DisplayError extends React.Component {
77
static propTypes = {
88
hideError: PropTypes.func.isRequired,
99
error: PropTypes.object
10-
}
10+
};
1111

1212
render () {
1313
const { props: { hideError, error } } = this

lib/components/Menu.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ const menuItems = [
1313
{ text: 'Fork Me', link: GITHUB_REPO, icon: 'fa fa-github', isExternal: true }
1414
]
1515

16-
@connect(({ application }) => ({ application }), applicationActions)
17-
export default class Menu extends React.Component {
16+
class Menu extends React.Component {
1817

1918
static propTypes = {
2019
activeClass: PropTypes.string.isRequired,
2120
application: PropTypes.object.isRequired,
2221
switchLocale: PropTypes.func.isRequired
23-
}
22+
};
2423

2524
constructor (props, context) {
2625
super(props, context)
@@ -58,3 +57,8 @@ export default class Menu extends React.Component {
5857
)
5958
}
6059
}
60+
61+
export default connect(
62+
({ application }) => ({ application }),
63+
applicationActions
64+
)(Menu)

lib/components/MenuListItem.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export default class MenuListItem extends Component {
88
isExternal: PropTypes.bool,
99
link: PropTypes.string.isRequired,
1010
text: PropTypes.string.isRequired
11-
}
11+
};
1212

13-
static defaultProps = { isExternal: false }
13+
static defaultProps = { isExternal: false };
1414

1515
render () {
1616
return (

0 commit comments

Comments
 (0)