diff --git a/.changeset/polite-crabs-build.md b/.changeset/polite-crabs-build.md new file mode 100644 index 0000000000..5975ac3c4e --- /dev/null +++ b/.changeset/polite-crabs-build.md @@ -0,0 +1,12 @@ +--- +'@backstage/plugin-catalog-import': patch +'@backstage/plugin-user-settings': patch +'@backstage/plugin-tech-radar': patch +'@backstage/plugin-graphiql': patch +'@backstage/plugin-techdocs': patch +'@backstage/plugin-catalog': patch +'@backstage/plugin-search': patch +'@backstage/plugin-home': patch +--- + +Wrap `/alpha` export extension elements in backwards compatibility wrapper. diff --git a/plugins/catalog-import/src/alpha.tsx b/plugins/catalog-import/src/alpha.tsx index 7ecbac5346..858e4fa91b 100644 --- a/plugins/catalog-import/src/alpha.tsx +++ b/plugins/catalog-import/src/alpha.tsx @@ -20,7 +20,10 @@ import { discoveryApiRef, identityApiRef, } from '@backstage/core-plugin-api'; -import { convertLegacyRouteRef } from '@backstage/core-compat-api'; +import { + compatWrapper, + convertLegacyRouteRef, +} from '@backstage/core-compat-api'; import { createApiExtension, createPageExtension, @@ -40,7 +43,10 @@ import { catalogApiRef } from '@backstage/plugin-catalog-react'; const CatalogImportPageExtension = createPageExtension({ defaultPath: '/catalog-import', routeRef: convertLegacyRouteRef(rootRouteRef), - loader: () => import('./components/ImportPage').then(m => ), + loader: () => + import('./components/ImportPage').then(m => + compatWrapper(), + ), }); const CatalogImportService = createApiExtension({ diff --git a/plugins/catalog/src/alpha/entityCards.tsx b/plugins/catalog/src/alpha/entityCards.tsx index b6a804a576..371c62afbe 100644 --- a/plugins/catalog/src/alpha/entityCards.tsx +++ b/plugins/catalog/src/alpha/entityCards.tsx @@ -16,79 +16,80 @@ import React from 'react'; import { createEntityCardExtension } from '@backstage/plugin-catalog-react/alpha'; +import { compatWrapper } from '@backstage/core-compat-api'; export const EntityAboutCard = createEntityCardExtension({ name: 'about', loader: async () => - import('../components/AboutCard').then(m => ( - - )), + import('../components/AboutCard').then(m => + compatWrapper(), + ), }); export const EntityLinksCard = createEntityCardExtension({ name: 'links', filter: 'has:links', loader: async () => - import('../components/EntityLinksCard').then(m => { - return ; - }), + import('../components/EntityLinksCard').then(m => + compatWrapper(), + ), }); export const EntityLabelsCard = createEntityCardExtension({ name: 'labels', filter: 'has:labels', loader: async () => - import('../components/EntityLabelsCard').then(m => ( - - )), + import('../components/EntityLabelsCard').then(m => + compatWrapper(), + ), }); export const EntityDependsOnComponentsCard = createEntityCardExtension({ name: 'depends-on-components', loader: async () => - import('../components/DependsOnComponentsCard').then(m => ( - - )), + import('../components/DependsOnComponentsCard').then(m => + compatWrapper(), + ), }); export const EntityDependsOnResourcesCard = createEntityCardExtension({ name: 'depends-on-resources', loader: async () => - import('../components/DependsOnResourcesCard').then(m => ( - - )), + import('../components/DependsOnResourcesCard').then(m => + compatWrapper(), + ), }); export const EntityHasComponentsCard = createEntityCardExtension({ name: 'has-components', loader: async () => - import('../components/HasComponentsCard').then(m => ( - - )), + import('../components/HasComponentsCard').then(m => + compatWrapper(), + ), }); export const EntityHasResourcesCard = createEntityCardExtension({ name: 'has-resources', loader: async () => - import('../components/HasResourcesCard').then(m => ( - - )), + import('../components/HasResourcesCard').then(m => + compatWrapper(), + ), }); export const EntityHasSubcomponentsCard = createEntityCardExtension({ name: 'has-subcomponents', loader: async () => - import('../components/HasSubcomponentsCard').then(m => ( - - )), + import('../components/HasSubcomponentsCard').then(m => + compatWrapper(), + ), }); export const EntityHasSystemsCard = createEntityCardExtension({ name: 'has-systems', loader: async () => - import('../components/HasSystemsCard').then(m => ( - - )), + import('../components/HasSystemsCard').then(m => + compatWrapper(), + ), }); export default [ diff --git a/plugins/catalog/src/alpha/pages.tsx b/plugins/catalog/src/alpha/pages.tsx index ee1da49147..c80e17ba4e 100644 --- a/plugins/catalog/src/alpha/pages.tsx +++ b/plugins/catalog/src/alpha/pages.tsx @@ -15,7 +15,10 @@ */ import React from 'react'; -import { convertLegacyRouteRef } from '@backstage/core-compat-api'; +import { + compatWrapper, + convertLegacyRouteRef, +} from '@backstage/core-compat-api'; import { createPageExtension, coreExtensionData, @@ -40,7 +43,7 @@ export const CatalogIndexPage = createPageExtension({ loader: async ({ inputs }) => { const { BaseCatalogPage } = await import('../components/CatalogPage'); const filters = inputs.filters.map(filter => filter.output.element); - return {filters}} />; + return compatWrapper({filters}} />); }, }); @@ -75,7 +78,7 @@ export const CatalogEntityPage = createPageExtension({ ); }; - return ; + return compatWrapper(); }, }); diff --git a/plugins/graphiql/src/alpha.tsx b/plugins/graphiql/src/alpha.tsx index f2c23f14e4..2fbd9235ac 100644 --- a/plugins/graphiql/src/alpha.tsx +++ b/plugins/graphiql/src/alpha.tsx @@ -34,13 +34,17 @@ import { } from '@backstage/plugin-graphiql'; import { createApiFactory, IconComponent } from '@backstage/core-plugin-api'; import { graphiQLRouteRef } from './route-refs'; -import { convertLegacyRouteRef } from '@backstage/core-compat-api'; +import { + compatWrapper, + convertLegacyRouteRef, +} from '@backstage/core-compat-api'; /** @alpha */ export const GraphiqlPage = createPageExtension({ defaultPath: '/graphiql', routeRef: convertLegacyRouteRef(graphiQLRouteRef), - loader: () => import('./components').then(m => ), + loader: () => + import('./components').then(m => compatWrapper()), }); /** @alpha */ diff --git a/plugins/home/package.json b/plugins/home/package.json index 57a5189fc9..038037e303 100644 --- a/plugins/home/package.json +++ b/plugins/home/package.json @@ -51,6 +51,7 @@ "@backstage/catalog-model": "workspace:^", "@backstage/config": "workspace:^", "@backstage/core-app-api": "workspace:^", + "@backstage/core-compat-api": "workspace:^", "@backstage/core-components": "workspace:^", "@backstage/core-plugin-api": "workspace:^", "@backstage/frontend-plugin-api": "workspace:^", diff --git a/plugins/home/src/alpha.tsx b/plugins/home/src/alpha.tsx index f16881de95..631f4293be 100644 --- a/plugins/home/src/alpha.tsx +++ b/plugins/home/src/alpha.tsx @@ -24,6 +24,7 @@ import { createPlugin, createRouteRef, } from '@backstage/frontend-plugin-api'; +import { compatWrapper } from '@backstage/core-compat-api'; const rootRouteRef = createRouteRef(); @@ -49,12 +50,14 @@ const HomepageCompositionRootExtension = createPageExtension({ ), }, loader: ({ inputs }) => - import('./components/').then(m => ( - - )), + import('./components/').then(m => + compatWrapper( + , + ), + ), }); /** diff --git a/plugins/search/src/alpha.tsx b/plugins/search/src/alpha.tsx index d18f93391c..7899fb2ae1 100644 --- a/plugins/search/src/alpha.tsx +++ b/plugins/search/src/alpha.tsx @@ -67,7 +67,10 @@ import { rootRouteRef } from './plugin'; import { SearchClient } from './apis'; import { SearchType } from './components/SearchType'; import { UrlUpdater } from './components/SearchPage/SearchPage'; -import { convertLegacyRouteRef } from '@backstage/core-compat-api'; +import { + compatWrapper, + convertLegacyRouteRef, +} from '@backstage/core-compat-api'; /** @alpha */ export const SearchApi = createApiExtension({ @@ -225,11 +228,11 @@ export const SearchPage = createPageExtension({ ); }; - return ( + return compatWrapper( - + , ); }, }); diff --git a/plugins/tech-radar/src/alpha.tsx b/plugins/tech-radar/src/alpha.tsx index 2d15e92537..dfed6d3af0 100644 --- a/plugins/tech-radar/src/alpha.tsx +++ b/plugins/tech-radar/src/alpha.tsx @@ -24,7 +24,10 @@ import { import React from 'react'; import { techRadarApiRef } from './api'; import { SampleTechRadarApi } from './sample'; -import { convertLegacyRouteRef } from '@backstage/core-compat-api'; +import { + compatWrapper, + convertLegacyRouteRef, +} from '@backstage/core-compat-api'; import { rootRouteRef } from './plugin'; /** @alpha */ @@ -44,7 +47,9 @@ export const TechRadarPage = createPageExtension({ }), ), loader: ({ config }) => - import('./components').then(m => ), + import('./components').then(m => + compatWrapper(), + ), }); /** @alpha */ diff --git a/plugins/techdocs/src/alpha.tsx b/plugins/techdocs/src/alpha.tsx index 82bda828e2..26891b23f0 100644 --- a/plugins/techdocs/src/alpha.tsx +++ b/plugins/techdocs/src/alpha.tsx @@ -31,7 +31,10 @@ import { fetchApiRef, identityApiRef, } from '@backstage/core-plugin-api'; -import { convertLegacyRouteRef } from '@backstage/core-compat-api'; +import { + compatWrapper, + convertLegacyRouteRef, +} from '@backstage/core-compat-api'; import { techdocsApiRef, techdocsStorageApiRef, @@ -100,7 +103,8 @@ export const TechDocsSearchResultListItemExtension = const { TechDocsSearchResultListItem } = await import( './search/components/TechDocsSearchResultListItem' ); - return props => ; + return props => + compatWrapper(); }, }); @@ -113,9 +117,9 @@ const TechDocsIndexPage = createPageExtension({ defaultPath: '/docs', routeRef: convertLegacyRouteRef(rootRouteRef), loader: () => - import('./home/components/TechDocsIndexPage').then(m => ( - - )), + import('./home/components/TechDocsIndexPage').then(m => + compatWrapper(), + ), }); /** @@ -128,9 +132,9 @@ const TechDocsReaderPage = createPageExtension({ defaultPath: '/docs/:namespace/:kind/:name', routeRef: convertLegacyRouteRef(rootDocsRouteRef), loader: () => - import('./reader/components/TechDocsReaderPage').then(m => ( - - )), + import('./reader/components/TechDocsReaderPage').then(m => + compatWrapper(), + ), }); /** @@ -141,7 +145,8 @@ const TechDocsReaderPage = createPageExtension({ const TechDocsEntityContent = createEntityContentExtension({ defaultPath: 'docs', defaultTitle: 'TechDocs', - loader: () => import('./Router').then(m => ), + loader: () => + import('./Router').then(m => compatWrapper()), }); /** @alpha */ diff --git a/plugins/user-settings/src/alpha.tsx b/plugins/user-settings/src/alpha.tsx index cda8301e82..9ee2e4a7c5 100644 --- a/plugins/user-settings/src/alpha.tsx +++ b/plugins/user-settings/src/alpha.tsx @@ -19,7 +19,10 @@ import { createPageExtension, createPlugin, } from '@backstage/frontend-plugin-api'; -import { convertLegacyRouteRef } from '@backstage/core-compat-api'; +import { + convertLegacyRouteRef, + compatWrapper, +} from '@backstage/core-compat-api'; import { settingsRouteRef } from './plugin'; import React from 'react'; @@ -38,11 +41,13 @@ const UserSettingsPage = createPageExtension({ ), }, loader: ({ inputs }) => - import('./components/SettingsPage').then(m => ( - - )), + import('./components/SettingsPage').then(m => + compatWrapper( + , + ), + ), }); /** diff --git a/yarn.lock b/yarn.lock index 42c3748977..d756da8a78 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7377,6 +7377,7 @@ __metadata: "@backstage/cli": "workspace:^" "@backstage/config": "workspace:^" "@backstage/core-app-api": "workspace:^" + "@backstage/core-compat-api": "workspace:^" "@backstage/core-components": "workspace:^" "@backstage/core-plugin-api": "workspace:^" "@backstage/dev-utils": "workspace:^"