diff --git a/packages/frontend-app-api/src/tree/instantiateAppNodeTree.ts b/packages/frontend-app-api/src/tree/instantiateAppNodeTree.ts index 003abbb97e..982681cac6 100644 --- a/packages/frontend-app-api/src/tree/instantiateAppNodeTree.ts +++ b/packages/frontend-app-api/src/tree/instantiateAppNodeTree.ts @@ -103,7 +103,7 @@ export function createAppNodeInstance(options: { attachments: ReadonlyMap; }): AppNodeInstance { const { spec, attachments } = options; - const { id, extension, config, source } = spec; + const { id, extension, config } = spec; const extensionData = new Map(); const extensionDataRefs = new Set>(); @@ -118,7 +118,7 @@ export function createAppNodeInstance(options: { try { const namedOutputs = extension.factory({ - source, + spec, config: parsedConfig, inputs: resolveInputs(extension.inputs, attachments), }); diff --git a/packages/frontend-plugin-api/src/components/ExtensionBoundary.tsx b/packages/frontend-plugin-api/src/components/ExtensionBoundary.tsx index a9ea297216..7010edd2f5 100644 --- a/packages/frontend-plugin-api/src/components/ExtensionBoundary.tsx +++ b/packages/frontend-plugin-api/src/components/ExtensionBoundary.tsx @@ -16,11 +16,11 @@ import React, { PropsWithChildren, ReactNode, useEffect } from 'react'; import { AnalyticsContext, useAnalytics } from '@backstage/core-plugin-api'; -import { BackstagePlugin } from '../wiring'; import { ErrorBoundary } from './ErrorBoundary'; import { ExtensionSuspense } from './ExtensionSuspense'; // eslint-disable-next-line @backstage/no-relative-monorepo-imports import { routableExtensionRenderedEvent } from '../../../core-plugin-api/src/analytics/Tracker'; +import { AppNodeSpec } from '../apis'; type RouteTrackerProps = PropsWithChildren<{ disableTracking?: boolean; @@ -44,25 +44,24 @@ const RouteTracker = (props: RouteTrackerProps) => { /** @public */ export interface ExtensionBoundaryProps { - id: string; - source?: BackstagePlugin; + spec: AppNodeSpec; routable?: boolean; children: ReactNode; } /** @public */ export function ExtensionBoundary(props: ExtensionBoundaryProps) { - const { id, source, routable, children } = props; + const { spec, routable, children } = props; // Skipping "routeRef" attribute in the new system, the extension "id" should provide more insight const attributes = { - extension: id, - pluginId: source?.id, + extension: spec.id, + pluginId: spec.source?.id, }; return ( - + {children} diff --git a/packages/frontend-plugin-api/src/wiring/createExtension.ts b/packages/frontend-plugin-api/src/wiring/createExtension.ts index ff011a5875..452669367e 100644 --- a/packages/frontend-plugin-api/src/wiring/createExtension.ts +++ b/packages/frontend-plugin-api/src/wiring/createExtension.ts @@ -14,11 +14,11 @@ * limitations under the License. */ +import { AppNodeSpec } from '../apis'; import { PortableSchema } from '../schema'; import { Expand } from '../types'; import { ExtensionDataRef } from './createExtensionDataRef'; import { ExtensionInput } from './createExtensionInput'; -import { BackstagePlugin } from './createPlugin'; /** @public */ export type AnyExtensionDataMap = { @@ -80,7 +80,7 @@ export interface CreateExtensionOptions< output: TOutput; configSchema?: PortableSchema; factory(options: { - source?: BackstagePlugin; + spec: AppNodeSpec; config: TConfig; inputs: Expand>; }): Expand>; @@ -96,7 +96,7 @@ export interface Extension { output: AnyExtensionDataMap; configSchema?: PortableSchema; factory(options: { - source?: BackstagePlugin; + spec: AppNodeSpec; config: TConfig; inputs: Record< string,