Skip to content

Commit 1e5fe57

Browse files
committed
Updates deps, switches to npm, updates to node 8, switches to prettier + eslint.
1 parent 33d992c commit 1e5fe57

13 files changed

+9098
-5090
lines changed

.eslintrc

-34
This file was deleted.

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.10.1
1+
8

.travis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
sudo: false
22
language: node_js
33
cache:
4-
yarn: true
4+
npm: true
55
directories:
66
- node_modules
77
node_js:
8-
- '6'
8+
- '8'
99
script:
1010
# Unfortunately flow falls over when a dep exists in peer deps and others. :(
1111
# @see https://github.com/flowtype/flow-typed/issues/528
1212
#- yarn run flow:defs
13-
- yarn run check
13+
- npm run check
1414
after_success:
1515
# Deploy code coverage report to codecov.io
16-
- yarn run test:coverage:deploy
16+
- npm run test:coverage:deploy

commonjs/asyncComponent.js

+14-9
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,10 @@ function asyncComponent(config) {
5757
error: null,
5858
// Allows us to share the resolver promise across instances.
5959
resolver: null
60-
};
6160

62-
// Takes the given module and if it has a ".default" the ".default" will
63-
// be returned. i.e. handy when you could be dealing with es6 imports.
64-
var es6Resolve = function es6Resolve(x) {
61+
// Takes the given module and if it has a ".default" the ".default" will
62+
// be returned. i.e. handy when you could be dealing with es6 imports.
63+
};var es6Resolve = function es6Resolve(x) {
6564
return autoResolveES2015Default && x != null && (typeof x === 'function' || (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object') && x.default ? x.default : x;
6665
};
6766

@@ -141,7 +140,9 @@ function asyncComponent(config) {
141140
}, {
142141
key: 'componentWillMount',
143142
value: function componentWillMount() {
144-
this.setState({ module: sharedState.module });
143+
this.setState({
144+
module: sharedState.module
145+
});
145146
if (sharedState.error) {
146147
this.registerErrorState(sharedState.error);
147148
}
@@ -169,7 +170,9 @@ function asyncComponent(config) {
169170
}
170171
sharedState.module = module;
171172
if (env === 'browser') {
172-
_this3.setState({ module: module });
173+
_this3.setState({
174+
module: module
175+
});
173176
}
174177
_this3.resolving = false;
175178
return module;
@@ -204,7 +207,9 @@ function asyncComponent(config) {
204207
if (env === 'browser') {
205208
setTimeout(function () {
206209
if (!_this4.unmounted) {
207-
_this4.setState({ error: error });
210+
_this4.setState({
211+
error: error
212+
});
208213
}
209214
}, 16);
210215
}
@@ -230,7 +235,6 @@ function asyncComponent(config) {
230235
}
231236

232237
var Component = es6Resolve(module);
233-
// eslint-disable-next-line no-nested-ternary
234238
return Component ? _react2.default.createElement(Component, this.props) : LoadingComponent ? _react2.default.createElement(LoadingComponent, this.props) : null;
235239
}
236240
}]);
@@ -239,6 +243,7 @@ function asyncComponent(config) {
239243
}(_react2.default.Component);
240244

241245
AsyncComponent.displayName = name || 'AsyncComponent';
246+
242247
AsyncComponent.contextTypes = {
243248
asyncComponentsAncestor: _propTypes2.default.shape({
244249
isBoundary: _propTypes2.default.bool
@@ -249,13 +254,13 @@ function asyncComponent(config) {
249254
shouldRehydrate: _propTypes2.default.func.isRequired
250255
})
251256
};
257+
252258
AsyncComponent.childContextTypes = {
253259
asyncComponentsAncestor: _propTypes2.default.shape({
254260
isBoundary: _propTypes2.default.bool
255261
})
256262
};
257263

258-
259264
return AsyncComponent;
260265
}
261266

0 commit comments

Comments
 (0)