Skip to content

Commit

Permalink
Merge pull request #24 from TeoTN/deployment
Browse files Browse the repository at this point in the history
Deployment
  • Loading branch information
TeoTN authored Jun 10, 2017
2 parents 0e2f319 + 552d9c8 commit a46363b
Show file tree
Hide file tree
Showing 125 changed files with 7,741 additions and 1,190 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
language: node_js
node_js:
- "6"
before_install:
- npm install -g babel-cli rimraf
- cd redux-saga-router
- npm install
- cd ..
script:
- npm test -- --coverage
- npm build
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tfoosball",
"version": "2.0.1",
"version": "2.1.1",
"private": true,
"devDependencies": {
"autoprefixer": "6.5.1",
Expand Down Expand Up @@ -62,21 +62,25 @@
},
"dependencies": {
"babel-polyfill": "^6.20.0",
"chart.js": "^2.2.2",
"chart.js": "^2.5.0",
"es6-error": "^4.0.2",
"md5": "^2.2.1",
"promise-window": "^1.1.0",
"randy": "^1.5.1",
"react": "^15.4.1",
"react": "^15.4.2",
"react-bootstrap": "^0.30.7",
"react-dom": "^15.4.1",
"react-redux": "^4.4.6",
"react-router": "^2.8.1",
"react-dom": "^15.4.2",
"react-fontawesome": "^1.5.0",
"react-redux": "^5.0.3",
"react-router": "^3.0.2",
"react-router-bootstrap": "^0.23.1",
"redux": "^3.6.0",
"redux-form": "^6.6.1",
"redux-saga": "^0.14.3",
"redux-saga-router": "^2.0.0"
"redux-saga-router": "file:./redux-saga-router"
},
"scripts": {
"heroku-prebuild": "npm install -g babel-cli rimraf && cd redux-saga-router && npm install && cd ..",
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js --env=jsdom"
Expand Down
18 changes: 18 additions & 0 deletions redux-saga-router/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"presets": [
["es2015", { "loose": true }],
"react"
],
"plugins": [
"transform-class-properties",
"transform-export-extensions"
],
"env": {
"test": {
"plugins": [
"transform-async-to-generator",
"transform-object-rest-spread"
]
}
}
}
16 changes: 16 additions & 0 deletions redux-saga-router/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"parser": "babel-eslint",
"extends": [
"airbnb",
"plugin:import/errors",
"plugin:import/warnings"
],
"settings": {
"import/resolver": "node"
},
"rules": {
"arrow-parens": 0,
"react/forbid-prop-types": 0,
"react/jsx-filename-extension": 0
}
}
38 changes: 38 additions & 0 deletions redux-saga-router/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history
lib/
12 changes: 12 additions & 0 deletions redux-saga-router/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: node_js
node_js:
- "4"
- "5"
- "6"
branches:
only:
- master
- /^greenkeeper.*$/
script:
- npm run lint
- npm test
79 changes: 79 additions & 0 deletions redux-saga-router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
## v2.0.0

### Spawned Route Sagas

While this is a new major version, there aren't any directly noticeable breaking
changes. Route sagas used to be invoked via the `call` effect. Unfortunately,
`call` is blocking, so long running sagas could prevent other route sagas from
immediately running if the route changed. Another issue is that if a route saga
happened to `fork` or `spawn` a sub saga, there was no way to know when the
route changed to perform cleanup such as cancelling the forked sub saga.

Thanks to [@victorchabbert](https://github.com/victorchabbert), route sagas are
now spawned via the `spawn` effect. This creates a detached, forked task for
each route saga when its route triggers. Now, when the route changes, Redux Saga
Router will cancel any currently running route saga task, giving you the
opportunity to perform cleanup in your route saga or sub sagas.

```js
const delay = time => new Promise(resolve => setTimeout(resolve, time));

function* autoSaveSaga() {
try {
while (true) {
const data = yield select(getData);
yield call(Api.saveEditor, data);
yield call(delay, 5000);
}
} finally {
if (yield cancelled()) {
// do some other cleanup
}
}
}

const routes = {
'/editor': function* editorSaga() {
try {
yield fork(autoSaveSaga);
} finally {
if (yield cancelled()) {
// do some cleanup
}
}
},
};

function* mainSaga() {
yield* router(history, routes);
}
```

Because the behavior of route sagas has slightly changed, this could impact your
application. For example, if you have a route saga that fetches some data from
an API and the route suddenly changes, Redux Saga Router used to wait for the
data to come back and the currently running saga to complete before starting the
new route saga. Now, Redux Saga Router will cancel the running saga even if the
data hasn't come back yet. This new behavior actually makes more sense because
there is no reason to complete fetching the data or delay letting the new route
saga run. If you used to depend on the previous behavior, though, then Redux
Saga Router could break your app. Therefore, this release was a major bump so
you can ensure your route sagas are safe before upgrading.

---

## v1.1.0

- Support redux-saga 0.14.x, 0.13.x, and 0.12.x

---

## v1.0.1

- Internal implementation tweaks

---

## v1.0.0

- Initial Release
21 changes: 21 additions & 0 deletions redux-saga-router/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016 Jeremy Fairbank

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit a46363b

Please sign in to comment.