Skip to content

Commit 50a8bfa

Browse files
committed
Fixed further deprecations. Updated dependencies.
1 parent ee2c598 commit 50a8bfa

File tree

7 files changed

+52
-47
lines changed

7 files changed

+52
-47
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Changelog
22

3-
## 1.0.11
4-
* Fix deprecation warnings in React 15.5.0
3+
## 2.0.0
4+
* Fix deprecation warnings in React 15.6.0
55

66
## 1.1.0 - Dec 30, 2016
77
* Move to semantic versioning

build/react-countdown-clock.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/react-countdown-clock.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coffee/react-countdown-clock.coffee

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ React = require 'react'
22
PropTypes = require 'prop-types'
33
CreateReactClass = require 'create-react-class'
44

5-
module.exports = CreateReactClass
5+
ReactCountdownClock = CreateReactClass
66
_seconds: 0
77
_radius: null
88
_fraction: null
@@ -12,32 +12,6 @@ module.exports = CreateReactClass
1212

1313
displayName: 'ReactCountdownClock'
1414

15-
propTypes:
16-
seconds: PropTypes.number
17-
size: PropTypes.number
18-
weight: PropTypes.number
19-
color: PropTypes.string
20-
fontSize: PropTypes.string
21-
font: PropTypes.string
22-
alpha: PropTypes.number
23-
timeFormat: PropTypes.string
24-
onComplete: PropTypes.func
25-
onClick: PropTypes.func
26-
showMilliseconds: PropTypes.bool
27-
paused: PropTypes.bool
28-
pausedText: PropTypes.string
29-
30-
getDefaultProps: ->
31-
seconds: 60
32-
size: 300
33-
color: '#000'
34-
alpha: 1
35-
timeFormat: 'hms'
36-
fontSize: 'auto'
37-
font: 'Arial'
38-
showMilliseconds: true
39-
paused: false
40-
4115
componentDidUpdate: (props) ->
4216
if props.seconds != @props.seconds
4317
@_seconds = props.seconds
@@ -200,3 +174,31 @@ module.exports = CreateReactClass
200174
<canvas ref='background' style={ position: 'absolute' } width={@props.size} height={@props.size}></canvas>
201175
<canvas ref='timer' style={ position: 'absolute' } width={@props.size} height={@props.size}></canvas>
202176
</div>
177+
178+
ReactCountdownClock.propTypes =
179+
seconds: PropTypes.number
180+
size: PropTypes.number
181+
weight: PropTypes.number
182+
color: PropTypes.string
183+
fontSize: PropTypes.string
184+
font: PropTypes.string
185+
alpha: PropTypes.number
186+
timeFormat: PropTypes.string
187+
onComplete: PropTypes.func
188+
onClick: PropTypes.func
189+
showMilliseconds: PropTypes.bool
190+
paused: PropTypes.bool
191+
pausedText: PropTypes.string
192+
193+
ReactCountdownClock.defaultProps =
194+
seconds: 60
195+
size: 300
196+
color: '#000'
197+
alpha: 1
198+
timeFormat: 'hms'
199+
fontSize: 'auto'
200+
font: 'Arial'
201+
showMilliseconds: true
202+
paused: false
203+
204+
module.exports = ReactCountdownClock

index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
</head>
2020
<body>
2121
<div id="parappa"></div>
22-
<script src="http://cdnjs.cloudflare.com/ajax/libs/react/15.3.0/react.js"></script>
23-
<script src="http://cdnjs.cloudflare.com/ajax/libs/react/15.3.0/react-dom.js"></script>
22+
<script src="http://cdnjs.cloudflare.com/ajax/libs/react/15.6.0/react.js"></script>
23+
<script src="http://cdnjs.cloudflare.com/ajax/libs/react/15.6.0/react-dom.js"></script>
24+
<script src="https://unpkg.com/create-react-class/create-react-class.js"></script>
2425
<script src="./build/react-countdown-clock.js"></script>
2526
<script>
2627
var MAX = 120;
@@ -34,7 +35,7 @@
3435
return '#' + ( Math.random() * 0xFFFFFF << 0 ).toString(16);
3536
}
3637

37-
var Demo = React.createClass({
38+
var Demo = createReactClass({
3839
displayName: 'Demo',
3940
getState: function(){
4041
return {

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-countdown-clock",
3-
"version": "1.0.11",
3+
"version": "2.0.0",
44
"description": "HTML5 canvas countdown clock React component",
55
"main": "build/react-countdown-clock.js",
66
"repository": {
@@ -21,14 +21,14 @@
2121
},
2222
"homepage": "https://github.com/pughpugh/react-countdown-clock",
2323
"devDependencies": {
24-
"cjsx-loader": "^2.1.0",
24+
"cjsx-loader": "^3.0.0",
2525
"coffee-loader": "^0.7.2",
2626
"coffee-script": "^1.8.0",
27-
"webpack": "^1.13.1",
28-
"react": "^15.5.0"
27+
"webpack": "^3.3.0",
28+
"react": "^15.6.0"
2929
},
3030
"peerDependencies": {
31-
"react": "^15.5.0"
31+
"react": "^15.6.0"
3232
},
3333
"dependencies": {
3434
"create-react-class": "^15.5.2",

webpack.config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
var path = require('path');
2+
13
module.exports = {
24
cache: true,
35
context: __dirname + '/coffee',
46
entry: './react-countdown-clock.coffee',
57
output: {
6-
path: './build',
7-
publicPath: '/build/',
8+
path: path.join(__dirname, 'build'),
9+
publicPath: path.join(__dirname, 'build'),
810
filename: 'react-countdown-clock.js',
911
library: 'ReactCountdownClock',
1012
libraryTarget: 'umd'
@@ -22,7 +24,7 @@ module.exports = {
2224
loaders: [
2325
{
2426
test: /\.coffee$/,
25-
loader: 'coffee!cjsx'
27+
loader: 'coffee-loader!cjsx-loader'
2628
}
2729
]
2830
}

0 commit comments

Comments
 (0)