Remove export of createLifecycleMiddleware and LifecycleMiddlewareOptions

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2024-09-09 14:52:33 +02:00
parent baeef13ec0
commit 09f16b8a7d
4 changed files with 3 additions and 22 deletions
+1 -1
View File
@@ -2,4 +2,4 @@
'@backstage/backend-defaults': minor
---
Deprecated `createLifecycleMiddleware` to clean up API surface, it has no external references, let us know if you use this directly.
**BREAKING** Removed `createLifecycleMiddleware` and `LifecycleMiddlewareOptions` to clean up API surface. These exports have no external usage and do not provide value in its current form. If you were using these exports, please reach out to the maintainers to discuss your use case.
@@ -4,16 +4,8 @@
```ts
import { HttpRouterService } from '@backstage/backend-plugin-api';
import { HumanDuration } from '@backstage/types';
import { LifecycleService } from '@backstage/backend-plugin-api';
import { RequestHandler } from 'express';
import { ServiceFactory } from '@backstage/backend-plugin-api';
// @public @deprecated
export function createLifecycleMiddleware(
options: LifecycleMiddlewareOptions,
): RequestHandler;
// @public
export const httpRouterServiceFactory: ServiceFactory<
HttpRouterService,
@@ -21,12 +13,5 @@ export const httpRouterServiceFactory: ServiceFactory<
'singleton'
>;
// @public
export interface LifecycleMiddlewareOptions {
// (undocumented)
lifecycle: LifecycleService;
startupRequestPauseTimeout?: HumanDuration;
}
// (No @packageDocumentation comment for this package)
```
@@ -23,7 +23,7 @@ export const DEFAULT_TIMEOUT = { seconds: 5 };
/**
* Options for {@link createLifecycleMiddleware}.
* @public
* @internal
*/
export interface LifecycleMiddlewareOptions {
lifecycle: LifecycleService;
@@ -47,9 +47,7 @@ export interface LifecycleMiddlewareOptions {
* If the service is shutting down, all requests will be rejected with a
* {@link @backstage/errors#ServiceUnavailableError}.
*
* @public
* @deprecated This function export will be removed in a future release.
* If rely on this function then please reach out to the Backstage maintainers.
* @internal
*/
export function createLifecycleMiddleware(
options: LifecycleMiddlewareOptions,
@@ -15,5 +15,3 @@
*/
export { httpRouterServiceFactory } from './httpRouterServiceFactory';
export { createLifecycleMiddleware } from './createLifecycleMiddleware';
export type { LifecycleMiddlewareOptions } from './createLifecycleMiddleware';