From 28311eb02fce0793dded14179b11bd31e3c35fc0 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 19 Aug 2024 15:15:29 +0200 Subject: [PATCH] update API reports for v1 extension removal Signed-off-by: Patrik Oldsberg --- packages/frontend-plugin-api/api-report.md | 496 ++------------------- plugins/catalog-react/api-report-alpha.md | 98 ---- plugins/catalog/api-report-alpha.md | 24 - plugins/search-react/api-report-alpha.md | 53 --- 4 files changed, 30 insertions(+), 641 deletions(-) diff --git a/packages/frontend-plugin-api/api-report.md b/packages/frontend-plugin-api/api-report.md index a6ca3f3aff..384c14fb17 100644 --- a/packages/frontend-plugin-api/api-report.md +++ b/packages/frontend-plugin-api/api-report.md @@ -89,8 +89,6 @@ import { useTranslationRef } from '@backstage/core-plugin-api/alpha'; import { vmwareCloudAuthApiRef } from '@backstage/core-plugin-api'; import { withApis } from '@backstage/core-plugin-api'; import { z } from 'zod'; -import { ZodSchema } from 'zod'; -import { ZodTypeDef } from 'zod'; export { AlertApi }; @@ -147,11 +145,6 @@ export { AnyApiFactory }; export { AnyApiRef }; -// @public @deprecated (undocumented) -export type AnyExtensionDataMap = { - [name in string]: AnyExtensionDataRef; -}; - // @public (undocumented) export type AnyExtensionDataRef = ExtensionDataRef< unknown, @@ -161,17 +154,6 @@ export type AnyExtensionDataRef = ExtensionDataRef< } >; -// @public @deprecated (undocumented) -export type AnyExtensionInputMap = { - [inputName in string]: LegacyExtensionInput< - AnyExtensionDataMap, - { - optional: boolean; - singleton: boolean; - } - >; -}; - // @public (undocumented) export type AnyExternalRoutes = { [name in string]: ExternalRouteRef; @@ -456,141 +438,50 @@ export type CoreNotFoundErrorPageProps = { // @public (undocumented) export type CoreProgressProps = {}; -// @public @deprecated (undocumented) -export function createApiExtension< - TConfig extends {}, - TInputs extends AnyExtensionInputMap, ->( - options: ( - | { - api: AnyApiRef; - factory: (options: { - config: TConfig; - inputs: Expand>; - }) => AnyApiFactory; - } - | { - factory: AnyApiFactory; - } - ) & { - configSchema?: PortableSchema; - inputs?: TInputs; - }, -): ExtensionDefinition< - TConfig, - TConfig, - never, - never, - { - kind?: string | undefined; - namespace?: string | undefined; - name?: string | undefined; - } ->; - -// @public @deprecated (undocumented) -export namespace createApiExtension { - const // @deprecated (undocumented) - factoryDataRef: ConfigurableExtensionDataRef< - AnyApiFactory, - 'core.api.factory', - {} - >; -} - export { createApiFactory }; export { createApiRef }; -// @public @deprecated -export function createAppRootElementExtension< - TConfig extends {}, - TInputs extends AnyExtensionInputMap, ->(options: { - namespace?: string; - name?: string; - attachTo?: { - id: string; - input: string; - }; - configSchema?: PortableSchema; - disabled?: boolean; - inputs?: TInputs; - element: - | JSX_2.Element - | ((options: { - inputs: Expand>; - config: TConfig; - }) => JSX_2.Element); -}): ExtensionDefinition; - -// @public @deprecated -export function createAppRootWrapperExtension< - TConfig extends {}, - TInputs extends AnyExtensionInputMap, ->(options: { - namespace?: string; - name?: string; - attachTo?: { - id: string; - input: string; - }; - configSchema?: PortableSchema; - disabled?: boolean; - inputs?: TInputs; - Component: ComponentType< - PropsWithChildren<{ - inputs: Expand>; - config: TConfig; - }> - >; -}): ExtensionDefinition; - -// @public @deprecated (undocumented) -export namespace createAppRootWrapperExtension { - const // @deprecated (undocumented) - componentDataRef: ConfigurableExtensionDataRef< - React_2.ComponentType<{ - children?: React_2.ReactNode; - }>, - 'app.root.wrapper', - {} - >; -} - // @public (undocumented) -export function createComponentExtension< - TProps extends {}, - TConfig extends {}, - TInputs extends AnyExtensionInputMap, ->(options: { +export function createComponentExtension(options: { ref: ComponentRef; name?: string; disabled?: boolean; - inputs?: TInputs; - configSchema?: PortableSchema; loader: | { - lazy: (values: { - config: TConfig; - inputs: Expand>; - }) => Promise>; + lazy: () => Promise>; } | { - sync: (values: { - config: TConfig; - inputs: Expand>; - }) => ComponentType; + sync: () => ComponentType; }; }): ExtensionDefinition< - TConfig, - TConfig, - never, - never, { - kind?: string | undefined; - namespace?: string | undefined; - name?: string | undefined; + [x: string]: any; + }, + { + [x: string]: any; + }, + ConfigurableExtensionDataRef< + { + ref: ComponentRef; + impl: ComponentType; + }, + 'core.component.component', + {} + >, + { + [x: string]: ExtensionInput< + AnyExtensionDataRef, + { + optional: boolean; + singleton: boolean; + } + >; + }, + { + kind: 'component'; + namespace: string; + name: string; } >; @@ -659,21 +550,6 @@ export function createExtension< } >; -// @public @deprecated (undocumented) -export function createExtension< - TOutput extends AnyExtensionDataMap, - TInputs extends AnyExtensionInputMap, - TConfig, - TConfigInput, ->( - options: LegacyCreateExtensionOptions< - TOutput, - TInputs, - TConfig, - TConfigInput - >, -): ExtensionDefinition; - // @public export function createExtensionBlueprint< TParams, @@ -795,24 +671,6 @@ export function createExtensionDataRef(): { }): ConfigurableExtensionDataRef; }; -// @public @deprecated (undocumented) -export function createExtensionInput< - TExtensionDataMap extends AnyExtensionDataMap, - TConfig extends { - singleton?: boolean; - optional?: boolean; - }, ->( - extensionData: TExtensionDataMap, - config?: TConfig, -): LegacyExtensionInput< - TExtensionDataMap, - { - singleton: TConfig['singleton'] extends true ? true : false; - optional: TConfig['optional'] extends true ? true : false; - } ->; - // @public (undocumented) export function createExtensionInput< UExtensionData extends ExtensionDataRef< @@ -926,105 +784,6 @@ export function createFrontendPlugin< } >; -// @public @deprecated -export function createNavItemExtension(options: { - namespace?: string; - name?: string; - routeRef: RouteRef; - title: string; - icon: IconComponent_2; -}): ExtensionDefinition< - { - title: string; - }, - { - title?: string | undefined; - }, - never, - never, - { - kind?: string | undefined; - namespace?: string | undefined; - name?: string | undefined; - } ->; - -// @public @deprecated (undocumented) -export namespace createNavItemExtension { - const // @deprecated (undocumented) - targetDataRef: ConfigurableExtensionDataRef< - { - title: string; - icon: IconComponent_2; - routeRef: RouteRef; - }, - 'core.nav-item.target', - {} - >; -} - -// @public @deprecated -export function createNavLogoExtension(options: { - name?: string; - namespace?: string; - logoIcon: JSX.Element; - logoFull: JSX.Element; -}): ExtensionDefinition< - unknown, - unknown, - never, - never, - { - kind?: string | undefined; - namespace?: string | undefined; - name?: string | undefined; - } ->; - -// @public @deprecated (undocumented) -export namespace createNavLogoExtension { - const // @deprecated (undocumented) - logoElementsDataRef: ConfigurableExtensionDataRef< - { - logoIcon?: JSX.Element | undefined; - logoFull?: JSX.Element | undefined; - }, - 'core.nav-logo.logo-elements', - {} - >; -} - -// @public @deprecated -export function createPageExtension< - TConfig extends { - path: string; - }, - TInputs extends AnyExtensionInputMap, ->( - options: ( - | { - defaultPath: string; - } - | { - configSchema: PortableSchema; - } - ) & { - namespace?: string; - name?: string; - attachTo?: { - id: string; - input: string; - }; - disabled?: boolean; - inputs?: TInputs; - routeRef?: RouteRef; - loader: (options: { - config: TConfig; - inputs: Expand>; - }) => Promise; - }, -): ExtensionDefinition; - // @public @deprecated (undocumented) export const createPlugin: typeof createFrontendPlugin; @@ -1048,75 +807,6 @@ export function createRouteRef< } >; -// @public @deprecated -export function createRouterExtension< - TConfig extends {}, - TInputs extends AnyExtensionInputMap, ->(options: { - namespace?: string; - name?: string; - attachTo?: { - id: string; - input: string; - }; - configSchema?: PortableSchema; - disabled?: boolean; - inputs?: TInputs; - Component: ComponentType< - PropsWithChildren<{ - inputs: Expand>; - config: TConfig; - }> - >; -}): ExtensionDefinition; - -// @public @deprecated (undocumented) -export namespace createRouterExtension { - const // @deprecated (undocumented) - componentDataRef: ConfigurableExtensionDataRef< - React_2.ComponentType<{ - children?: React_2.ReactNode; - }>, - 'app.router.wrapper', - {} - >; -} - -// @public @deprecated (undocumented) -export function createSchemaFromZod( - schemaCreator: (zImpl: typeof z) => ZodSchema, -): PortableSchema; - -// @public @deprecated (undocumented) -export function createSignInPageExtension< - TConfig extends {}, - TInputs extends AnyExtensionInputMap, ->(options: { - namespace?: string; - name?: string; - attachTo?: { - id: string; - input: string; - }; - configSchema?: PortableSchema; - disabled?: boolean; - inputs?: TInputs; - loader: (options: { - config: TConfig; - inputs: Expand>; - }) => Promise>; -}): ExtensionDefinition; - -// @public @deprecated (undocumented) -export namespace createSignInPageExtension { - const // @deprecated (undocumented) - componentDataRef: ConfigurableExtensionDataRef< - React_2.ComponentType, - 'core.sign-in-page.component', - {} - >; -} - // @public export function createSubRouteRef< Path extends string, @@ -1126,62 +816,6 @@ export function createSubRouteRef< parent: RouteRef; }): MakeSubRouteRef, ParentParams>; -// @public @deprecated (undocumented) -export function createThemeExtension(theme: AppTheme): ExtensionDefinition< - unknown, - unknown, - never, - never, - { - kind?: string | undefined; - namespace?: string | undefined; - name?: string | undefined; - } ->; - -// @public @deprecated (undocumented) -export namespace createThemeExtension { - const // (undocumented) - themeDataRef: ConfigurableExtensionDataRef< - AppTheme, - 'core.theme.theme', - {} - >; -} - -// @public @deprecated (undocumented) -export function createTranslationExtension(options: { - name?: string; - resource: TranslationResource | TranslationMessages; -}): ExtensionDefinition< - unknown, - unknown, - never, - never, - { - kind?: string | undefined; - namespace?: string | undefined; - name?: string | undefined; - } ->; - -// @public @deprecated (undocumented) -export namespace createTranslationExtension { - const // (undocumented) - translationDataRef: ConfigurableExtensionDataRef< - | TranslationResource - | TranslationMessages< - string, - { - [x: string]: string; - }, - boolean - >, - 'core.translation.translation', - {} - >; -} - export { createTranslationMessages }; export { createTranslationRef }; @@ -1429,21 +1063,6 @@ export type ExtensionDataValue = { readonly value: TData; }; -// @public @deprecated -export type ExtensionDataValues = { - [DataName in keyof TExtensionData as TExtensionData[DataName]['config'] extends { - optional: true; - } - ? never - : DataName]: TExtensionData[DataName]['T']; -} & { - [DataName in keyof TExtensionData as TExtensionData[DataName]['config'] extends { - optional: true; - } - ? DataName - : never]?: TExtensionData[DataName]['T']; -}; - // @public (undocumented) export interface ExtensionDefinition< TConfig, @@ -1696,56 +1315,6 @@ export { IdentityApi }; export { identityApiRef }; -// @public @deprecated (undocumented) -export interface LegacyCreateExtensionOptions< - TOutput extends AnyExtensionDataMap, - TInputs extends AnyExtensionInputMap, - TConfig, - TConfigInput, -> { - // (undocumented) - attachTo: { - id: string; - input: string; - }; - // (undocumented) - configSchema?: PortableSchema; - // (undocumented) - disabled?: boolean; - // (undocumented) - factory(context: { - node: AppNode; - config: TConfig; - inputs: Expand>; - }): Expand>; - // (undocumented) - inputs?: TInputs; - // (undocumented) - kind?: string; - // (undocumented) - name?: string; - // (undocumented) - namespace?: string; - // (undocumented) - output: TOutput; -} - -// @public @deprecated (undocumented) -export interface LegacyExtensionInput< - TExtensionDataMap extends AnyExtensionDataMap, - TConfig extends { - singleton: boolean; - optional: boolean; - }, -> { - // (undocumented) - $$type: '@backstage/ExtensionInput'; - // (undocumented) - config: TConfig; - // (undocumented) - extensionData: TExtensionDataMap; -} - export { microsoftAuthApiRef }; // @public @@ -1906,17 +1475,12 @@ export type ResolvedExtensionInput< ? { node: AppNode; } & ExtensionDataContainer - : TExtensionInput['extensionData'] extends AnyExtensionDataMap - ? { - node: AppNode; - output: ExtensionDataValues; - } : never; // @public export type ResolvedExtensionInputs< TInputs extends { - [name in string]: ExtensionInput | LegacyExtensionInput; + [name in string]: ExtensionInput; }, > = { [InputName in keyof TInputs]: false extends TInputs[InputName]['config']['singleton'] diff --git a/plugins/catalog-react/api-report-alpha.md b/plugins/catalog-react/api-report-alpha.md index e5af309ba1..b22d76cd15 100644 --- a/plugins/catalog-react/api-report-alpha.md +++ b/plugins/catalog-react/api-report-alpha.md @@ -5,7 +5,6 @@ ```ts /// -import { AnyExtensionInputMap } from '@backstage/frontend-plugin-api'; import { AnyRouteRefParams } from '@backstage/frontend-plugin-api'; import { ComponentType } from 'react'; import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api'; @@ -13,31 +12,10 @@ import { Entity } from '@backstage/catalog-model'; import { ExtensionBlueprint } from '@backstage/frontend-plugin-api'; import { ExtensionDefinition } from '@backstage/frontend-plugin-api'; import { JSX as JSX_2 } from 'react'; -import { PortableSchema } from '@backstage/frontend-plugin-api'; -import { ResolvedExtensionInputs } from '@backstage/frontend-plugin-api'; import { ResourcePermission } from '@backstage/plugin-permission-common'; import { RouteRef } from '@backstage/frontend-plugin-api'; import { TranslationRef } from '@backstage/core-plugin-api/alpha'; -// @alpha @deprecated (undocumented) -export const catalogExtensionData: { - entityContentTitle: ConfigurableExtensionDataRef< - string, - 'catalog.entity-content-title', - {} - >; - entityFilterFunction: ConfigurableExtensionDataRef< - (entity: Entity) => boolean, - 'catalog.entity-filter-function', - {} - >; - entityFilterExpression: ConfigurableExtensionDataRef< - string, - 'catalog.entity-filter-expression', - {} - >; -}; - // @alpha (undocumented) export const catalogReactTranslationRef: TranslationRef< 'catalog-react', @@ -120,82 +98,6 @@ export function convertLegacyEntityContentExtension( }, ): ExtensionDefinition; -// @alpha @deprecated (undocumented) -export function createEntityCardExtension< - TConfig extends { - filter?: string; - }, - TInputs extends AnyExtensionInputMap, ->(options: { - namespace?: string; - name?: string; - attachTo?: { - id: string; - input: string; - }; - disabled?: boolean; - inputs?: TInputs; - configSchema?: PortableSchema; - filter?: - | typeof catalogExtensionData.entityFilterFunction.T - | typeof catalogExtensionData.entityFilterExpression.T; - loader: (options: { - config: TConfig; - inputs: Expand>; - }) => Promise; -}): ExtensionDefinition< - TConfig, - TConfig, - never, - never, - { - kind?: string | undefined; - namespace?: string | undefined; - name?: string | undefined; - } ->; - -// @alpha @deprecated (undocumented) -export function createEntityContentExtension< - TInputs extends AnyExtensionInputMap, ->(options: { - namespace?: string; - name?: string; - attachTo?: { - id: string; - input: string; - }; - disabled?: boolean; - inputs?: TInputs; - routeRef?: RouteRef; - defaultPath: string; - defaultTitle: string; - filter?: - | typeof catalogExtensionData.entityFilterFunction.T - | typeof catalogExtensionData.entityFilterExpression.T; - loader: (options: { - inputs: Expand>; - }) => Promise; -}): ExtensionDefinition< - { - title: string; - path: string; - filter?: string | undefined; - }, - { - filter?: string | undefined; - title?: string | undefined; - path?: string | undefined; - }, - never, - never, - { - kind?: string | undefined; - namespace?: string | undefined; - name?: string | undefined; - } ->; - // @alpha export const EntityCardBlueprint: ExtensionBlueprint< { diff --git a/plugins/catalog/api-report-alpha.md b/plugins/catalog/api-report-alpha.md index 806fad5754..42f4355921 100644 --- a/plugins/catalog/api-report-alpha.md +++ b/plugins/catalog/api-report-alpha.md @@ -7,7 +7,6 @@ import { AnyApiFactory } from '@backstage/frontend-plugin-api'; import { AnyExtensionDataRef } from '@backstage/frontend-plugin-api'; -import { AnyExtensionInputMap } from '@backstage/frontend-plugin-api'; import { AnyRouteRefParams } from '@backstage/frontend-plugin-api'; import { BackstagePlugin } from '@backstage/frontend-plugin-api'; import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api'; @@ -18,7 +17,6 @@ import { ExtensionInput } from '@backstage/frontend-plugin-api'; import { ExternalRouteRef } from '@backstage/frontend-plugin-api'; import { IconComponent } from '@backstage/core-plugin-api'; import { JSX as JSX_2 } from 'react'; -import { PortableSchema } from '@backstage/frontend-plugin-api'; import { RouteRef } from '@backstage/frontend-plugin-api'; import { SearchResultItemExtensionComponent } from '@backstage/plugin-search-react/alpha'; import { SearchResultItemExtensionPredicate } from '@backstage/plugin-search-react/alpha'; @@ -126,28 +124,6 @@ export const catalogTranslationRef: TranslationRef< } >; -// @alpha @deprecated (undocumented) -export function createCatalogFilterExtension< - TInputs extends AnyExtensionInputMap, - TConfig, ->(options: { - namespace?: string; - name?: string; - inputs?: TInputs; - configSchema?: PortableSchema; - loader: (options: { config: TConfig }) => Promise; -}): ExtensionDefinition< - TConfig, - TConfig, - never, - never, - { - kind?: string | undefined; - namespace?: string | undefined; - name?: string | undefined; - } ->; - // @alpha (undocumented) const _default: BackstagePlugin< { diff --git a/plugins/search-react/api-report-alpha.md b/plugins/search-react/api-report-alpha.md index bce620c378..57bf03114f 100644 --- a/plugins/search-react/api-report-alpha.md +++ b/plugins/search-react/api-report-alpha.md @@ -7,9 +7,7 @@ import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api'; import { ExtensionBlueprint } from '@backstage/frontend-plugin-api'; -import { ExtensionDefinition } from '@backstage/frontend-plugin-api'; import { ListItemProps } from '@material-ui/core/ListItem'; -import { PortableSchema } from '@backstage/frontend-plugin-api'; import { SearchDocument } from '@backstage/plugin-search-common'; import { SearchResult } from '@backstage/plugin-search-common'; @@ -19,38 +17,6 @@ export type BaseSearchResultListItemProps = T & { result?: SearchDocument; } & Omit; -// @alpha @deprecated -export function createSearchResultListItemExtension< - TConfig extends { - noTrack?: boolean; - }, ->( - options: SearchResultItemExtensionOptions, -): ExtensionDefinition< - TConfig, - TConfig, - never, - never, - { - kind?: string | undefined; - namespace?: string | undefined; - name?: string | undefined; - } ->; - -// @alpha @deprecated (undocumented) -export namespace createSearchResultListItemExtension { - const // @deprecated (undocumented) - itemDataRef: ConfigurableExtensionDataRef< - { - predicate?: SearchResultItemExtensionPredicate | undefined; - component: SearchResultItemExtensionComponent; - }, - 'search.search-result-list-item.item', - {} - >; -} - // @alpha (undocumented) export type SearchResultItemExtensionComponent = < P extends BaseSearchResultListItemProps, @@ -58,25 +24,6 @@ export type SearchResultItemExtensionComponent = < props: P, ) => JSX.Element | null; -// @alpha @deprecated (undocumented) -export type SearchResultItemExtensionOptions< - TConfig extends { - noTrack?: boolean; - }, -> = { - namespace?: string; - name?: string; - attachTo?: { - id: string; - input: string; - }; - configSchema?: PortableSchema; - component: (options: { - config: TConfig; - }) => Promise; - predicate?: SearchResultItemExtensionPredicate; -}; - // @alpha (undocumented) export type SearchResultItemExtensionPredicate = ( result: SearchResult,