Skip to content

Commit

Permalink
Version bump of dependencies plus setting engine expectation of node …
Browse files Browse the repository at this point in the history
…to 6.0.0 (GordyD#44)

* Version bump of dependencies plus setting engine expectation of node to 6.0.0

 - Usage of `react-router` and `react-router-redux` has been updated
 - Usage of `redux-mock-store` has also been updated following breaking changes that were present in tests
 - Use x denotation to in package dependencies to denote acceptability of dependencies minor version updates

* Remove local specific settings from default.json

* Tell CircleCI to use Node v.6.0.0 and use global doc to stop eslint error on ES6 Promise usage in dbSetup.js

* Update Readme.md to include new version numbers and some guidance around Node and RethinkdDb versions
  • Loading branch information
GordyD committed May 12, 2016
1 parent c11134e commit 4fe9132
Show file tree
Hide file tree
Showing 11 changed files with 121 additions and 115 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ There is a demo app hosted at [3ree-demo.workshape.io](http://3ree-demo.workshap

### Setup

You will need to install [RethinkDB](http://www.rethinkdb.com). You can find instruction on how to do so [here](http://rethinkdb.com/docs/install/).
You will need to install [RethinkDB](http://www.rethinkdb.com). You can find instruction on how to do so [here](http://rethinkdb.com/docs/install/). Make sure you have the latest version installed.

- Clone the repo `git clone [email protected]:GordyD/3ree.git`
- Make sure you are using Node v6.0.0 (I recommend using [n](https://github.com/tj/n) for Node version management)
- Run `npm install`
- If your local environment is not reflected by `config/default.json`, then add a file at `config/local.json` to provide local customisation.
- Run `npm run db-setup` to set up DB
Expand All @@ -53,15 +54,15 @@ You will need to roll out your own deployment script for a server, but before yo

| **Tech** | **Description** | **Version** |
| ---------|-----------------|-------------|
| [React](https://facebook.github.io/react/) | View layer | 0.14.7 |
| [React Router](https://github.com/reactjs/react-router) | Universal routing | 2.0.0 |
| [Redux](http://redux.js.org/) | State management | 3.1.0 |
| [RethinkDB](http://www.rethinkdb.com) | Persistance layer | 2.2.4 |
| [Express](http://expressjs.com/) | Node.js server framework | 4.13.3 |
| [Socket.io]() | Used for realtime communication between clients and server | 1.4.4 |
| [Webpack](https://webpack.github.io/) | Module bundling + build for client | 1.12.11 |
| [Superagent](https://github.com/visionmedia/superagent) | Universal http requests | 1.6.1 |
| [Stylus](http://stylus-lang.com/) | Expressive, dynamic, robust CSS | 0.53.0 |
| [React](https://facebook.github.io/react/) | View layer | 15.0.2 |
| [React Router](https://github.com/reactjs/react-router) | Universal routing | 2.4.0 |
| [Redux](http://redux.js.org/) | State management | 3.5.0 |
| [RethinkDB](http://www.rethinkdb.com) | Persistance layer | 2.3.1 |
| [Express](http://expressjs.com/) | Node.js server framework | 4.13.0 |
| [Socket.io]() | Used for realtime communication between clients and server | 1.4.0 |
| [Webpack](https://webpack.github.io/) | Module bundling + build for client | 1.13.0 |
| [Superagent](https://github.com/visionmedia/superagent) | Universal http requests | 1.8.0 |
| [Stylus](http://stylus-lang.com/) | Expressive, dynamic, robust CSS | 0.54.0 |



Expand Down
3 changes: 3 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
machine:
node:
version: 6.0.0
test:
override:
- npm run lint
Expand Down
6 changes: 4 additions & 2 deletions client/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import ReactDOM from 'react-dom';
import React from 'react';
import { Router, Route } from 'react-router';
import { Router, Route, browserHistory } from 'react-router';
import { syncHistoryWithStore } from 'react-router-redux';

import { getOrSetUserId } from './UserId';
import { setupRealtime } from './Realtime';
Expand All @@ -15,9 +16,10 @@ import '../style/pure.css';
import '../style/main.styl';
import '../style/spinner.styl';

const history = syncHistoryWithStore(browserHistory, store);

ReactDOM.render(
<Root store={store} routing={routes} />,
<Root store={store} routing={routes} history={history} />,
document.getElementById('app')
);

Expand Down
1 change: 1 addition & 0 deletions dbSetup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* global Promise */
import r from 'rethinkdb';
import config from 'config';

Expand Down
140 changes: 72 additions & 68 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "pulse",
"name": "3ree",
"version": "1.0.0",
"description": "An example universal JS application written with the 3REE stack, React + Redux + RethinkDB + Express.",
"main": "server.babel.js",
Expand All @@ -19,75 +19,79 @@
"webpack"
],
"license": "MIT",
"engines": {
"node": ">=6.0.0",
"npm": ">=3.8.6"
},
"dependencies": {
"bluebird": "3.1.1",
"body-parser": "1.14.2",
"classnames": "2.2.3",
"config": "1.19.0",
"ejs": "2.3.4",
"express": "4.13.3",
"history": "1.13.0",
"moment": "2.11.1",
"nib": "^1.1.0",
"node-uuid": "1.4.7",
"react": "0.14.7",
"react-dom": "0.14.7",
"react-redux": "4.0.6",
"react-router": "2.0.0",
"react-router-redux": "^3.0.0",
"redux": "3.1.0",
"redux-logger": "2.3.2",
"redux-thunk": "1.0.3",
"rethinkdb": "2.2.1",
"serve-static": "1.10.2",
"socket.io": "1.4.4",
"socket.io-client": "1.4.4",
"superagent": "1.6.1",
"xss": "0.2.10"
"bluebird": "3.1.x",
"body-parser": "1.14.x",
"classnames": "2.2.x",
"config": "1.19.x",
"ejs": "2.3.x",
"express": "4.13.x",
"history": "1.13.x",
"moment": "2.11.x",
"nib": "^1.1.x",
"node-uuid": "1.4.x",
"react": "15.0.x",
"react-dom": "15.0.x",
"react-redux": "4.4.x",
"react-router": "2.4.x",
"react-router-redux": "4.0.x",
"redux": "3.5.x",
"redux-logger": "2.6.x",
"redux-thunk": "2.1.x",
"rethinkdb": "2.3.x",
"serve-static": "1.10.x",
"socket.io": "1.4.x",
"socket.io-client": "1.4.x",
"superagent": "1.8.x",
"xss": "0.2.x"
},
"devDependencies": {
"babel": "6.3.26",
"babel-core": "6.4.0",
"babel-eslint": "5.0.0-beta10",
"babel-loader": "6.2.1",
"babel-plugin-rewire": "1.0.0-rc-2",
"babel-polyfill": "^6.3.14",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-react-hmre": "^1.0.1",
"babel-preset-stage-0": "^6.3.13",
"babel-runtime": "^6.3.19",
"babel-template": "^6.3.13",
"chai": "^3.4.1",
"css-loader": "0.17.0",
"eslint": "^1.10.3",
"eslint-plugin-react": "^3.15.0",
"extract-text-webpack-plugin": "^1.0.1",
"karma": "^0.13.16",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^0.2.2",
"karma-mocha": "^0.2.1",
"karma-mocha-reporter": "^1.1.5",
"karma-phantomjs-launcher": "^0.2.2",
"karma-sinon": "^1.0.4",
"karma-webpack": "^1.7.0",
"mocha": "^2.3.4",
"mocha-loader": "^0.7.1",
"nock": "^3.6.0",
"node-libs-browser": "0.5.2",
"phantomjs": "^1.9.19",
"raw-loader": "0.5.1",
"react-hot-loader": "1.3.0",
"react-transform-hmr": "^1.0.1",
"redux-devtools": "3.0.1",
"redux-devtools-dock-monitor": "^1.0.1",
"redux-devtools-log-monitor": "^1.0.2",
"redux-mock-store": "0.0.6",
"sinon": "^1.17.3",
"style-loader": "0.13.0",
"stylus": "^0.53.0",
"stylus-loader": "^1.5.1",
"webpack": "1.12.11",
"webpack-dev-server": "1.14.1"
"babel": "6.5.x",
"babel-core": "6.8.x",
"babel-eslint": "6.0.x",
"babel-loader": "6.2.x",
"babel-plugin-rewire": "1.0.0-rc-3",
"babel-polyfill": "6.8.x",
"babel-preset-es2015": "6.6.x",
"babel-preset-react": "6.5.x",
"babel-preset-react-hmre": "1.1.x",
"babel-preset-stage-0": "6.5.x",
"babel-runtime": "6.6.x",
"babel-template": "6.8.x",
"chai": "3.5.x",
"css-loader": "0.23.x",
"eslint": "2.9.x",
"eslint-plugin-react": "5.1.x",
"extract-text-webpack-plugin": "1.0.x",
"karma": "0.13.x",
"karma-chai": "0.1.x",
"karma-chrome-launcher": "1.0.x",
"karma-mocha": "1.0.x",
"karma-mocha-reporter": "2.0.x",
"karma-phantomjs-launcher": "1.0.x",
"karma-sinon": "1.0.x",
"karma-webpack": "1.7.x",
"mocha": "2.4.x",
"mocha-loader": "0.7.x",
"nock": "8.0.x",
"node-libs-browser": "1.0.x",
"phantomjs-prebuilt": "2.1.x",
"raw-loader": "0.5.x",
"react-hot-loader": "1.3.x",
"react-transform-hmr": "1.0.x",
"redux-devtools": "3.3.x",
"redux-devtools-dock-monitor": "1.1.x",
"redux-devtools-log-monitor": "1.0.x",
"redux-mock-store": "1.0.x",
"sinon": "1.17.x",
"style-loader": "0.13.x",
"stylus": "0.54.x",
"stylus-loader": "2.0.x",
"webpack": "1.13.x",
"webpack-dev-server": "1.14.x"
}
}
16 changes: 12 additions & 4 deletions test/actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('Actions', () => {
*/
describe('loadEvents', () => {
const mockStore = configureStore([thunk]);
it('should trigger a LOAD_EVENTS_REQUEST and LOAD_EVENTS_SUCCESS action when succesful', (done) => {
it('should trigger a LOAD_EVENTS_REQUEST and LOAD_EVENTS_SUCCESS action when succesful', () => {
let requestMock = {
get: () => ({
set: () => ({
Expand All @@ -59,12 +59,16 @@ describe('Actions', () => {
];

let initialState = {pulseApp: { events: [], userId: 'baseUser'} };
let store = mockStore(initialState, expectedActions, done);
let store = mockStore(initialState);

store.dispatch(loadEvents());

const actualActions = store.getActions();

expect(actualActions).to.eql(expectedActions);
});

it('should trigger a LOAD_EVENTS_REQUEST and LOAD_EVENTS_FAILURE action when unsuccessful', (done) => {
it('should trigger a LOAD_EVENTS_REQUEST and LOAD_EVENTS_FAILURE action when unsuccessful', () => {
let error = 'An Error Occurred!';
let requestMock = {
get: () => ({
Expand All @@ -82,9 +86,13 @@ describe('Actions', () => {
];

let initialState = {pulseApp: { events: [], userId: 'baseUser'} };
let store = mockStore(initialState, expectedActions, done);
let store = mockStore(initialState);

store.dispatch(loadEvents());

const actualActions = store.getActions();

expect(actualActions).to.eql(expectedActions);
});
});
});
7 changes: 4 additions & 3 deletions universal/containers/root/root.dev.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { Router, browserHistory } from 'react-router';
import { Router } from 'react-router';

import DevTools from '../devTools';

export default class Root extends Component {
render() {
const { store, routing } = this.props;
const { store, routing, history } = this.props;

return (
<Provider store={store}>
<div>
<Router history={browserHistory}>
<Router history={history}>
{routing}
</Router>
<DevTools />
Expand Down
6 changes: 3 additions & 3 deletions universal/containers/root/root.prod.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { Router, browserHistory } from 'react-router';
import { Router } from 'react-router';

export default class Root extends Component {
render() {
const { store, routing } = this.props;
const { store, routing, history } = this.props;
return (
<Provider store={store}>
<div>
<Router history={browserHistory}>
<Router history={history}>
{routing}
</Router>
</div>
Expand Down
16 changes: 4 additions & 12 deletions universal/store/configureStore.client.dev.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
import { createHistory } from 'history';
import { browserHistory } from 'react-router';
import { createStore, applyMiddleware, compose, combineReducers } from 'redux';
import thunkMiddleware from 'redux-thunk';
import createLogger from 'redux-logger';
import { syncHistory, routeReducer } from 'react-router-redux';
import { routerReducer } from 'react-router-redux';
import DevTools from '../containers/devTools';
import { persistState } from 'redux-devtools';

import pulseApp from '../reducers';

// Grab the state from a global injected into server-generated HTML
const initialState = window.__INITIAL_STATE__;

const rootReducer = combineReducers({
routing: routeReducer,
routing: routerReducer,
pulseApp
});

// Sync dispatched route actions to the history
const reduxRouterMiddleware = syncHistory(browserHistory);

const loggerMiddleware = createLogger({
level: 'info',
collapsed: true,
});

const enhancer = compose(
applyMiddleware(thunkMiddleware, loggerMiddleware, reduxRouterMiddleware),
applyMiddleware(thunkMiddleware, loggerMiddleware),
DevTools.instrument()
);

Expand All @@ -35,13 +30,10 @@ const store = createStore(rootReducer, initialState, enhancer);
if (module.hot) {
module.hot.accept('../reducers', () =>
store.replaceReducer(combineReducers({
routing: routeReducer,
routing: routerReducer,
pulseApp: require('../reducers')
}))
);
};

export default store;

// Required for replaying actions from devtools to work
reduxRouterMiddleware.listenForReplays(store);
10 changes: 3 additions & 7 deletions universal/store/configureStore.client.prod.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
import { createHistory } from 'history';
import { browserHistory } from 'react-router';
import { createStore, applyMiddleware, compose, combineReducers } from 'redux';
import thunkMiddleware from 'redux-thunk';
import { syncHistory, routeReducer } from 'react-router-redux';
import { persistState } from 'redux-devtools';
import { routerReducer } from 'react-router-redux';

import pulseApp from '../reducers';

// Grab the state from a global injected into server-generated HTML
const initialState = window.__INITIAL_STATE__;

const rootReducer = combineReducers({
routing: routeReducer,
routing: routerReducer,
pulseApp
});

const reduxRouterMiddleware = syncHistory(browserHistory);
const enhancer = compose(
applyMiddleware(thunkMiddleware, reduxRouterMiddleware)
applyMiddleware(thunkMiddleware)
);

const store = createStore(rootReducer, initialState, enhancer);
Expand Down
Loading

0 comments on commit 4fe9132

Please sign in to comment.