Merge pull request #7932 from backstage/jhaals/core-plugin-api-no-name

core-plugin-api: Deprecate use of extensions without name
This commit is contained in:
Fredrik Adelöw
2021-11-11 10:11:30 +01:00
committed by GitHub
14 changed files with 44 additions and 6 deletions
+1
View File
@@ -44,6 +44,7 @@ export const bazaarPlugin = createPlugin({
export const BazaarPage = bazaarPlugin.provide(
createRoutableExtension({
name: 'BazaarPage',
component: () => import('./components/HomePage').then(m => m.HomePage),
mountPoint: rootRouteRef,
}),
+2
View File
@@ -71,9 +71,11 @@ export const ComponentTabs: ({
export function createCardExtension<T>({
title,
components,
name,
}: {
title: string;
components: () => Promise<ComponentParts>;
name?: string;
}): Extension<
({
Renderer,
+3
View File
@@ -37,11 +37,14 @@ type RendererProps = { title: string } & ComponentParts;
export function createCardExtension<T>({
title,
components,
name,
}: {
title: string;
components: () => Promise<ComponentParts>;
name?: string;
}) {
return createReactExtension({
name,
component: {
lazy: () =>
components().then(({ Content, Actions, Settings, ContextProvider }) => {
+2
View File
@@ -71,6 +71,7 @@ export const ComponentTab = homePlugin.provide(
*/
export const WelcomeTitle = homePlugin.provide(
createComponentExtension({
name: 'WelcomeTitle',
component: {
lazy: () =>
import('./homePageComponents/WelcomeTitle').then(m => m.WelcomeTitle),
@@ -80,6 +81,7 @@ export const WelcomeTitle = homePlugin.provide(
export const HomePageRandomJoke = homePlugin.provide(
createCardExtension<{ defaultCategory?: 'any' | 'programming' }>({
name: 'HomePageRandomJoke',
title: 'Random Joke',
components: () => import('./homePageComponents/RandomJoke'),
}),