From 14fb681b04140aaf17209cafbc2ed9386b04d5be Mon Sep 17 00:00:00 2001 From: "Christiane (Tina) Heiligers" Date: Wed, 9 Oct 2024 10:12:52 -0700 Subject: [PATCH] Update deprecations carried over from 8 (#195491) Fix https://github.com/elastic/kibana/issues/142915 ### Risk Matrix | Risk | Probability | Severity | Mitigation/Notes | |---------------------------|-------------|----------|-------------------------| | Third party plugin types throw type errors | Low | Low | type checks will error when using a deprecated type. Plugin authors should extend the supported types or define new ones inline | ### For maintainers - [X] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) (no breaking changes) (cherry picked from commit 5ed13ee4a4b4325bae2f3e117a4fc400540fa542) --- .../core-application-browser/src/app_mount.ts | 2 +- .../src/contracts.ts | 2 +- .../src/plugin.ts | 4 +--- .../core/plugins/core-plugins-server/index.ts | 1 - .../plugins/core-plugins-server/src/index.ts | 1 - .../plugins/core-plugins-server/src/types.ts | 24 +------------------ src/core/server/index.ts | 1 - 7 files changed, 4 insertions(+), 31 deletions(-) diff --git a/packages/core/application/core-application-browser/src/app_mount.ts b/packages/core/application/core-application-browser/src/app_mount.ts index a34550bc98fcd..4fb38b10a3704 100644 --- a/packages/core/application/core-application-browser/src/app_mount.ts +++ b/packages/core/application/core-application-browser/src/app_mount.ts @@ -89,7 +89,7 @@ export interface AppMountParameters { * This string should not include the base path from HTTP. * * @deprecated Use {@link AppMountParameters.history} instead. - * @removeBy 8.8.0 + * remove after https://github.com/elastic/kibana/issues/132600 is done * * @example * diff --git a/packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts b/packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts index bc712a61a535e..4e0bd253eb8b4 100644 --- a/packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts +++ b/packages/core/elasticsearch/core-elasticsearch-server/src/contracts.ts @@ -81,7 +81,7 @@ export interface ElasticsearchServiceSetup { setUnauthorizedErrorHandler: (handler: UnauthorizedErrorHandler) => void; /** - * @deprecated + * @deprecated Can be removed when https://github.com/elastic/kibana/issues/119862 is done. */ legacy: { /** diff --git a/packages/core/plugins/core-plugins-server-internal/src/plugin.ts b/packages/core/plugins/core-plugins-server-internal/src/plugin.ts index 8837cb24083d6..cd330a647da66 100644 --- a/packages/core/plugins/core-plugins-server-internal/src/plugin.ts +++ b/packages/core/plugins/core-plugins-server-internal/src/plugin.ts @@ -15,7 +15,6 @@ import { isConfigSchema } from '@kbn/config-schema'; import type { Logger } from '@kbn/logging'; import { type PluginOpaqueId, PluginType } from '@kbn/core-base-common'; import type { - AsyncPlugin, Plugin, PluginConfigDescriptor, PluginInitializer, @@ -58,8 +57,7 @@ export class PluginWrapper< private instance?: | Plugin - | PrebootPlugin - | AsyncPlugin; + | PrebootPlugin; private readonly startDependencies$ = new Subject<[CoreStart, TPluginsStart, TStart]>(); public readonly startDependencies = firstValueFrom(this.startDependencies$); diff --git a/packages/core/plugins/core-plugins-server/index.ts b/packages/core/plugins/core-plugins-server/index.ts index b2c6057c4a1ac..a5fd0fd2e2ec3 100644 --- a/packages/core/plugins/core-plugins-server/index.ts +++ b/packages/core/plugins/core-plugins-server/index.ts @@ -10,7 +10,6 @@ export type { PrebootPlugin, Plugin, - AsyncPlugin, PluginConfigDescriptor, PluginConfigSchema, PluginInitializer, diff --git a/packages/core/plugins/core-plugins-server/src/index.ts b/packages/core/plugins/core-plugins-server/src/index.ts index 35b1b7c11d422..e48d077389ece 100644 --- a/packages/core/plugins/core-plugins-server/src/index.ts +++ b/packages/core/plugins/core-plugins-server/src/index.ts @@ -10,7 +10,6 @@ export type { PrebootPlugin, Plugin, - AsyncPlugin, PluginConfigDescriptor, PluginConfigSchema, PluginInitializer, diff --git a/packages/core/plugins/core-plugins-server/src/types.ts b/packages/core/plugins/core-plugins-server/src/types.ts index 6da8b2727733e..7be2647ba48d2 100644 --- a/packages/core/plugins/core-plugins-server/src/types.ts +++ b/packages/core/plugins/core-plugins-server/src/types.ts @@ -301,26 +301,6 @@ export interface Plugin< stop?(): MaybePromise; } -/** - * A plugin with asynchronous lifecycle methods. - * - * @deprecated Asynchronous lifecycles are deprecated, and should be migrated to sync {@link Plugin | plugin} - * @removeBy 8.8.0 - * @public - */ -export interface AsyncPlugin< - TSetup = void, - TStart = void, - TPluginsSetup extends object = object, - TPluginsStart extends object = object -> { - setup(core: CoreSetup, plugins: TPluginsSetup): TSetup | Promise; - - start(core: CoreStart, plugins: TPluginsStart): TStart | Promise; - - stop?(): MaybePromise; -} - /** * @public */ @@ -478,7 +458,5 @@ export type PluginInitializer< > = ( core: PluginInitializerContext ) => Promise< - | Plugin - | PrebootPlugin - | AsyncPlugin + Plugin | PrebootPlugin >; diff --git a/src/core/server/index.ts b/src/core/server/index.ts index f4852bdc97fe3..1ac38b1d44157 100644 --- a/src/core/server/index.ts +++ b/src/core/server/index.ts @@ -267,7 +267,6 @@ export { PluginType } from '@kbn/core-base-common'; export type { PrebootPlugin, Plugin, - AsyncPlugin, PluginConfigDescriptor, PluginConfigSchema, PluginInitializer,