mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Code cleanup (#3131)
This commit is contained in:
parent
28bd31a125
commit
58affc53dc
5 changed files with 5 additions and 6 deletions
|
|
@ -93,7 +93,7 @@ if (isDev) {
|
||||||
//eslint-disable-next-line no-console
|
//eslint-disable-next-line no-console
|
||||||
console.log('running in dev mode');
|
console.log('running in dev mode');
|
||||||
|
|
||||||
// Overide default appVersion which is set from package.json
|
// Override default appVersion which is set from package.json
|
||||||
gitDescribe({customArguments: ['--tags']}, (error, gitInfo) => {
|
gitDescribe({customArguments: ['--tags']}, (error, gitInfo) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
app.setVersion(gitInfo.raw);
|
app.setVersion(gitInfo.raw);
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ module.exports = class Window {
|
||||||
|
|
||||||
// app.windowCallback is the createWindow callback
|
// app.windowCallback is the createWindow callback
|
||||||
// that can be set before the 'ready' app event
|
// that can be set before the 'ready' app event
|
||||||
// and createWindow deifinition. It's executed in place of
|
// and createWindow definition. It's executed in place of
|
||||||
// the callback passed as parameter, and deleted right after.
|
// the callback passed as parameter, and deleted right after.
|
||||||
(app.windowCallback || fn)(window);
|
(app.windowCallback || fn)(window);
|
||||||
delete app.windowCallback;
|
delete app.windowCallback;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ const retry = require('async-retry');
|
||||||
|
|
||||||
// Utilities
|
// Utilities
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const notify = require('./notify');
|
|
||||||
const {version} = require('./package');
|
const {version} = require('./package');
|
||||||
const {getDecoratedConfig} = require('./plugins');
|
const {getDecoratedConfig} = require('./plugins');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,6 @@ exports.installCLI = withNotification => {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
withNotification &&
|
withNotification &&
|
||||||
notify('Hyper CLI instalation', 'Command is added in PATH only at package installation. Please reinstall.');
|
notify('Hyper CLI installation', 'Command is added in PATH only at package installation. Please reinstall.');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ Module._load = function _load(path) {
|
||||||
case 'hyper/component':
|
case 'hyper/component':
|
||||||
//eslint-disable-next-line no-console
|
//eslint-disable-next-line no-console
|
||||||
console.warn(
|
console.warn(
|
||||||
'DEPRECATED: If your plugin requires `hyper/component`, it must requires `react.PureComponent` instead and bundle `react` as a dependcy'
|
'DEPRECATED: If your plugin requires `hyper/component`, it must requires `react.PureComponent` instead and bundle `react` as a dependency'
|
||||||
);
|
);
|
||||||
return PureComponent;
|
return PureComponent;
|
||||||
case 'hyper/notify':
|
case 'hyper/notify':
|
||||||
|
|
@ -508,7 +508,7 @@ export function decorate(Component_, name) {
|
||||||
}
|
}
|
||||||
componentDidCatch() {
|
componentDidCatch() {
|
||||||
this.setState({hasError: true});
|
this.setState({hasError: true});
|
||||||
// No need to detail this error because React print those informations.
|
// No need to detail this error because React print these information.
|
||||||
notify(
|
notify(
|
||||||
'Plugin error',
|
'Plugin error',
|
||||||
`Plugins decorating ${name} has been disabled because of a plugin crash. Check Developer Tools for details.`
|
`Plugins decorating ${name} has been disabled because of a plugin crash. Check Developer Tools for details.`
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue