backend-app-api: deprecate callback form of backend.add(...)

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-07-10 13:30:14 +02:00
parent f691c9bf75
commit 18b96b15ed
3 changed files with 22 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-app-api': patch
---
The ability to install backend features in callback form (`() => BackendFeature`) has been deprecated. This typically means that you need to update the installed features to use the latest version of `@backstage/backend-plugin-api`. If the feature is from a third-party package, please reach out to the package maintainer to update it.
+8 -1
View File
@@ -58,9 +58,16 @@ export interface Backend {
add(
feature:
| BackendFeature
| Promise<{
default: BackendFeature;
}>,
): void;
// @deprecated (undocumented)
add(
feature:
| (() => BackendFeature)
| Promise<{
default: BackendFeature | (() => BackendFeature);
default: () => BackendFeature;
}>,
): void;
// (undocumented)
+9 -2
View File
@@ -25,11 +25,18 @@ import {
* @public
*/
export interface Backend {
add(feature: BackendFeature | Promise<{ default: BackendFeature }>): void;
/**
* @deprecated The ability to add features defined as a callback is being
* removed. Please update the installed feature to no longer be defined as a
* callback, typically this means updating it to use the latest version of
* `@backstage/backend-plugin-api`. If the feature is from a third-party
* package, please reach out to the package maintainer to update it.
*/
add(
feature:
| BackendFeature
| (() => BackendFeature)
| Promise<{ default: BackendFeature | (() => BackendFeature) }>,
| Promise<{ default: () => BackendFeature }>,
): void;
start(): Promise<void>;
stop(): Promise<void>;