From 5775f10d14047cf63cd2d03755a0ece3bdce1622 Mon Sep 17 00:00:00 2001 From: benjdlambert Date: Wed, 6 Aug 2025 10:40:52 +0200 Subject: [PATCH] chore: cleanup todos Signed-off-by: benjdlambert Signed-off-by: benjdlambert --- .../src/convertLegacyAppOptions.tsx | 9 +++----- packages/frontend-plugin-api/report.api.md | 23 +++++++------------ .../components/DefaultAdaptableComponents.ts | 5 ++-- .../src/components/ExtensionBoundary.tsx | 6 ++--- 4 files changed, 16 insertions(+), 27 deletions(-) diff --git a/packages/core-compat-api/src/convertLegacyAppOptions.tsx b/packages/core-compat-api/src/convertLegacyAppOptions.tsx index 215185853a..b007c938c2 100644 --- a/packages/core-compat-api/src/convertLegacyAppOptions.tsx +++ b/packages/core-compat-api/src/convertLegacyAppOptions.tsx @@ -27,6 +27,9 @@ import { RouterBlueprint, SignInPageBlueprint, ThemeBlueprint, + ErrorBoundary as AdaptableErrorBoundary, + NotFoundErrorPage as AdaptableNotFoundErrorPage, + Progress as AdaptableProgress, } from '@backstage/frontend-plugin-api'; import { AnyApiFactory, @@ -38,11 +41,6 @@ import { } from '@backstage/core-plugin-api'; import { toLegacyPlugin } from './compatWrapper/BackwardsCompatProvider'; import { compatWrapper } from './compatWrapper'; -import { - ErrorBoundary as AdaptableErrorBoundary, - NotFoundErrorPage as AdaptableNotFoundErrorPage, - Progress as AdaptableProgress, -} from '@backstage/frontend-plugin-api'; function componentCompatWrapper( Component: ComponentType, @@ -197,7 +195,6 @@ export function convertLegacyAppOptions( define({ component: AdaptableErrorBoundary, loader: () => - // todo: types + props lols componentCompatWrapper(WrappedErrorBoundaryFallback), }), }), diff --git a/packages/frontend-plugin-api/report.api.md b/packages/frontend-plugin-api/report.api.md index 1e9bc0fff6..c9d0ff5542 100644 --- a/packages/frontend-plugin-api/report.api.md +++ b/packages/frontend-plugin-api/report.api.md @@ -25,14 +25,10 @@ import { BackstageIdentityResponse } 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'; import { ConfigurableExtensionDataRef as ConfigurableExtensionDataRef_2 } from '@backstage/frontend-plugin-api'; -import { CoreErrorBoundaryFallbackProps as CoreErrorBoundaryFallbackProps_2 } from '@backstage/frontend-plugin-api'; -import { CoreNotFoundErrorPageProps as CoreNotFoundErrorPageProps_2 } from '@backstage/frontend-plugin-api'; -import { CoreProgressProps as CoreProgressProps_2 } from '@backstage/frontend-plugin-api'; import { createApiFactory } from '@backstage/core-plugin-api'; import { createApiRef } from '@backstage/core-plugin-api'; import { createTranslationMessages } from '@backstage/core-plugin-api/alpha'; @@ -958,11 +954,11 @@ export { errorApiRef }; // @public (undocumented) export const ErrorBoundary: (( - props: CoreErrorBoundaryFallbackProps_2, + props: CoreErrorBoundaryFallbackProps, ) => JSX.Element) & { - ref: ComponentRef_2< - CoreErrorBoundaryFallbackProps_2, - CoreErrorBoundaryFallbackProps_2 + ref: ComponentRef< + CoreErrorBoundaryFallbackProps, + CoreErrorBoundaryFallbackProps >; }; @@ -1623,12 +1619,9 @@ export const NavItemBlueprint: ExtensionBlueprint<{ // @public (undocumented) export const NotFoundErrorPage: (( - props: CoreNotFoundErrorPageProps_2, + props: CoreNotFoundErrorPageProps, ) => JSX.Element) & { - ref: ComponentRef_2< - CoreNotFoundErrorPageProps_2, - CoreNotFoundErrorPageProps_2 - >; + ref: ComponentRef; }; export { OAuthApi }; @@ -1716,8 +1709,8 @@ export { ProfileInfo }; export { ProfileInfoApi }; // @public (undocumented) -export const Progress: ((props: CoreProgressProps_2) => JSX.Element) & { - ref: ComponentRef_2; +export const Progress: ((props: CoreProgressProps) => JSX.Element) & { + ref: ComponentRef; }; // @public diff --git a/packages/frontend-plugin-api/src/components/DefaultAdaptableComponents.ts b/packages/frontend-plugin-api/src/components/DefaultAdaptableComponents.ts index 2dde24eb1b..5319c9017b 100644 --- a/packages/frontend-plugin-api/src/components/DefaultAdaptableComponents.ts +++ b/packages/frontend-plugin-api/src/components/DefaultAdaptableComponents.ts @@ -13,12 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { CoreErrorBoundaryFallbackProps, CoreNotFoundErrorPageProps, CoreProgressProps, - createAdaptableComponent, -} from '@backstage/frontend-plugin-api'; +} from '../types'; +import { createAdaptableComponent } from './createAdaptableComponent'; /** * @public diff --git a/packages/frontend-plugin-api/src/components/ExtensionBoundary.tsx b/packages/frontend-plugin-api/src/components/ExtensionBoundary.tsx index e4e7e05b0f..0296d70b64 100644 --- a/packages/frontend-plugin-api/src/components/ExtensionBoundary.tsx +++ b/packages/frontend-plugin-api/src/components/ExtensionBoundary.tsx @@ -29,6 +29,7 @@ import { AppNode } from '../apis'; import { Progress } from '@backstage/core-components'; import { coreExtensionData } from '../wiring'; import { AppNodeProvider } from './AppNodeProvider'; +import { ErrorBoundary as ErrorBoundaryComponent } from './DefaultAdaptableComponents'; type RouteTrackerProps = PropsWithChildren<{ enabled?: boolean; @@ -67,9 +68,6 @@ export function ExtensionBoundary(props: ExtensionBoundaryProps) { const plugin = node.spec.plugin; - // todo: fallback - const fallback = () =>
Fallback
; - // Skipping "routeRef" attribute in the new system, the extension "id" should provide more insight const attributes = { extensionId: node.spec.id, @@ -79,7 +77,7 @@ export function ExtensionBoundary(props: ExtensionBoundaryProps) { return ( }> - + {children}