diff --git a/plugins/techdocs/api-report.md b/plugins/techdocs/api-report.md index 0bde0ebc21..c58a946287 100644 --- a/plugins/techdocs/api-report.md +++ b/plugins/techdocs/api-report.md @@ -16,10 +16,8 @@ import { EntityOwnerPickerProps } from '@backstage/plugin-catalog-react'; import { FetchApi } from '@backstage/core-plugin-api'; import { IdentityApi } from '@backstage/core-plugin-api'; import { JSX as JSX_2 } from 'react'; -import { JSXElementConstructor } from 'react'; import { PropsWithChildren } from 'react'; import { default as React_2 } from 'react'; -import { ReactElement } from 'react'; import { ReactNode } from 'react'; import { ResultHighlight } from '@backstage/plugin-search-common'; import { RouteRef } from '@backstage/core-plugin-api'; @@ -135,10 +133,8 @@ export type DocsTableRow = { // @public export const EmbeddedDocsRouter: ( - props: PropsWithChildren<{ - emptyState?: React_2.ReactElement; - }>, -) => React_2.JSX.Element | null; + props: PropsWithChildren<{}>, +) => React_2.JSX.Element; // @public export const EntityListDocsGrid: ( @@ -194,13 +190,9 @@ export type EntityListDocsTableProps = { }; // @public -export const EntityTechdocsContent: ( - props: PropsWithChildren<{ - emptyState?: - | ReactElement> - | undefined; - }>, -) => JSX_2.Element | null; +export const EntityTechdocsContent: (props: { + children?: ReactNode; +}) => JSX_2.Element; // @public export const isTechDocsAvailable: (entity: Entity) => boolean; diff --git a/plugins/techdocs/src/Router.tsx b/plugins/techdocs/src/Router.tsx index ab6267247a..352c9f5b73 100644 --- a/plugins/techdocs/src/Router.tsx +++ b/plugins/techdocs/src/Router.tsx @@ -56,11 +56,6 @@ export const Router = () => { ); }; -/** - * Responsible for registering route to view docs on Entity page - * - * @public - */ export const EmbeddedDocsRouter = ( props: PropsWithChildren<{ emptyState?: React.ReactElement }>, ) => { @@ -95,3 +90,14 @@ export const EmbeddedDocsRouter = ( return element; }; + +/** + * Responsible for registering route to view docs on Entity page + * + * @public + */ +export const LegacyEmbeddedDocsRouter = (props: PropsWithChildren<{}>) => { + // Wrap the Router to avoid exposing the emptyState prop in the non-alpha + // public API and make it easier for us to change later. + return ; +}; diff --git a/plugins/techdocs/src/index.ts b/plugins/techdocs/src/index.ts index c759d43fe9..522bcd0c99 100644 --- a/plugins/techdocs/src/index.ts +++ b/plugins/techdocs/src/index.ts @@ -41,7 +41,11 @@ export { techdocsPlugin as plugin, techdocsPlugin, } from './plugin'; -export * from './Router'; +export { + isTechDocsAvailable, + LegacyEmbeddedDocsRouter as EmbeddedDocsRouter, + Router, +} from './Router'; export type { TechDocsSearchResultListItemProps } from './search/components/TechDocsSearchResultListItem'; diff --git a/plugins/techdocs/src/plugin.ts b/plugins/techdocs/src/plugin.ts index efa6bdfc1f..91b4214336 100644 --- a/plugins/techdocs/src/plugin.ts +++ b/plugins/techdocs/src/plugin.ts @@ -103,7 +103,7 @@ export const TechdocsPage = techdocsPlugin.provide( export const EntityTechdocsContent = techdocsPlugin.provide( createRoutableExtension({ name: 'EntityTechdocsContent', - component: () => import('./Router').then(m => m.EmbeddedDocsRouter), + component: () => import('./Router').then(m => m.LegacyEmbeddedDocsRouter), mountPoint: rootCatalogDocsRouteRef, }), );