diff --git a/.changeset/funny-brooms-trade.md b/.changeset/funny-brooms-trade.md new file mode 100644 index 0000000000..2a0b94bb13 --- /dev/null +++ b/.changeset/funny-brooms-trade.md @@ -0,0 +1,5 @@ +--- +'@backstage/frontend-plugin-api': minor +--- + +**BREAKING**: The separate `RouteResolutionApiResolveOptions` type has been removed. diff --git a/packages/core-compat-api/src/compatWrapper/ForwardsCompatProvider.tsx b/packages/core-compat-api/src/compatWrapper/ForwardsCompatProvider.tsx index ffa8bea9ab..925d30306c 100644 --- a/packages/core-compat-api/src/compatWrapper/ForwardsCompatProvider.tsx +++ b/packages/core-compat-api/src/compatWrapper/ForwardsCompatProvider.tsx @@ -33,7 +33,6 @@ import { RouteFunc, RouteRef, RouteResolutionApi, - RouteResolutionApiResolveOptions, SubRouteRef, componentsApiRef, coreComponentRefs, @@ -112,7 +111,7 @@ class CompatRouteResolutionApi implements RouteResolutionApi { | RouteRef | SubRouteRef | ExternalRouteRef, - options?: RouteResolutionApiResolveOptions | undefined, + options?: { sourcePath?: string }, ): RouteFunc | undefined { const legacyRef = convertLegacyRouteRef(anyRouteRef as RouteRef); return this.#routeResolver.resolve(legacyRef, options?.sourcePath ?? '/'); diff --git a/packages/frontend-app-api/src/routing/RouteResolver.ts b/packages/frontend-app-api/src/routing/RouteResolver.ts index ff7966c4db..3a4ef70d29 100644 --- a/packages/frontend-app-api/src/routing/RouteResolver.ts +++ b/packages/frontend-app-api/src/routing/RouteResolver.ts @@ -21,7 +21,6 @@ import { SubRouteRef, AnyRouteRefParams, RouteFunc, - RouteResolutionApiResolveOptions, RouteResolutionApi, } from '@backstage/frontend-plugin-api'; import mapValues from 'lodash/mapValues'; @@ -196,7 +195,7 @@ export class RouteResolver implements RouteResolutionApi { | RouteRef | SubRouteRef | ExternalRouteRef, - options?: RouteResolutionApiResolveOptions, + options?: { sourcePath?: string }, ): RouteFunc | undefined { // First figure out what our target absolute ref is, as well as our target path. const [targetRef, targetPath] = resolveTargetRef( diff --git a/packages/frontend-app-api/src/wiring/createSpecializedApp.tsx b/packages/frontend-app-api/src/wiring/createSpecializedApp.tsx index 51b0f14250..f7c5d73b09 100644 --- a/packages/frontend-app-api/src/wiring/createSpecializedApp.tsx +++ b/packages/frontend-app-api/src/wiring/createSpecializedApp.tsx @@ -25,7 +25,6 @@ import { SubRouteRef, AnyRouteRefParams, RouteFunc, - RouteResolutionApiResolveOptions, RouteResolutionApi, createApiFactory, routeResolutionApiRef, @@ -169,7 +168,7 @@ class RouteResolutionApiProxy implements RouteResolutionApi { | RouteRef | SubRouteRef | ExternalRouteRef, - options?: RouteResolutionApiResolveOptions, + options?: { sourcePath?: string }, ): RouteFunc | undefined { if (!this.#delegate) { throw new Error( diff --git a/packages/frontend-plugin-api/report.api.md b/packages/frontend-plugin-api/report.api.md index 8ae1960221..61fb20ec96 100644 --- a/packages/frontend-plugin-api/report.api.md +++ b/packages/frontend-plugin-api/report.api.md @@ -1765,18 +1765,15 @@ export interface RouteResolutionApi { | RouteRef | SubRouteRef | ExternalRouteRef, - options?: RouteResolutionApiResolveOptions, + options?: { + sourcePath?: string; + }, ): RouteFunc | undefined; } // @public export const routeResolutionApiRef: ApiRef; -// @public (undocumented) -export type RouteResolutionApiResolveOptions = { - sourcePath?: string; -}; - export { SessionApi }; export { SessionState }; diff --git a/packages/frontend-plugin-api/src/apis/definitions/RouteResolutionApi.ts b/packages/frontend-plugin-api/src/apis/definitions/RouteResolutionApi.ts index 30569bde15..6ae25a814e 100644 --- a/packages/frontend-plugin-api/src/apis/definitions/RouteResolutionApi.ts +++ b/packages/frontend-plugin-api/src/apis/definitions/RouteResolutionApi.ts @@ -41,17 +41,6 @@ export type RouteFunc = ( : readonly [params: TParams] ) => string; -/** - * @public - */ -export type RouteResolutionApiResolveOptions = { - /** - * An absolute path to use as a starting point when resolving the route. - * If no path is provided the route will be resolved from the root of the app. - */ - sourcePath?: string; -}; - /** * @public */ @@ -61,7 +50,13 @@ export interface RouteResolutionApi { | RouteRef | SubRouteRef | ExternalRouteRef, - options?: RouteResolutionApiResolveOptions, + options?: { + /** + * An absolute path to use as a starting point when resolving the route. + * If no path is provided the route will be resolved from the root of the app. + */ + sourcePath?: string; + }, ): RouteFunc | undefined; }