Skip to content

Commit c82e1be

Browse files
committed
[deps] updated all the deps, fixed ref issue
1 parent a461982 commit c82e1be

File tree

14 files changed

+63
-54
lines changed

14 files changed

+63
-54
lines changed

.babelrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"optional": [
3+
"runtime",
4+
"es7.objectRestSpread"
5+
]
6+
}

.eslintrc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"extends": ["defaults"],
23
"env": {
34
"browser": true,
45
"node": true
@@ -11,13 +12,16 @@
1112
"react"
1213
],
1314
"rules": {
14-
"comma-dangle": "always",
15+
"comma-dangle": [2, "always-multiline"],
1516
"comma-spacing": 1,
1617
"key-spacing": 0,
18+
"no-mixed-spaces-and-tabs": 2,
19+
"no-multiple-empty-lines": [1, { "max": 1}],
1720
"no-underscore-dangle": 0,
1821
"no-unused-vars": [1, { "vars": "all", "args": "none" }],
1922
"no-undef": 1,
2023
"no-var": 2,
24+
"quote-props": [2, "as-needed"],
2125
"quotes": [2, "double"],
2226
"react/display-name": 0,
2327
"react/jsx-uses-react": 1,
@@ -28,6 +32,6 @@
2832
"react/react-in-jsx-scope": 1,
2933
"react/self-closing-comp": 1,
3034
"react/wrap-multilines": 1,
31-
"strict": 0
35+
"strict": [1, "never"]
3236
}
3337
}

karma.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint no-var: 0 */
2-
require("./register-babel");
2+
require("babel/register");
33

44
var webpackConfig = require("./webpack/test.config.js");
55
var isCI = process.env.CONTINUOUS_INTEGRATION === "true";
@@ -15,7 +15,7 @@ module.exports = function (config) {
1515
],
1616

1717
files: [
18-
"test/index.js"
18+
"test/index.js",
1919
],
2020

2121
preprocessors: {

package.json

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,36 @@
3333
"react": ">=0.13"
3434
},
3535
"devDependencies": {
36-
"babel": "~5.4.7",
37-
"babel-core": "~5.4.7",
38-
"babel-eslint": "~3.1.9",
39-
"babel-loader": "~5.1.3",
40-
"chai": "~2.2.0",
36+
"babel": "~5.8.21",
37+
"babel-core": "~5.8.22",
38+
"babel-eslint": "~4.0.8",
39+
"babel-loader": "~5.3.2",
40+
"chai": "~3.2.0",
4141
"child-process-promise": "~1.1.0",
4242
"colors": "~1.1.0",
4343
"es5-shim": "~4.1.3",
44-
"eslint": "~0.19.0",
45-
"eslint-plugin-react": "~2.2.0",
44+
"eslint": "~1.1.0",
45+
"eslint-config-defaults": "~4.0.1",
46+
"eslint-plugin-react": "~3.2.3",
4647
"fs-promise": "~0.3.1",
47-
"karma": "~0.12.33",
48+
"karma": "~0.13.9",
4849
"karma-chai": "~0.1.0",
49-
"karma-chrome-launcher": "~0.1.12",
50-
"karma-cli": "~0.0.4",
51-
"karma-mocha": "~0.1.10",
52-
"karma-mocha-reporter": "~1.0.2",
53-
"karma-phantomjs-launcher": "~0.1.4",
54-
"karma-sourcemap-loader": "~0.3.4",
55-
"karma-webpack": "~1.5.1",
56-
"lodash": "~3.7.0",
50+
"karma-chrome-launcher": "~0.2.0",
51+
"karma-cli": "~0.1.0",
52+
"karma-mocha": "~0.2.0",
53+
"karma-mocha-reporter": "~1.1.1",
54+
"karma-phantomjs-launcher": "~0.2.1",
55+
"karma-sourcemap-loader": "~0.3.5",
56+
"karma-webpack": "~1.7.0",
57+
"lodash": "~3.10.1",
5758
"mocha": "~2.2.5",
5859
"react": "~0.13.3",
59-
"webpack": "~1.9.10",
60-
"yargs": "~3.9.1"
60+
"webpack": "~1.11.0",
61+
"yargs": "~3.19.0"
62+
6163
},
6264
"dependencies": {
63-
"babel-runtime": "~5.4.7",
64-
"react-async-script": "~0.3.2"
65+
"babel-runtime": "^5.8.0",
66+
"react-async-script": "~0.4.0"
6567
}
6668
}

register-babel.js

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

run-babel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22
/* eslint no-var: 0 */
33
var path = require("path");
4-
require("./register-babel");
4+
require("babel/register");
55
var mod = require(path.join(__dirname, process.argv[2]));
66

77
if (typeof mod === "function") {

src/recaptcha-wrapper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ const globalName = "grecaptcha";
77

88
export default makeAsyncScriptLoader(ReCAPTCHA, URL, {
99
callbackName: callbackName,
10-
globalName:globalName,
11-
exposeFuncs: ["getValue", "reset"]
10+
globalName: globalName,
11+
exposeFuncs: ["getValue", "reset"],
1212
});

src/recaptcha.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ const ReCAPTCHA = React.createClass({
4747

4848
explicitRender(cb) {
4949
if (this.props.grecaptcha && !this.state.widgetId) {
50-
this.refs.captcha.getDOMNode();
51-
let id = this.props.grecaptcha.render(this.refs.captcha.getDOMNode(), {
50+
this.captcha.getDOMNode();
51+
let id = this.props.grecaptcha.render(this.captcha.getDOMNode(), {
5252
sitekey: this.props.sitekey,
5353
callback: this.props.onChange,
5454
theme: this.props.theme,
@@ -76,9 +76,9 @@ const ReCAPTCHA = React.createClass({
7676
let { sitekey, onChange, theme, type, tabindex, onExpired, ...childProps } = this.props;
7777
/* eslint-enable no-unused-vars */
7878
return (
79-
<div {...childProps} ref="captcha" />
79+
<div {...childProps} ref={(component) => { this.captcha = component; }} />
8080
);
81-
}
81+
},
8282
});
8383

8484
export default ReCAPTCHA;

test/recaptcha-wrapper-spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let grecaptchaMock = {
1414
getResponse(widgetId) {
1515
assert.equal(widgetId, WIDGET_ID);
1616
return VALUE;
17-
}
17+
},
1818
};
1919

2020
describe("ReCAPTCHAWrapper", () => {

tools/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint no-process-exit: 0 */
1+
/* eslint no-process-exit: 0, no-console: 0 */
22
import "colors";
33
import lib from "./lib/build";
44

0 commit comments

Comments
 (0)