Skip to content

Commit

Permalink
Updated examples dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
nmay231 committed Feb 14, 2020
1 parent 4ae60bb commit 5d9017f
Show file tree
Hide file tree
Showing 13 changed files with 60 additions and 97 deletions.
2 changes: 1 addition & 1 deletion examples/throttled-drag/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["es2015"]
"presets": ["@babel/env"]
}
5 changes: 5 additions & 0 deletions examples/throttled-drag/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This shows an example of how to throttle saving history only four times a second. Very useful for rapidly changing state like mouse position.

Simply run `npm install` then `npm start` to set started.

Note: this build is not meant for production.
20 changes: 9 additions & 11 deletions examples/throttled-drag/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@
"version": "1.0.0",
"description": "Drag example with throttled undo, using redux-undo",
"scripts": {
"start": "node server.js"
"start": "webpack-dev-server --open"
},
"author": "Peter Uithoven",
"license": "MIT",
"dependencies": {
"pepjs": "^0.4.1",
"redux": "^3.3.1",
"redux-undo": "^1.0.0-beta9-9-4"
"pepjs": "^0.5.2",
"redux": "^4.0.5",
"redux-undo": "^1.0.0"
},
"devDependencies": {
"babel-core": "^6.7.4",
"babel-loader": "^6.2.4",
"babel-preset-es2015": "^6.6.0",
"express": "^4.13.4",
"webpack": "^2.6.1",
"webpack-dev-middleware": "^1.10.2",
"webpack-hot-middleware": "^2.18.0"
"@babel/core": "^7.8.3",
"@babel/preset-env": "^7.8.3",
"babel-loader": "^8.0.6",
"webpack": "^4.41.5",
"webpack-dev-server": "^3.10.1"
}
}
26 changes: 0 additions & 26 deletions examples/throttled-drag/server.js

This file was deleted.

11 changes: 7 additions & 4 deletions examples/throttled-drag/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ var path = require('path')
var webpack = require('webpack')

module.exports = {
mode: 'development',
devtool: 'cheap-module-eval-source-map',
entry: [
'webpack-hot-middleware/client',
'./index'
],
entry: './index',
devServer: {
contentBase: __dirname,
compress: true,
port: 3000
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
Expand Down
7 changes: 1 addition & 6 deletions examples/todos-with-undo/.babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
{
"presets": ["es2015", "react"],
"env": {
"development": {
"presets": ["react-hmre"]
}
}
"presets": ["@babel/env", "@babel/react"]
}
5 changes: 5 additions & 0 deletions examples/todos-with-undo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
A basic example of how to use redux-undo.

Simply run `npm install` then `npm start` to set started.

Note: this build is not meant for production.
11 changes: 6 additions & 5 deletions examples/todos-with-undo/components/Link.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'

const Link = ({ active, children, onClick }) => {
if (active) {
Expand All @@ -7,10 +8,10 @@ const Link = ({ active, children, onClick }) => {

return (
<a href="#"
onClick={e => {
e.preventDefault()
onClick()
}}
onClick={e => {
e.preventDefault()
onClick()
}}
>
{children}
</a>
Expand Down
3 changes: 2 additions & 1 deletion examples/todos-with-undo/components/Todo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'

const Todo = ({ onClick, completed, text }) => (
<li
Expand Down
4 changes: 3 additions & 1 deletion examples/todos-with-undo/components/TodoList.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React, { PropTypes } from 'react'
import React from 'react'
import PropTypes from 'prop-types'

import Todo from './Todo'

const TodoList = ({ todos, onTodoClick }) => (
Expand Down
29 changes: 14 additions & 15 deletions examples/todos-with-undo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"description": "Redux todos with undo example",
"scripts": {
"start": "node server.js"
"start": "webpack-dev-server --open"
},
"repository": {
"type": "git",
Expand All @@ -15,23 +15,22 @@
},
"dependencies": {
"babel-polyfill": "^6.3.14",
"react": "^0.14.7",
"react-dom": "^0.14.7",
"react-redux": "^4.2.1",
"redux": "^3.2.1",
"prop-types": "^15.7.2",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-redux": "^7.1.3",
"redux": "^4.0.5",
"redux-undo": "^1.0.0-beta9-9-4"
},
"devDependencies": {
"babel-core": "^6.3.15",
"babel-loader": "^6.2.0",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-react-hmre": "^1.1.1",
"expect": "^1.6.0",
"@babel/core": "^7.8.3",
"@babel/preset-env": "^7.8.3",
"@babel/preset-react": "^7.8.3",
"babel-loader": "^8.0.6",
"expect": "^24.9.0",
"express": "^4.13.3",
"node-libs-browser": "^0.5.2",
"webpack": "^2.6.1",
"webpack-dev-middleware": "^1.10.2",
"webpack-hot-middleware": "^2.18.0"
"node-libs-browser": "^2.2.1",
"webpack": "^4.41.5",
"webpack-dev-server": "^3.10.1"
}
}
23 changes: 0 additions & 23 deletions examples/todos-with-undo/server.js

This file was deleted.

11 changes: 7 additions & 4 deletions examples/todos-with-undo/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ var path = require('path')
var webpack = require('webpack')

module.exports = {
mode: 'development',
devtool: 'cheap-module-eval-source-map',
entry: [
'webpack-hot-middleware/client',
'./index'
],
entry: './index',
devServer: {
contentBase: __dirname,
compress: true,
port: 3000
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
Expand Down

0 comments on commit 5d9017f

Please sign in to comment.