frontend-plugin-api: plugins now have pluginId
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -1383,9 +1383,10 @@ export interface FrontendPlugin<
|
||||
readonly $$type: '@backstage/FrontendPlugin';
|
||||
// (undocumented)
|
||||
readonly externalRoutes: TExternalRoutes;
|
||||
// (undocumented)
|
||||
// @deprecated
|
||||
readonly id: string;
|
||||
info(): Promise<FrontendPluginInfo>;
|
||||
readonly pluginId: string;
|
||||
// (undocumented)
|
||||
readonly routes: TRoutes;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ export function ExtensionBoundary(props: ExtensionBoundaryProps) {
|
||||
);
|
||||
|
||||
const plugin = node.spec.plugin;
|
||||
const pluginId = plugin.id ?? 'app';
|
||||
const pluginId = plugin.pluginId ?? plugin.id ?? 'app';
|
||||
|
||||
const pluginWrapperApi = useOptionalPluginWrapperApi();
|
||||
|
||||
|
||||
@@ -130,6 +130,15 @@ export interface FrontendPlugin<
|
||||
},
|
||||
> {
|
||||
readonly $$type: '@backstage/FrontendPlugin';
|
||||
/**
|
||||
* The plugin ID.
|
||||
*/
|
||||
readonly pluginId: string;
|
||||
/**
|
||||
* Deprecated alias for `pluginId`.
|
||||
*
|
||||
* @deprecated Use `pluginId` instead.
|
||||
*/
|
||||
readonly id: string;
|
||||
readonly routes: TRoutes;
|
||||
readonly externalRoutes: TExternalRoutes;
|
||||
@@ -231,6 +240,7 @@ export function createFrontendPlugin<
|
||||
}
|
||||
|
||||
return OpaqueFrontendPlugin.createInstance('v1', {
|
||||
pluginId,
|
||||
id: pluginId,
|
||||
routes: options.routes ?? ({} as TRoutes),
|
||||
externalRoutes: options.externalRoutes ?? ({} as TExternalRoutes),
|
||||
|
||||
Reference in New Issue
Block a user