frontend-plugin-api: cleanup of old plugin and extension overrides types

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2025-03-11 00:14:34 +01:00
parent bba525be4d
commit 8250ffe64e
10 changed files with 17 additions and 47 deletions
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/frontend-defaults': minor
'@backstage/frontend-app-api': minor
'@backstage/core-compat-api': minor
---
**BREAKING**: Dropped support for the removed opaque `@backstage/ExtensionOverrides` and `@backstage/BackstagePlugin` types.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/frontend-plugin-api': minor
---
**BREAKING**: Removed the deprecated `ExtensionOverrides` and `FrontendFeature` types.
+1 -2
View File
@@ -14,7 +14,6 @@ import { AppTheme } from '@backstage/core-plugin-api';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { ComponentType } from 'react';
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
import { ExtensionOverrides } from '@backstage/frontend-plugin-api';
import { ExternalRouteRef } from '@backstage/core-plugin-api';
import { ExternalRouteRef as ExternalRouteRef_2 } from '@backstage/frontend-plugin-api';
import { FeatureFlag } from '@backstage/core-plugin-api';
@@ -34,7 +33,7 @@ export function compatWrapper(element: ReactNode): React_2.JSX.Element;
// @public (undocumented)
export function convertLegacyApp(
rootElement: React_2.JSX.Element,
): (FrontendPlugin | FrontendModule | ExtensionOverrides)[];
): (FrontendPlugin | FrontendModule)[];
// @public (undocumented)
export function convertLegacyAppOptions(options?: {
@@ -26,7 +26,6 @@ import {
FrontendPlugin,
coreExtensionData,
createExtension,
ExtensionOverrides,
createExtensionInput,
createFrontendModule,
} from '@backstage/frontend-plugin-api';
@@ -63,7 +62,7 @@ function selectChildren(
/** @public */
export function convertLegacyApp(
rootElement: React.JSX.Element,
): (FrontendPlugin | FrontendModule | ExtensionOverrides)[] {
): (FrontendPlugin | FrontendModule)[] {
if (getComponentData(rootElement, 'core.type') === 'FlatRoutes') {
return collectLegacyRoutes(rootElement);
}
+1 -9
View File
@@ -41,13 +41,5 @@ export function createSpecializedApp(options?: {
};
// @public (undocumented)
export type FrontendFeature =
| FrontendPlugin
| FrontendModule
| {
$$type: '@backstage/ExtensionOverrides';
}
| {
$$type: '@backstage/BackstagePlugin';
};
export type FrontendFeature = FrontendPlugin | FrontendModule;
```
@@ -18,12 +18,7 @@ import { FrontendModule, FrontendPlugin } from '@backstage/frontend-plugin-api';
import { BackstageRouteObject } from '../routing/types';
/** @public */
export type FrontendFeature =
| FrontendPlugin
| FrontendModule
// TODO(blam): This is just forwards backwards compatibility, remove after v1.31.0
| { $$type: '@backstage/ExtensionOverrides' }
| { $$type: '@backstage/BackstagePlugin' };
export type FrontendFeature = FrontendPlugin | FrontendModule;
/** @internal */
export type RouteInfo = {
+1 -5
View File
@@ -85,11 +85,7 @@ function isBackstageFeature(obj: unknown): obj is FrontendFeature {
if (obj !== null && typeof obj === 'object' && '$$type' in obj) {
return (
obj.$$type === '@backstage/FrontendPlugin' ||
obj.$$type === '@backstage/FrontendModule' ||
// TODO: Remove this once the old plugin type and extension overrides
// are no longer supported
obj.$$type === '@backstage/BackstagePlugin' ||
obj.$$type === '@backstage/ExtensionOverrides'
obj.$$type === '@backstage/FrontendModule'
);
}
return false;
@@ -1207,12 +1207,6 @@ export interface ExtensionInput<
}>;
}
// @public (undocumented)
export interface ExtensionOverrides {
// (undocumented)
readonly $$type: '@backstage/ExtensionOverrides';
}
// @public
export interface ExternalRouteRef<
TParams extends AnyRouteRefParams = AnyRouteRefParams,
@@ -1242,9 +1236,6 @@ export { FetchApi };
export { fetchApiRef };
// @public @deprecated (undocumented)
export type FrontendFeature = FrontendPlugin | ExtensionOverrides;
// @public (undocumented)
export interface FrontendModule {
// (undocumented)
@@ -51,9 +51,7 @@ export {
type AnyRoutes,
type AnyExternalRoutes,
type ExtensionDataContainer,
type ExtensionOverrides,
type FeatureFlagConfig,
type FrontendFeature,
type ExtensionFactoryMiddleware,
} from './types';
export {
@@ -22,7 +22,6 @@ import {
ExtensionDataRef,
ExtensionDataValue,
} from './createExtensionDataRef';
import { FrontendPlugin } from './createFrontendPlugin';
import { ApiHolder, AppNode } from '../apis';
/**
@@ -48,17 +47,6 @@ export type ExtensionMap<
get<TId extends keyof TExtensionMap>(id: TId): TExtensionMap[TId];
};
/** @public */
export interface ExtensionOverrides {
readonly $$type: '@backstage/ExtensionOverrides';
}
/**
* @public
* @deprecated import from {@link @backstage/frontend-app-api#FrontendFeature} instead
*/
export type FrontendFeature = FrontendPlugin | ExtensionOverrides;
/** @public */
export type ExtensionDataContainer<UExtensionData extends AnyExtensionDataRef> =
Iterable<