Merge pull request #26412 from backstage/jhaals/cleanup-httpRouter

backend-defaults: deprecate createLifecycleMiddleware
This commit is contained in:
Patrik Oldsberg
2024-09-10 16:48:52 +03:00
committed by GitHub
4 changed files with 7 additions and 19 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-defaults': minor
---
**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
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,7 +47,7 @@ export interface LifecycleMiddlewareOptions {
* If the service is shutting down, all requests will be rejected with a
* {@link @backstage/errors#ServiceUnavailableError}.
*
* @public
* @internal
*/
export function createLifecycleMiddleware(
options: LifecycleMiddlewareOptions,
@@ -15,5 +15,3 @@
*/
export { httpRouterServiceFactory } from './httpRouterServiceFactory';
export { createLifecycleMiddleware } from './createLifecycleMiddleware';
export type { LifecycleMiddlewareOptions } from './createLifecycleMiddleware';