From cba5b3ba3bac128063014de768de44fc4b6dee28 Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Fri, 27 Oct 2023 13:57:41 +0200 Subject: [PATCH] docs: update api reports Signed-off-by: Camila Belo --- packages/core-compat-api/api-report.md | 7 ++ packages/frontend-plugin-api/api-report.md | 88 +++++++++++++++++++ .../extensions/createComponentExtension.tsx | 4 +- 3 files changed, 97 insertions(+), 2 deletions(-) diff --git a/packages/core-compat-api/api-report.md b/packages/core-compat-api/api-report.md index 877aefa24f..866517b5c8 100644 --- a/packages/core-compat-api/api-report.md +++ b/packages/core-compat-api/api-report.md @@ -6,7 +6,9 @@ /// import { AnyRouteRefParams } from '@backstage/core-plugin-api'; +import { AppComponents } from '@backstage/core-plugin-api'; import { BackstagePlugin } from '@backstage/frontend-plugin-api'; +import { Extension } 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'; @@ -16,6 +18,11 @@ import { RouteRef as RouteRef_2 } from '@backstage/frontend-plugin-api'; import { SubRouteRef } from '@backstage/core-plugin-api'; import { SubRouteRef as SubRouteRef_2 } from '@backstage/frontend-plugin-api'; +// @public (undocumented) +export function collectLegacyComponents( + components: Partial, +): Extension[]; + // @public (undocumented) export function collectLegacyRoutes( flatRoutesElement: JSX.Element, diff --git a/packages/frontend-plugin-api/api-report.md b/packages/frontend-plugin-api/api-report.md index c1c920559e..2255dafdd0 100644 --- a/packages/frontend-plugin-api/api-report.md +++ b/packages/frontend-plugin-api/api-report.md @@ -22,9 +22,11 @@ import { AuthProviderInfo } from '@backstage/core-plugin-api'; import { AuthRequestOptions } from '@backstage/core-plugin-api'; import { BackstageIdentityApi } from '@backstage/core-plugin-api'; import { BackstageIdentityResponse } from '@backstage/core-plugin-api'; +import { BackstagePlugin as BackstagePlugin_2 } from '@backstage/core-plugin-api'; import { BackstageUserIdentity } from '@backstage/core-plugin-api'; import { bitbucketAuthApiRef } from '@backstage/core-plugin-api'; import { bitbucketServerAuthApiRef } from '@backstage/core-plugin-api'; +import { ComponentRef as ComponentRef_2 } from '@backstage/frontend-plugin-api'; import { ComponentType } from 'react'; import { ConfigApi } from '@backstage/core-plugin-api'; import { configApiRef } from '@backstage/core-plugin-api'; @@ -64,6 +66,7 @@ import { OpenIdConnectApi } from '@backstage/core-plugin-api'; import { PendingOAuthRequest } from '@backstage/core-plugin-api'; import { ProfileInfo } from '@backstage/core-plugin-api'; import { ProfileInfoApi } from '@backstage/core-plugin-api'; +import { PropsWithChildren } from 'react'; import { default as React_2 } from 'react'; import { ReactNode } from 'react'; import { SessionApi } from '@backstage/core-plugin-api'; @@ -284,6 +287,22 @@ export type CommonAnalyticsContext = { extensionId: string; }; +// @public (undocumented) +export type ComponentRef = { + id: string; + T: T; +}; + +// @public (undocumented) +export type ComponentsContextValue = Record>; + +// @public (undocumented) +export function ComponentsProvider( + props: PropsWithChildren<{ + value: ComponentsContextValue; + }>, +): React_2.JSX.Element; + export { ConfigApi }; export { configApiRef }; @@ -304,6 +323,29 @@ export interface ConfigurableExtensionDataRef< >; } +// @public (undocumented) +export type CoreBootErrorPageComponent = ComponentType< + PropsWithChildren<{ + step: 'load-config' | 'load-chunk'; + error: Error; + }> +>; + +// @public (undocumented) +export const coreBootErrorPageComponentRef: ComponentRef; + +// @public (undocumented) +export type CoreErrorBoundaryFallbackComponent = ComponentType< + PropsWithChildren<{ + plugin?: BackstagePlugin_2; + error: Error; + resetError: () => void; + }> +>; + +// @public (undocumented) +export const coreErrorBoundaryFallbackComponentRef: ComponentRef; + // @public (undocumented) export const coreExtensionData: { reactElement: ConfigurableExtensionDataRef; @@ -313,8 +355,29 @@ export const coreExtensionData: { navTarget: ConfigurableExtensionDataRef; theme: ConfigurableExtensionDataRef; logoElements: ConfigurableExtensionDataRef; + component: ConfigurableExtensionDataRef< + { + ref: ComponentRef>; + impl: ComponentType; + }, + {} + >; }; +// @public (undocumented) +export type CoreNotFoundErrorPageComponent = ComponentType< + PropsWithChildren<{}> +>; + +// @public (undocumented) +export const coreNotFoundErrorPageComponentRef: ComponentRef; + +// @public (undocumented) +export type CoreProgressComponent = ComponentType>; + +// @public (undocumented) +export const coreProgressComponentRef: ComponentRef; + // @public (undocumented) export function createApiExtension< TConfig extends {}, @@ -341,6 +404,22 @@ export { createApiFactory }; export { createApiRef }; +// @public (undocumented) +export function createComponentExtension< + TRef extends ComponentRef, + TConfig extends {}, + TInputs extends AnyExtensionInputMap, +>(options: { + ref: TRef; + disabled?: boolean; + inputs?: TInputs; + configSchema?: PortableSchema; + component: (values: { + config: TConfig; + inputs: Expand>; + }) => Promise; +}): Extension; + // @public (undocumented) export function createExtension< TOutput extends AnyExtensionDataMap, @@ -621,6 +700,9 @@ export type ExtensionDataValues = { : never]?: TExtensionData[DataName]['T']; }; +// @public (undocumented) +export function ExtensionError(props: { error: Error }): React_2.JSX.Element; + // @public (undocumented) export interface ExtensionInput< TExtensionData extends AnyExtensionDataMap, @@ -828,6 +910,12 @@ export { useApi }; export { useApiHolder }; +// @public (undocumented) +export function useComponent< + P extends {}, + T extends ComponentRef_2>, +>(ref: T): T['T']; + // @public export function useRouteRef< TOptional extends boolean, diff --git a/packages/frontend-plugin-api/src/extensions/createComponentExtension.tsx b/packages/frontend-plugin-api/src/extensions/createComponentExtension.tsx index 678d05049d..376510312f 100644 --- a/packages/frontend-plugin-api/src/extensions/createComponentExtension.tsx +++ b/packages/frontend-plugin-api/src/extensions/createComponentExtension.tsx @@ -50,7 +50,7 @@ export function createComponentExtension< output: { component: coreExtensionData.component, }, - factory({ config, inputs, source }) { + factory({ config, inputs, node }) { const ExtensionComponent = lazy(() => options .component({ config, inputs }) @@ -64,7 +64,7 @@ export function createComponentExtension< component: { ref: options.ref, impl: props => ( - + ),