From e3c320a514eb12595d498526d1048de030a1f9c3 Mon Sep 17 00:00:00 2001 From: benjdlambert Date: Mon, 4 Aug 2025 16:58:39 +0200 Subject: [PATCH] chore: removing mode from other fixtures Signed-off-by: benjdlambert --- .../ComponentsApi/DefaultComponentsApi.test.tsx | 6 +++--- .../src/blueprints/ComponentImplementationBlueprint.ts | 8 ++++---- .../src/components/coreComponentRefs.ts | 3 --- .../src/components/makeComponentFromRef.tsx | 2 ++ 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/frontend-app-api/src/apis/implementations/ComponentsApi/DefaultComponentsApi.test.tsx b/packages/frontend-app-api/src/apis/implementations/ComponentsApi/DefaultComponentsApi.test.tsx index b2ab5d5aef..7d06d55a92 100644 --- a/packages/frontend-app-api/src/apis/implementations/ComponentsApi/DefaultComponentsApi.test.tsx +++ b/packages/frontend-app-api/src/apis/implementations/ComponentsApi/DefaultComponentsApi.test.tsx @@ -18,9 +18,9 @@ import { createComponentRef } from '@backstage/frontend-plugin-api'; import { DefaultComponentsApi } from './DefaultComponentsApi'; import { render, screen } from '@testing-library/react'; -const testRefA = createComponentRef({ id: 'test.a', mode: 'sync' }); -const testRefB1 = createComponentRef({ id: 'test.b', mode: 'sync' }); -const testRefB2 = createComponentRef({ id: 'test.b', mode: 'sync' }); +const testRefA = createComponentRef({ id: 'test.a' }); +const testRefB1 = createComponentRef({ id: 'test.b' }); +const testRefB2 = createComponentRef({ id: 'test.b' }); describe('DefaultComponentsApi', () => { it('should provide components', () => { diff --git a/packages/frontend-plugin-api/src/blueprints/ComponentImplementationBlueprint.ts b/packages/frontend-plugin-api/src/blueprints/ComponentImplementationBlueprint.ts index 0386c90f5e..5d2ddea25e 100644 --- a/packages/frontend-plugin-api/src/blueprints/ComponentImplementationBlueprint.ts +++ b/packages/frontend-plugin-api/src/blueprints/ComponentImplementationBlueprint.ts @@ -44,10 +44,10 @@ export const ComponentImplementationBlueprint = createExtensionBlueprint({ }) { return createExtensionBlueprintParams(params); }, - *factory(params) { - yield componentDataRef({ + factory: params => [ + componentDataRef({ ref: params.ref, loader: params.loader, - }); - }, + }), + ], }); diff --git a/packages/frontend-plugin-api/src/components/coreComponentRefs.ts b/packages/frontend-plugin-api/src/components/coreComponentRefs.ts index 0a4aa10cf6..64412b8710 100644 --- a/packages/frontend-plugin-api/src/components/coreComponentRefs.ts +++ b/packages/frontend-plugin-api/src/components/coreComponentRefs.ts @@ -23,19 +23,16 @@ import { createComponentRef } from './createComponentRef'; const coreProgressComponentRef = createComponentRef({ id: 'core.components.progress', - mode: 'sync', }); const coreNotFoundErrorPageComponentRef = createComponentRef({ id: 'core.components.notFoundErrorPage', - mode: 'sync', }); const coreErrorBoundaryFallbackComponentRef = createComponentRef({ id: 'core.components.errorBoundaryFallback', - mode: 'sync', }); /** @public */ diff --git a/packages/frontend-plugin-api/src/components/makeComponentFromRef.tsx b/packages/frontend-plugin-api/src/components/makeComponentFromRef.tsx index c9c58a6ed6..7953549fbc 100644 --- a/packages/frontend-plugin-api/src/components/makeComponentFromRef.tsx +++ b/packages/frontend-plugin-api/src/components/makeComponentFromRef.tsx @@ -32,6 +32,8 @@ export function makeComponentFromRef< ); const ComponentRefImpl = (props: ExternalComponentProps) => { + // todo(blam): use the component that's in the API ref instead if it's defined. + // otherwise use the fallback.. const api = useApi(componentsApiRef); const innerProps = options.transformProps?.(props) ?? props;