From b56b8e494ac28d7113f6cddcb0d91fcc6eb63095 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Tue, 14 Jun 2016 16:05:24 -0700 Subject: [PATCH] Update various packages (inc. babel and eslint) --- karma.config.js | 4 +- package.json | 49 +++++++++++---------- src/apis/AppRegistry/ReactNativeApp.js | 19 ++++---- src/apis/AppRegistry/index.js | 4 +- src/apis/StyleSheet/__tests__/index-test.js | 4 +- src/components/ActivityIndicator/index.js | 6 ++- src/components/Text/index.js | 6 ++- 7 files changed, 49 insertions(+), 43 deletions(-) diff --git a/karma.config.js b/karma.config.js index 0e09094c..c224fafb 100644 --- a/karma.config.js +++ b/karma.config.js @@ -19,14 +19,14 @@ module.exports = function (config) { 'karma-chrome-launcher', 'karma-firefox-launcher', 'karma-mocha', + 'karma-mocha-reporter', 'karma-sourcemap-loader', - 'karma-spec-reporter', 'karma-webpack' ], preprocessors: { [testEntry]: [ 'webpack', 'sourcemap' ] }, - reporters: process.env.TRAVIS ? [ 'dots' ] : [ 'spec' ], + reporters: process.env.TRAVIS ? [ 'dots' ] : [ 'mocha' ], singleRun: true, webpack: { devtool: 'inline-source-map', diff --git a/package.json b/package.json index a0f1453a..643f741e 100644 --- a/package.json +++ b/package.json @@ -16,42 +16,43 @@ "test:watch": "npm run test -- --no-single-run" }, "dependencies": { + "babel-runtime": "^6.9.2", "fbjs": "^0.8.1", "inline-style-prefix-all": "1.0.5", - "lodash.debounce": "^4.0.3", + "lodash.debounce": "^4.0.6", "react-textarea-autosize": "^4.0.2", "react-timer-mixin": "^0.13.3" }, "devDependencies": { - "babel-cli": "^6.3.17", - "babel-core": "^6.3.13", - "babel-eslint": "^4.1.6", - "babel-loader": "^6.2.0", + "babel-cli": "^6.10.1", + "babel-core": "^6.9.1", + "babel-eslint": "^6.0.4", + "babel-loader": "^6.2.4", "babel-plugin-transform-decorators-legacy": "^1.3.4", - "babel-preset-es2015": "^6.3.13", - "babel-preset-react": "^6.3.13", - "babel-preset-stage-1": "^6.3.13", - "babel-runtime": "^6.3.19", - "eslint": "^1.10.3", - "eslint-config-standard": "^4.4.0", - "eslint-config-standard-react": "^1.2.1", - "eslint-plugin-react": "^3.13.1", - "eslint-plugin-standard": "^1.3.1", - "karma": "^0.13.16", - "karma-browserstack-launcher": "^0.1.8", - "karma-chrome-launcher": "^0.2.2", - "karma-firefox-launcher": "^0.1.7", - "karma-mocha": "^0.2.1", - "karma-sourcemap-loader": "^0.3.6", - "karma-spec-reporter": "0.0.23", + "babel-preset-es2015": "^6.9.0", + "babel-preset-react": "^6.5.0", + "babel-preset-stage-1": "^6.5.0", + "eslint": "^2.12.0", + "eslint-config-standard": "^5.3.1", + "eslint-config-standard-react": "^2.4.0", + "eslint-plugin-promise": "^1.3.2", + "eslint-plugin-react": "^5.1.1", + "eslint-plugin-standard": "^1.3.2", + "karma": "^0.13.22", + "karma-browserstack-launcher": "^1.0.1", + "karma-chrome-launcher": "^1.0.1", + "karma-firefox-launcher": "^1.0.0", + "karma-mocha": "^1.0.1", + "karma-mocha-reporter": "^2.0.4", + "karma-sourcemap-loader": "^0.3.7", "karma-webpack": "^1.7.0", - "mocha": "^2.3.4", + "mocha": "^2.5.3", "node-libs-browser": "^0.5.3", "react": "^15.1.0", "react-addons-test-utils": "^15.1.0", "react-dom": "^15.1.0", - "webpack": "^1.12.9", - "webpack-dev-server": "^1.14.0" + "webpack": "^1.13.1", + "webpack-dev-server": "^1.14.1" }, "peerDependencies": { "react": "^15.1.0", diff --git a/src/apis/AppRegistry/ReactNativeApp.js b/src/apis/AppRegistry/ReactNativeApp.js index 8898721d..8f9c9d76 100644 --- a/src/apis/AppRegistry/ReactNativeApp.js +++ b/src/apis/AppRegistry/ReactNativeApp.js @@ -11,25 +11,24 @@ class ReactNativeApp extends Component { rootTag: PropTypes.any }; - constructor(props, context) { - super(props, context) - this._handleModalVisibilityChange = this._handleModalVisibilityChange.bind(this) - } - - _handleModalVisibilityChange(modalVisible) { - ReactDOM.findDOMNode(this._root).setAttribute('aria-hidden', `${modalVisible}`) - } - render() { const { initialProps, rootComponent: RootComponent, rootTag } = this.props return ( - { this._root = c }} rootTag={rootTag} /> + ) } + + _createRootRef = (component) => { + this._root = component + } + + _handleModalVisibilityChange = (modalVisible) => { + ReactDOM.findDOMNode(this._root).setAttribute('aria-hidden', `${modalVisible}`) + } } const styles = StyleSheet.create({ diff --git a/src/apis/AppRegistry/index.js b/src/apis/AppRegistry/index.js index c9652732..69d3952a 100644 --- a/src/apis/AppRegistry/index.js +++ b/src/apis/AppRegistry/index.js @@ -33,7 +33,7 @@ class AppRegistry { invariant( runnables[appKey] && runnables[appKey].prerender, `Application ${appKey} has not been registered. ` + - `This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.` + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.' ) return runnables[appKey].prerender(appParameters) @@ -78,7 +78,7 @@ class AppRegistry { invariant( runnables[appKey] && runnables[appKey].run, `Application "${appKey}" has not been registered. ` + - `This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.` + 'This is either due to an import error during initialization or failure to call AppRegistry.registerComponent.' ) runnables[appKey].run(appParameters) diff --git a/src/apis/StyleSheet/__tests__/index-test.js b/src/apis/StyleSheet/__tests__/index-test.js index 0cbe800f..9c67d128 100644 --- a/src/apis/StyleSheet/__tests__/index-test.js +++ b/src/apis/StyleSheet/__tests__/index-test.js @@ -30,7 +30,7 @@ suite('apis/StyleSheet', () => { `${resetCSS}\n${predefinedCSS}\n` + `/* 2 unique declarations */\n` + `.__style1{opacity:1;}\n` + - `.__style2{color:red;}` + '.__style2{color:red;}' ) // teardown @@ -45,7 +45,7 @@ suite('apis/StyleSheet', () => { StyleSheet.renderToString(), `${resetCSS}\n${predefinedCSS}\n` + `/* 1 unique declarations */\n` + - `.__style1{opacity:1;}` + '.__style1{opacity:1;}' ) }) diff --git a/src/components/ActivityIndicator/index.js b/src/components/ActivityIndicator/index.js index 40d22b2b..f2f60471 100644 --- a/src/components/ActivityIndicator/index.js +++ b/src/components/ActivityIndicator/index.js @@ -61,7 +61,7 @@ class ActivityIndicator extends Component { return ( { this._indicatorRef = c }} + ref={this._createIndicatorRef} style={[ indicatorStyles[size], hidesWhenStopped && !animating && styles.hidesWhenStopped, @@ -72,6 +72,10 @@ class ActivityIndicator extends Component { ) } + _createIndicatorRef = (component) => { + this._indicatorRef = component + } + _manageAnimation() { if (this._player) { if (this.props.animating) { diff --git a/src/components/Text/index.js b/src/components/Text/index.js index afe110bb..389b1390 100644 --- a/src/components/Text/index.js +++ b/src/components/Text/index.js @@ -22,14 +22,16 @@ class Text extends Component { accessible: true }; - _onPress(e) { + _onPress = (e) => { if (this.props.onPress) this.props.onPress(e) } render() { const { numberOfLines, + /* eslint-disable no-unused-vars */ onPress, + /* eslint-enable no-unused-vars */ style, ...other } = this.props @@ -38,7 +40,7 @@ class Text extends Component {