frontend-plugin-api: rename plugin ID option to pluginId

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2025-04-27 12:06:13 +02:00
parent c4fd744f42
commit fb58f20613
44 changed files with 216 additions and 115 deletions
@@ -32,7 +32,7 @@ This is how to create a minimal plugin:
import { createFrontendPlugin } from '@backstage/frontend-plugin-api';
export const examplePlugin = createFrontendPlugin({
id: 'example',
pluginId: 'example',
extensions: [],
});
```
@@ -98,7 +98,7 @@ const exampleNavItem = NavItemBlueprint.make({
// The same plugin as above, now with the extensions added
export const examplePlugin = createFrontendPlugin({
id: 'example',
pluginId: 'example',
extensions: [examplePage, exampleNavItem],
// We can also make routes available to other plugins.
// highlight-start
@@ -174,7 +174,7 @@ const exampleApi = ApiBlueprint.make({
/* Omitted definitions for examplePage, exampleNavItem, and rootRouteRef. */
export const examplePlugin = createFrontendPlugin({
id: 'example',
pluginId: 'example',
extensions: [
// highlight-add-next-line
exampleApi,
@@ -210,7 +210,7 @@ const exampleEntityContent = EntityContentBlueprint.make({
});
export const examplePlugin = createFrontendPlugin({
id: 'example',
pluginId: 'example',
extensions: [
// highlight-add-next-line
exampleEntityContent,
@@ -42,7 +42,9 @@ In order to migrate the actual definition of the plugin you need to recreate the
import { convertLegacyRouteRefs } from '@backstage/core-compat-api';
export default createFrontendPlugin({
id: 'my-plugin',
// The plugin ID is now provided as `pluginId` instead of `id`
/* highlight-next-line */
pluginId: 'my-plugin',
// bind all the extensions to the plugin
/* highlight-next-line */
extensions: [/* APIs will go here, but don't worry about those yet */],
@@ -138,7 +140,7 @@ Then add the `fooPage` extension to the plugin:
import { createFrontendPlugin } from '@backstage/frontend-plugin-api';
export default createFrontendPlugin({
id: 'my-plugin',
pluginId: 'my-plugin',
// bind all the extensions to the plugin
/* highlight-remove-next-line */
extensions: [],
@@ -229,7 +231,7 @@ Finally, let's add the `exampleWorkApi` extension to the plugin:
import { createFrontendPlugin } from '@backstage/frontend-plugin-api';
export default createFrontendPlugin({
id: 'my-plugin',
pluginId: 'my-plugin',
// bind all the extensions to the plugin
/* highlight-remove-next-line */
extensions: [fooPage],