From 66521125b36324ffb97efa5030f07a17f69f0ec3 Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Wed, 11 May 2022 10:02:36 +0200 Subject: [PATCH] Remove unnecessary, secret exports. Signed-off-by: Eric Peterson --- .../TechDocsReaderPageContent/context.tsx | 19 ------------------- .../TechDocsReaderPageContent/dom.tsx | 8 -------- .../TechDocsReaderPageContent/index.ts | 7 +++++-- .../components/TechDocsStateIndicator.tsx | 11 +---------- .../techdocs/src/reader/components/index.ts | 1 - 5 files changed, 6 insertions(+), 40 deletions(-) diff --git a/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/context.tsx b/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/context.tsx index 5779ade90c..36bea7d447 100644 --- a/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/context.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/context.tsx @@ -27,16 +27,6 @@ import { useReaderState, ReaderState } from '../useReaderState'; const TechDocsReaderContext = createContext({} as ReaderState); -/** - * Note: this hook is currently being exported so that we can rapidly - * iterate on alternative implementations that extend core - * functionality. There is no guarantee that this hook will continue to be - * exported by the package in the future! - * - * todo: Make public or stop exporting (ctrl+f "altReaderExperiments") - * @internal - */ - export const useTechDocsReader = () => useContext(TechDocsReaderContext); /** @@ -73,15 +63,6 @@ export const TechDocsReaderProvider = ({ ); }; -/** - * Note: this HOC is currently being exported so that we can rapidly - * iterate on alternative implementations that extend core - * functionality. There is no guarantee that this HOC will continue to be - * exported by the package in the future! - * - * todo: Make public or stop exporting (ctrl+f "altReaderExperiments") - * @internal - */ export const withTechDocsReaderProvider = (Component: ComponentType) => (props: T) => diff --git a/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/dom.tsx b/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/dom.tsx index 7a373ab302..98a900259d 100644 --- a/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/dom.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/dom.tsx @@ -58,14 +58,6 @@ const headings: TypographyHeadingsKeys[] = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; * Hook that encapsulates the behavior of getting raw HTML and applying * transforms to it in order to make it function at a basic level in the * Backstage UI. - * - * Note: this hook is currently being exported so that we can rapidly iterate - * on alternative implementations that extend core functionality. - * There is no guarantee that this hook will continue to be exported by the - * package in the future! - * - * todo: Make public or stop exporting (see others: "altReaderExperiments") - * @internal */ export const useTechDocsReaderDom = ( entityRef: CompoundEntityRef, diff --git a/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/index.ts b/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/index.ts index a7ea76a5d6..356374c6c5 100644 --- a/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/index.ts +++ b/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/index.ts @@ -16,5 +16,8 @@ export { TechDocsReaderPageContent, Reader } from './TechDocsReaderPageContent'; export type { TechDocsReaderPageContentProps } from './TechDocsReaderPageContent'; -export * from './context'; -export * from './dom'; +export { TechDocsReaderProvider } from './context'; +export type { + TechDocsReaderProviderRenderFunction, + TechDocsReaderProviderProps, +} from './context'; diff --git a/plugins/techdocs/src/reader/components/TechDocsStateIndicator.tsx b/plugins/techdocs/src/reader/components/TechDocsStateIndicator.tsx index 93694280d7..5008b70b52 100644 --- a/plugins/techdocs/src/reader/components/TechDocsStateIndicator.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsStateIndicator.tsx @@ -21,7 +21,7 @@ import { Alert } from '@material-ui/lab'; import { TechDocsBuildLogs } from './TechDocsBuildLogs'; import { TechDocsNotFound } from './TechDocsNotFound'; -import { useTechDocsReader } from './TechDocsReaderPageContent'; +import { useTechDocsReader } from './TechDocsReaderPageContent/context'; const useStyles = makeStyles(theme => ({ root: { @@ -35,15 +35,6 @@ const useStyles = makeStyles(theme => ({ }, })); -/** - * Note: this component is currently being exported so that we can rapidly - * iterate on alternative implementations that extend core - * functionality. There is no guarantee that this component will continue to be - * exported by the package in the future! - * - * todo: Make public or stop exporting (ctrl+f "altReaderExperiments") - * @internal - */ export const TechDocsStateIndicator = () => { let StateAlert: JSX.Element | null = null; const classes = useStyles(); diff --git a/plugins/techdocs/src/reader/components/index.ts b/plugins/techdocs/src/reader/components/index.ts index 406d623bda..1aae4e928f 100644 --- a/plugins/techdocs/src/reader/components/index.ts +++ b/plugins/techdocs/src/reader/components/index.ts @@ -22,5 +22,4 @@ export { TechDocsReaderLayout } from './TechDocsReaderPage'; export * from './TechDocsReaderPageHeader'; export * from './TechDocsReaderPageContent'; export * from './TechDocsReaderPageSubheader'; -export * from './TechDocsStateIndicator'; export type { ReaderState, ContentStateTypes } from './useReaderState';