mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-01 10:07:35 +00:00
Update various packages (inc. babel and eslint)
This commit is contained in:
+2
-2
@@ -19,14 +19,14 @@ module.exports = function (config) {
|
|||||||
'karma-chrome-launcher',
|
'karma-chrome-launcher',
|
||||||
'karma-firefox-launcher',
|
'karma-firefox-launcher',
|
||||||
'karma-mocha',
|
'karma-mocha',
|
||||||
|
'karma-mocha-reporter',
|
||||||
'karma-sourcemap-loader',
|
'karma-sourcemap-loader',
|
||||||
'karma-spec-reporter',
|
|
||||||
'karma-webpack'
|
'karma-webpack'
|
||||||
],
|
],
|
||||||
preprocessors: {
|
preprocessors: {
|
||||||
[testEntry]: [ 'webpack', 'sourcemap' ]
|
[testEntry]: [ 'webpack', 'sourcemap' ]
|
||||||
},
|
},
|
||||||
reporters: process.env.TRAVIS ? [ 'dots' ] : [ 'spec' ],
|
reporters: process.env.TRAVIS ? [ 'dots' ] : [ 'mocha' ],
|
||||||
singleRun: true,
|
singleRun: true,
|
||||||
webpack: {
|
webpack: {
|
||||||
devtool: 'inline-source-map',
|
devtool: 'inline-source-map',
|
||||||
|
|||||||
+25
-24
@@ -16,42 +16,43 @@
|
|||||||
"test:watch": "npm run test -- --no-single-run"
|
"test:watch": "npm run test -- --no-single-run"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"babel-runtime": "^6.9.2",
|
||||||
"fbjs": "^0.8.1",
|
"fbjs": "^0.8.1",
|
||||||
"inline-style-prefix-all": "1.0.5",
|
"inline-style-prefix-all": "1.0.5",
|
||||||
"lodash.debounce": "^4.0.3",
|
"lodash.debounce": "^4.0.6",
|
||||||
"react-textarea-autosize": "^4.0.2",
|
"react-textarea-autosize": "^4.0.2",
|
||||||
"react-timer-mixin": "^0.13.3"
|
"react-timer-mixin": "^0.13.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-cli": "^6.3.17",
|
"babel-cli": "^6.10.1",
|
||||||
"babel-core": "^6.3.13",
|
"babel-core": "^6.9.1",
|
||||||
"babel-eslint": "^4.1.6",
|
"babel-eslint": "^6.0.4",
|
||||||
"babel-loader": "^6.2.0",
|
"babel-loader": "^6.2.4",
|
||||||
"babel-plugin-transform-decorators-legacy": "^1.3.4",
|
"babel-plugin-transform-decorators-legacy": "^1.3.4",
|
||||||
"babel-preset-es2015": "^6.3.13",
|
"babel-preset-es2015": "^6.9.0",
|
||||||
"babel-preset-react": "^6.3.13",
|
"babel-preset-react": "^6.5.0",
|
||||||
"babel-preset-stage-1": "^6.3.13",
|
"babel-preset-stage-1": "^6.5.0",
|
||||||
"babel-runtime": "^6.3.19",
|
"eslint": "^2.12.0",
|
||||||
"eslint": "^1.10.3",
|
"eslint-config-standard": "^5.3.1",
|
||||||
"eslint-config-standard": "^4.4.0",
|
"eslint-config-standard-react": "^2.4.0",
|
||||||
"eslint-config-standard-react": "^1.2.1",
|
"eslint-plugin-promise": "^1.3.2",
|
||||||
"eslint-plugin-react": "^3.13.1",
|
"eslint-plugin-react": "^5.1.1",
|
||||||
"eslint-plugin-standard": "^1.3.1",
|
"eslint-plugin-standard": "^1.3.2",
|
||||||
"karma": "^0.13.16",
|
"karma": "^0.13.22",
|
||||||
"karma-browserstack-launcher": "^0.1.8",
|
"karma-browserstack-launcher": "^1.0.1",
|
||||||
"karma-chrome-launcher": "^0.2.2",
|
"karma-chrome-launcher": "^1.0.1",
|
||||||
"karma-firefox-launcher": "^0.1.7",
|
"karma-firefox-launcher": "^1.0.0",
|
||||||
"karma-mocha": "^0.2.1",
|
"karma-mocha": "^1.0.1",
|
||||||
"karma-sourcemap-loader": "^0.3.6",
|
"karma-mocha-reporter": "^2.0.4",
|
||||||
"karma-spec-reporter": "0.0.23",
|
"karma-sourcemap-loader": "^0.3.7",
|
||||||
"karma-webpack": "^1.7.0",
|
"karma-webpack": "^1.7.0",
|
||||||
"mocha": "^2.3.4",
|
"mocha": "^2.5.3",
|
||||||
"node-libs-browser": "^0.5.3",
|
"node-libs-browser": "^0.5.3",
|
||||||
"react": "^15.1.0",
|
"react": "^15.1.0",
|
||||||
"react-addons-test-utils": "^15.1.0",
|
"react-addons-test-utils": "^15.1.0",
|
||||||
"react-dom": "^15.1.0",
|
"react-dom": "^15.1.0",
|
||||||
"webpack": "^1.12.9",
|
"webpack": "^1.13.1",
|
||||||
"webpack-dev-server": "^1.14.0"
|
"webpack-dev-server": "^1.14.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "^15.1.0",
|
"react": "^15.1.0",
|
||||||
|
|||||||
@@ -11,25 +11,24 @@ class ReactNativeApp extends Component {
|
|||||||
rootTag: PropTypes.any
|
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() {
|
render() {
|
||||||
const { initialProps, rootComponent: RootComponent, rootTag } = this.props
|
const { initialProps, rootComponent: RootComponent, rootTag } = this.props
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.appContainer}>
|
<View style={styles.appContainer}>
|
||||||
<RootComponent {...initialProps} ref={(c) => { this._root = c }} rootTag={rootTag} />
|
<RootComponent {...initialProps} ref={this._createRootRef} rootTag={rootTag} />
|
||||||
<Portal onModalVisibilityChanged={this._handleModalVisibilityChange} />
|
<Portal onModalVisibilityChanged={this._handleModalVisibilityChange} />
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_createRootRef = (component) => {
|
||||||
|
this._root = component
|
||||||
|
}
|
||||||
|
|
||||||
|
_handleModalVisibilityChange = (modalVisible) => {
|
||||||
|
ReactDOM.findDOMNode(this._root).setAttribute('aria-hidden', `${modalVisible}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class AppRegistry {
|
|||||||
invariant(
|
invariant(
|
||||||
runnables[appKey] && runnables[appKey].prerender,
|
runnables[appKey] && runnables[appKey].prerender,
|
||||||
`Application ${appKey} has not been registered. ` +
|
`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)
|
return runnables[appKey].prerender(appParameters)
|
||||||
@@ -78,7 +78,7 @@ class AppRegistry {
|
|||||||
invariant(
|
invariant(
|
||||||
runnables[appKey] && runnables[appKey].run,
|
runnables[appKey] && runnables[appKey].run,
|
||||||
`Application "${appKey}" has not been registered. ` +
|
`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)
|
runnables[appKey].run(appParameters)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ suite('apis/StyleSheet', () => {
|
|||||||
`${resetCSS}\n${predefinedCSS}\n` +
|
`${resetCSS}\n${predefinedCSS}\n` +
|
||||||
`/* 2 unique declarations */\n` +
|
`/* 2 unique declarations */\n` +
|
||||||
`.__style1{opacity:1;}\n` +
|
`.__style1{opacity:1;}\n` +
|
||||||
`.__style2{color:red;}`
|
'.__style2{color:red;}'
|
||||||
)
|
)
|
||||||
|
|
||||||
// teardown
|
// teardown
|
||||||
@@ -45,7 +45,7 @@ suite('apis/StyleSheet', () => {
|
|||||||
StyleSheet.renderToString(),
|
StyleSheet.renderToString(),
|
||||||
`${resetCSS}\n${predefinedCSS}\n` +
|
`${resetCSS}\n${predefinedCSS}\n` +
|
||||||
`/* 1 unique declarations */\n` +
|
`/* 1 unique declarations */\n` +
|
||||||
`.__style1{opacity:1;}`
|
'.__style1{opacity:1;}'
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class ActivityIndicator extends Component {
|
|||||||
return (
|
return (
|
||||||
<View {...other} style={[ styles.container, style ]}>
|
<View {...other} style={[ styles.container, style ]}>
|
||||||
<View
|
<View
|
||||||
ref={(c) => { this._indicatorRef = c }}
|
ref={this._createIndicatorRef}
|
||||||
style={[
|
style={[
|
||||||
indicatorStyles[size],
|
indicatorStyles[size],
|
||||||
hidesWhenStopped && !animating && styles.hidesWhenStopped,
|
hidesWhenStopped && !animating && styles.hidesWhenStopped,
|
||||||
@@ -72,6 +72,10 @@ class ActivityIndicator extends Component {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_createIndicatorRef = (component) => {
|
||||||
|
this._indicatorRef = component
|
||||||
|
}
|
||||||
|
|
||||||
_manageAnimation() {
|
_manageAnimation() {
|
||||||
if (this._player) {
|
if (this._player) {
|
||||||
if (this.props.animating) {
|
if (this.props.animating) {
|
||||||
|
|||||||
@@ -22,14 +22,16 @@ class Text extends Component {
|
|||||||
accessible: true
|
accessible: true
|
||||||
};
|
};
|
||||||
|
|
||||||
_onPress(e) {
|
_onPress = (e) => {
|
||||||
if (this.props.onPress) this.props.onPress(e)
|
if (this.props.onPress) this.props.onPress(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
numberOfLines,
|
numberOfLines,
|
||||||
|
/* eslint-disable no-unused-vars */
|
||||||
onPress,
|
onPress,
|
||||||
|
/* eslint-enable no-unused-vars */
|
||||||
style,
|
style,
|
||||||
...other
|
...other
|
||||||
} = this.props
|
} = this.props
|
||||||
@@ -38,7 +40,7 @@ class Text extends Component {
|
|||||||
<CoreComponent
|
<CoreComponent
|
||||||
{...other}
|
{...other}
|
||||||
component='span'
|
component='span'
|
||||||
onClick={this._onPress.bind(this)}
|
onClick={this._onPress}
|
||||||
style={[
|
style={[
|
||||||
styles.initial,
|
styles.initial,
|
||||||
style,
|
style,
|
||||||
|
|||||||
Reference in New Issue
Block a user