frontend-plugin-api: rename plugin ID option to pluginId
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -28,7 +28,7 @@ const myPage = PageBlueprint.make({
|
||||
});
|
||||
|
||||
export default createFrontendPlugin({
|
||||
id: 'my-plugin',
|
||||
pluginId: 'my-plugin',
|
||||
extensions: [myPage],
|
||||
});
|
||||
```
|
||||
|
||||
@@ -55,7 +55,7 @@ const catalogIndexPage = createPageExtension({
|
||||
});
|
||||
|
||||
export default createFrontendPlugin({
|
||||
id: 'catalog',
|
||||
pluginId: 'catalog',
|
||||
// highlight-start
|
||||
routes: {
|
||||
index: indexRouteRef,
|
||||
@@ -204,7 +204,7 @@ const catalogIndexPage = createPageExtension({
|
||||
});
|
||||
|
||||
export default createFrontendPlugin({
|
||||
id: 'catalog',
|
||||
pluginId: 'catalog',
|
||||
routes: {
|
||||
index: indexRouteRef,
|
||||
},
|
||||
@@ -411,7 +411,7 @@ const catalogIndexPage = createPageExtension({
|
||||
});
|
||||
|
||||
export default createFrontendPlugin({
|
||||
id: 'catalog',
|
||||
pluginId: 'catalog',
|
||||
routes: {
|
||||
index: indexRouteRef,
|
||||
// highlight-next-line
|
||||
|
||||
@@ -24,7 +24,7 @@ Example:
|
||||
```ts
|
||||
// This declaration is only for internal usage in tests. This could also be a direct default export.
|
||||
export const userSettingsPlugin = createFrontendPlugin({
|
||||
id: 'user-settings',
|
||||
pluginId: 'user-settings',
|
||||
...
|
||||
})
|
||||
|
||||
@@ -68,7 +68,7 @@ const catalogSearchResultListItem = SearchResultListItemBlueprint.make({
|
||||
|
||||
// Note that the extensions themselves are not exported, only the plugin instance
|
||||
export const catalogPlugin = createFrontendPlugin({
|
||||
id: 'catalog',
|
||||
pluginId: 'catalog',
|
||||
extensions: [catalogEntityPage, catalogSearchResultListItem /* ... */],
|
||||
});
|
||||
```
|
||||
|
||||
@@ -219,7 +219,7 @@ Can be converted to the following plugin configuration:
|
||||
|
||||
```tsx
|
||||
createFrontendPlugin({
|
||||
id: 'tech-radar',
|
||||
pluginId: 'tech-radar',
|
||||
// ...
|
||||
featureFlags: [{ name: 'tech-radar' }],
|
||||
// ...
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -80,7 +80,7 @@ const workApi = ApiBlueprint.make({
|
||||
* @public
|
||||
*/
|
||||
export default createFrontendPlugin({
|
||||
id: 'example',
|
||||
pluginId: 'example',
|
||||
extensions: [exampleWorkApi],
|
||||
});
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user