diff --git a/.changeset/fancy-ducks-help.md b/.changeset/fancy-ducks-help.md new file mode 100644 index 0000000000..06cfc23309 --- /dev/null +++ b/.changeset/fancy-ducks-help.md @@ -0,0 +1,5 @@ +--- +'@backstage/frontend-plugin-api': minor +--- + +**BREAKING**: Removed the `routable` property from `ExtensionBoundary`. This property was never needed in practice and is instead inferred from whether or not the extension outputs a route reference. It can be safely removed. diff --git a/packages/frontend-plugin-api/report.api.md b/packages/frontend-plugin-api/report.api.md index 8ae1960221..016ec8f9c5 100644 --- a/packages/frontend-plugin-api/report.api.md +++ b/packages/frontend-plugin-api/report.api.md @@ -1096,7 +1096,6 @@ export interface ExtensionBoundaryProps { children: ReactNode; // (undocumented) node: AppNode; - routable?: boolean; } // @public (undocumented) diff --git a/packages/frontend-plugin-api/src/blueprints/SignInPageBlueprint.tsx b/packages/frontend-plugin-api/src/blueprints/SignInPageBlueprint.tsx index 0ca9bf4e92..5e4112a8d1 100644 --- a/packages/frontend-plugin-api/src/blueprints/SignInPageBlueprint.tsx +++ b/packages/frontend-plugin-api/src/blueprints/SignInPageBlueprint.tsx @@ -48,7 +48,7 @@ export const SignInPageBlueprint = createExtensionBlueprint({ ); yield componentDataRef(props => ( - + )); diff --git a/packages/frontend-plugin-api/src/components/ExtensionBoundary.tsx b/packages/frontend-plugin-api/src/components/ExtensionBoundary.tsx index 7f14b992de..f653fa1742 100644 --- a/packages/frontend-plugin-api/src/components/ExtensionBoundary.tsx +++ b/packages/frontend-plugin-api/src/components/ExtensionBoundary.tsx @@ -31,11 +31,11 @@ import { coreExtensionData } from '../wiring'; import { AppNodeProvider } from './AppNodeProvider'; type RouteTrackerProps = PropsWithChildren<{ - disableTracking?: boolean; + enabled?: boolean; }>; const RouteTracker = (props: RouteTrackerProps) => { - const { disableTracking, children } = props; + const { enabled, children } = props; const analytics = useAnalytics(); // This event, never exposed to end-users of the analytics API, @@ -43,9 +43,10 @@ const RouteTracker = (props: RouteTrackerProps) => { // navigation event when the route navigated to is a gathered // mountpoint. useEffect(() => { - if (disableTracking) return; - analytics.captureEvent(routableExtensionRenderedEvent, ''); - }, [analytics, disableTracking]); + if (enabled) { + analytics.captureEvent(routableExtensionRenderedEvent, ''); + } + }, [analytics, enabled]); return <>{children}; }; @@ -53,20 +54,14 @@ const RouteTracker = (props: RouteTrackerProps) => { /** @public */ export interface ExtensionBoundaryProps { node: AppNode; - /** - * This explicitly marks the extension as routable for the purpose of - * capturing analytics events. If not provided, the extension boundary will be - * marked as routable if it outputs a routePath. - */ - routable?: boolean; children: ReactNode; } /** @public */ export function ExtensionBoundary(props: ExtensionBoundaryProps) { - const { node, routable, children } = props; + const { node, children } = props; - const doesOutputRoutePath = Boolean( + const hasRoutePathOutput = Boolean( node.instance?.getData(coreExtensionData.routePath), ); @@ -85,9 +80,7 @@ export function ExtensionBoundary(props: ExtensionBoundaryProps) { }> - - {children} - + {children}