mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Change signature of Plugin.stop
to maybe async (#170225)
## Summary Fix https://github.com/elastic/kibana/issues/83612 This PR doesn't change any behavior, as we're already supporting (and awaiting) promises returned from `stop` calls to plugin, it just changes the type's signature to reflect that. Also removed empty `stop` methods from existing plugins to make typescript happy. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
9def79267c
commit
d64e246cb7
9 changed files with 7 additions and 25 deletions
|
@ -83,8 +83,4 @@ export class FeatureControlsPluginExample
|
|||
start() {
|
||||
return {};
|
||||
}
|
||||
|
||||
stop() {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,8 +76,4 @@ export class UserProfilesPlugin implements Plugin<void, void, SetupDeps, StartDe
|
|||
start() {
|
||||
return {};
|
||||
}
|
||||
|
||||
stop() {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
import type { MaybePromise } from '@kbn/utility-types';
|
||||
import type { CoreStart, CoreSetup } from '@kbn/core-lifecycle-browser';
|
||||
|
||||
/**
|
||||
|
@ -23,5 +24,5 @@ export interface Plugin<
|
|||
|
||||
start(core: CoreStart, plugins: TPluginsStart): TStart;
|
||||
|
||||
stop?(): void;
|
||||
stop?(): MaybePromise<void>;
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"@kbn/core-base-common",
|
||||
"@kbn/core-lifecycle-browser",
|
||||
"@kbn/logging",
|
||||
"@kbn/utility-types",
|
||||
],
|
||||
"exclude": [
|
||||
"target/**/*",
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import { Observable } from 'rxjs';
|
||||
import { Type } from '@kbn/config-schema';
|
||||
import type { RecursiveReadonly } from '@kbn/utility-types';
|
||||
import type { RecursiveReadonly, MaybePromise } from '@kbn/utility-types';
|
||||
import type { PathConfigType } from '@kbn/utils';
|
||||
import type { LoggerFactory } from '@kbn/logging';
|
||||
import type {
|
||||
|
@ -297,7 +297,7 @@ export interface Plugin<
|
|||
|
||||
start(core: CoreStart, plugins: TPluginsStart): TStart;
|
||||
|
||||
stop?(): void;
|
||||
stop?(): MaybePromise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -317,7 +317,7 @@ export interface AsyncPlugin<
|
|||
|
||||
start(core: CoreStart, plugins: TPluginsStart): TStart | Promise<TStart>;
|
||||
|
||||
stop?(): void;
|
||||
stop?(): MaybePromise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -73,8 +73,4 @@ export class DataViewEditorPlugin
|
|||
},
|
||||
};
|
||||
}
|
||||
|
||||
public stop() {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,8 +55,4 @@ export class IndexPatternFieldEditorPlugin
|
|||
DeleteRuntimeFieldProvider: getDeleteFieldProvider(openDeleteModal),
|
||||
};
|
||||
}
|
||||
|
||||
public stop() {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,8 +22,4 @@ export class RuntimeFieldsPlugin
|
|||
public start(core: CoreStart, plugins: StartPlugins) {
|
||||
return {};
|
||||
}
|
||||
|
||||
public stop() {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -348,7 +348,7 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S
|
|||
public stop() {
|
||||
this.queryService.stop();
|
||||
licenseService.stop();
|
||||
return this.contract.getStopContract();
|
||||
this.contract.getStopContract();
|
||||
}
|
||||
|
||||
private lazyHelpersForRoutes() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue