diff --git a/.changeset/giant-phones-melt.md b/.changeset/giant-phones-melt.md new file mode 100644 index 0000000000..1506e2d0f3 --- /dev/null +++ b/.changeset/giant-phones-melt.md @@ -0,0 +1,5 @@ +--- +'@backstage/frontend-test-utils': minor +--- + +**BREAKING**: Removed deprecated `setupRequestMockHandlers` which was replaced by `registerMswTestHooks`. diff --git a/.changeset/honest-ravens-stare.md b/.changeset/honest-ravens-stare.md new file mode 100644 index 0000000000..7b78ce4357 --- /dev/null +++ b/.changeset/honest-ravens-stare.md @@ -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. diff --git a/.changeset/itchy-shoes-rest.md b/.changeset/itchy-shoes-rest.md new file mode 100644 index 0000000000..3e40fab36e --- /dev/null +++ b/.changeset/itchy-shoes-rest.md @@ -0,0 +1,5 @@ +--- +'@backstage/frontend-plugin-api': minor +--- + +**BREAKING**: Removed the deprecated `ExtensionOverrides` and `FrontendFeature` types. diff --git a/.changeset/lazy-deers-dance.md b/.changeset/lazy-deers-dance.md new file mode 100644 index 0000000000..80adcbaa14 --- /dev/null +++ b/.changeset/lazy-deers-dance.md @@ -0,0 +1,5 @@ +--- +'@backstage/frontend-plugin-api': minor +--- + +**BREAKING**: Removed deprecated variant of `createExtensionDataRef` where the ID is passed directly. diff --git a/packages/core-compat-api/report.api.md b/packages/core-compat-api/report.api.md index 50aec1f646..9f7582db03 100644 --- a/packages/core-compat-api/report.api.md +++ b/packages/core-compat-api/report.api.md @@ -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?: { diff --git a/packages/core-compat-api/src/convertLegacyApp.ts b/packages/core-compat-api/src/convertLegacyApp.ts index f098d090ed..52efc96ee2 100644 --- a/packages/core-compat-api/src/convertLegacyApp.ts +++ b/packages/core-compat-api/src/convertLegacyApp.ts @@ -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); } diff --git a/packages/frontend-app-api/report.api.md b/packages/frontend-app-api/report.api.md index d3c2045f85..bdc9caaa0b 100644 --- a/packages/frontend-app-api/report.api.md +++ b/packages/frontend-app-api/report.api.md @@ -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; ``` diff --git a/packages/frontend-app-api/src/wiring/types.ts b/packages/frontend-app-api/src/wiring/types.ts index 18d9c51d0e..6699f1c272 100644 --- a/packages/frontend-app-api/src/wiring/types.ts +++ b/packages/frontend-app-api/src/wiring/types.ts @@ -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 = { diff --git a/packages/frontend-defaults/src/discovery.ts b/packages/frontend-defaults/src/discovery.ts index e82f2acfda..398d8a204f 100644 --- a/packages/frontend-defaults/src/discovery.ts +++ b/packages/frontend-defaults/src/discovery.ts @@ -88,11 +88,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; diff --git a/packages/frontend-plugin-api/report.api.md b/packages/frontend-plugin-api/report.api.md index 52d0276952..3ae6451627 100644 --- a/packages/frontend-plugin-api/report.api.md +++ b/packages/frontend-plugin-api/report.api.md @@ -610,11 +610,6 @@ export type CreateExtensionBlueprintOptions< dataRefs?: TDataRefs; } & VerifyExtensionFactoryOutput; -// @public @deprecated (undocumented) -export function createExtensionDataRef( - id: string, -): ConfigurableExtensionDataRef; - // @public (undocumented) export function createExtensionDataRef(): { with(options: { @@ -1212,12 +1207,6 @@ export interface ExtensionInput< }>; } -// @public (undocumented) -export interface ExtensionOverrides { - // (undocumented) - readonly $$type: '@backstage/ExtensionOverrides'; -} - // @public export interface ExternalRouteRef< TParams extends AnyRouteRefParams = AnyRouteRefParams, @@ -1247,9 +1236,6 @@ export { FetchApi }; export { fetchApiRef }; -// @public @deprecated (undocumented) -export type FrontendFeature = FrontendPlugin | ExtensionOverrides; - // @public (undocumented) export interface FrontendModule { // (undocumented) diff --git a/packages/frontend-plugin-api/src/wiring/createExtensionDataRef.test.ts b/packages/frontend-plugin-api/src/wiring/createExtensionDataRef.test.ts index 4b652298f1..b5acf78384 100644 --- a/packages/frontend-plugin-api/src/wiring/createExtensionDataRef.test.ts +++ b/packages/frontend-plugin-api/src/wiring/createExtensionDataRef.test.ts @@ -29,15 +29,6 @@ describe('createExtensionDataRef', () => { expect(String(refOptional)).toBe('ExtensionDataRef{id=foo,optional=true}'); }); - it('can be created and read in the deprecated way', () => { - const ref = createExtensionDataRef('foo'); - expect(ref.id).toBe('foo'); - expect(String(ref)).toBe('ExtensionDataRef{id=foo,optional=false}'); - const refOptional = ref.optional(); - expect(refOptional.id).toBe('foo'); - expect(String(refOptional)).toBe('ExtensionDataRef{id=foo,optional=true}'); - }); - it('can be used to encapsulate a value', () => { const ref = createExtensionDataRef().with({ id: 'foo' }); const val: ExtensionDataValue = ref('hello'); diff --git a/packages/frontend-plugin-api/src/wiring/createExtensionDataRef.ts b/packages/frontend-plugin-api/src/wiring/createExtensionDataRef.ts index 80413c1688..94acb192a8 100644 --- a/packages/frontend-plugin-api/src/wiring/createExtensionDataRef.ts +++ b/packages/frontend-plugin-api/src/wiring/createExtensionDataRef.ts @@ -60,26 +60,12 @@ export interface ConfigurableExtensionDataRef< (t: TData): ExtensionDataValue; } -/** - * @public - * @deprecated Use the following form instead: `createExtensionDataRef().with({ id: 'core.foo' })` - */ -export function createExtensionDataRef( - id: string, -): ConfigurableExtensionDataRef; /** @public */ export function createExtensionDataRef(): { with(options: { id: TId; }): ConfigurableExtensionDataRef; -}; -export function createExtensionDataRef(id?: string): - | ConfigurableExtensionDataRef - | { - with(options: { - id: TId; - }): ConfigurableExtensionDataRef; - } { +} { const createRef = (refId: TId) => Object.assign( (value: TData): ExtensionDataValue => ({ @@ -103,9 +89,6 @@ export function createExtensionDataRef(id?: string): }, } as ConfigurableExtensionDataRef, ); - if (id) { - return createRef(id); - } return { with(options: { id: TId }) { return createRef(options.id); diff --git a/packages/frontend-plugin-api/src/wiring/index.ts b/packages/frontend-plugin-api/src/wiring/index.ts index 6dec88b5f4..b5cefc75fb 100644 --- a/packages/frontend-plugin-api/src/wiring/index.ts +++ b/packages/frontend-plugin-api/src/wiring/index.ts @@ -51,9 +51,7 @@ export { type AnyRoutes, type AnyExternalRoutes, type ExtensionDataContainer, - type ExtensionOverrides, type FeatureFlagConfig, - type FrontendFeature, type ExtensionFactoryMiddleware, } from './types'; export { diff --git a/packages/frontend-plugin-api/src/wiring/types.ts b/packages/frontend-plugin-api/src/wiring/types.ts index 3aba32d9fc..6d3e7a4abd 100644 --- a/packages/frontend-plugin-api/src/wiring/types.ts +++ b/packages/frontend-plugin-api/src/wiring/types.ts @@ -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(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 = Iterable< diff --git a/packages/frontend-test-utils/report.api.md b/packages/frontend-test-utils/report.api.md index fd6aba0223..e14c971419 100644 --- a/packages/frontend-test-utils/report.api.md +++ b/packages/frontend-test-utils/report.api.md @@ -120,13 +120,6 @@ export function renderInTestApp( options?: TestAppOptions, ): RenderResult; -// @public @deprecated (undocumented) -export function setupRequestMockHandlers(worker: { - listen: (t: any) => void; - close: () => void; - resetHandlers: () => void; -}): void; - export { TestApiProvider }; export { TestApiProviderProps }; diff --git a/packages/frontend-test-utils/src/deprecated.ts b/packages/frontend-test-utils/src/deprecated.ts deleted file mode 100644 index 1b67f73e6b..0000000000 --- a/packages/frontend-test-utils/src/deprecated.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2024 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { registerMswTestHooks } from '@backstage/test-utils'; - -/** - * @public - * @deprecated Use `registerMswTestHooks` from `@backstage/frontend-test-utils` instead. - */ -export function setupRequestMockHandlers(worker: { - listen: (t: any) => void; - close: () => void; - resetHandlers: () => void; -}): void { - registerMswTestHooks(worker); -} diff --git a/packages/frontend-test-utils/src/index.ts b/packages/frontend-test-utils/src/index.ts index 20f393706e..cab66895e0 100644 --- a/packages/frontend-test-utils/src/index.ts +++ b/packages/frontend-test-utils/src/index.ts @@ -20,7 +20,6 @@ * Contains utilities that can be used when testing frontend features such as extensions. */ -export * from './deprecated'; export * from './apis'; export * from './app';