From b2200ff04808ee871af2d15a80ac974a6961611b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 24 May 2023 14:23:25 +0200 Subject: [PATCH] fixup the last bits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/weak-rats-serve.md | 18 ++++++------------ packages/core-app-api/api-report.md | 20 +++++++++++--------- packages/core-app-api/src/app/types.ts | 14 +++++++------- packages/core-plugin-api/api-report.md | 20 +++++++++++--------- 4 files changed, 35 insertions(+), 37 deletions(-) diff --git a/.changeset/weak-rats-serve.md b/.changeset/weak-rats-serve.md index e3030d130a..fe7cd78510 100644 --- a/.changeset/weak-rats-serve.md +++ b/.changeset/weak-rats-serve.md @@ -1,15 +1,9 @@ --- -'@backstage/core-components': patch -'@backstage/plugin-stack-overflow': patch -'@backstage/plugin-catalog-react': patch -'@backstage/plugin-search-react': patch -'@backstage/plugin-api-docs': patch -'@backstage/plugin-techdocs': patch -'@backstage/plugin-catalog': patch -'@backstage/plugin-search': patch -'@backstage/plugin-fossa': patch -'@backstage/plugin-home': patch -'@backstage/plugin-org': patch +'@backstage/core-app-api': patch +'@backstage/core-plugin-api': patch +'@backstage/dev-utils': patch +'@backstage/plugin-scaffolder-react': patch +'@backstage/plugin-scaffolder': patch --- -Components with empty default props now explicitly declare PropsWithChildren as type +Add `PropsWithChildren` to usages of `ComponentType`, in preparation for React 18 where the children are no longer implicit. diff --git a/packages/core-app-api/api-report.md b/packages/core-app-api/api-report.md index 0def835e50..09efe516b9 100644 --- a/packages/core-app-api/api-report.md +++ b/packages/core-app-api/api-report.md @@ -148,9 +148,11 @@ export type AppComponents = { NotFoundErrorPage: ComponentType>; BootErrorPage: ComponentType; Progress: ComponentType>; - Router: ComponentType<{ - basename?: string; - }>; + Router: ComponentType< + PropsWithChildren<{ + basename?: string; + }> + >; ErrorBoundaryFallback: ComponentType; ThemeProvider?: ComponentType>; SignInPage?: ComponentType; @@ -316,10 +318,10 @@ export type BitbucketSession = { }; // @public -export type BootErrorPageProps = { +export type BootErrorPageProps = PropsWithChildren<{ step: 'load-config' | 'load-chunk'; error: Error; -}; +}>; export { ConfigReader }; @@ -359,11 +361,11 @@ export class ErrorApiForwarder implements ErrorApi { } // @public -export type ErrorBoundaryFallbackProps = { +export type ErrorBoundaryFallbackProps = PropsWithChildren<{ plugin?: BackstagePlugin; error: Error; resetError: () => void; -}; +}>; // @public export const FeatureFlagged: (props: FeatureFlaggedProps) => JSX.Element; @@ -596,9 +598,9 @@ export class SamlAuth } // @public -export type SignInPageProps = { +export type SignInPageProps = PropsWithChildren<{ onSignInSuccess(identityApi: IdentityApi): void; -}; +}>; // @public export class UnhandledErrorForwarder { diff --git a/packages/core-app-api/src/app/types.ts b/packages/core-app-api/src/app/types.ts index 584674a52d..7f38e2d006 100644 --- a/packages/core-app-api/src/app/types.ts +++ b/packages/core-app-api/src/app/types.ts @@ -33,33 +33,33 @@ import { AppConfig } from '@backstage/config'; * * @public */ -export type BootErrorPageProps = { +export type BootErrorPageProps = PropsWithChildren<{ step: 'load-config' | 'load-chunk'; error: Error; -}; +}>; /** * Props for the `SignInPage` component of {@link AppComponents}. * * @public */ -export type SignInPageProps = { +export type SignInPageProps = PropsWithChildren<{ /** * Set the IdentityApi on successful sign-in. This should only be called once. */ onSignInSuccess(identityApi: IdentityApi): void; -}; +}>; /** * Props for the fallback error boundary. * * @public */ -export type ErrorBoundaryFallbackProps = { +export type ErrorBoundaryFallbackProps = PropsWithChildren<{ plugin?: BackstagePlugin; error: Error; resetError: () => void; -}; +}>; /** * A set of replaceable core components that are part of every Backstage app. @@ -70,7 +70,7 @@ export type AppComponents = { NotFoundErrorPage: ComponentType>; BootErrorPage: ComponentType; Progress: ComponentType>; - Router: ComponentType<{ basename?: string }>; + Router: ComponentType>; ErrorBoundaryFallback: ComponentType; ThemeProvider?: ComponentType>; diff --git a/packages/core-plugin-api/api-report.md b/packages/core-plugin-api/api-report.md index 827b173094..227b9b9816 100644 --- a/packages/core-plugin-api/api-report.md +++ b/packages/core-plugin-api/api-report.md @@ -141,9 +141,11 @@ export type AppComponents = { NotFoundErrorPage: ComponentType>; BootErrorPage: ComponentType; Progress: ComponentType>; - Router: ComponentType<{ - basename?: string; - }>; + Router: ComponentType< + PropsWithChildren<{ + basename?: string; + }> + >; ErrorBoundaryFallback: ComponentType; ThemeProvider?: ComponentType>; SignInPage?: ComponentType; @@ -248,10 +250,10 @@ export const bitbucketServerAuthApiRef: ApiRef< >; // @public -export type BootErrorPageProps = { +export type BootErrorPageProps = PropsWithChildren<{ step: 'load-config' | 'load-chunk'; error: Error; -}; +}>; // @public export type CommonAnalyticsContext = { @@ -406,11 +408,11 @@ export type ErrorApiErrorContext = { export const errorApiRef: ApiRef; // @public -export type ErrorBoundaryFallbackProps = { +export type ErrorBoundaryFallbackProps = PropsWithChildren<{ plugin?: BackstagePlugin_2; error: Error; resetError: () => void; -}; +}>; // @public export type Extension = { @@ -691,9 +693,9 @@ export enum SessionState { } // @public -export type SignInPageProps = { +export type SignInPageProps = PropsWithChildren<{ onSignInSuccess(identityApi: IdentityApi_2): void; -}; +}>; // @public export interface StorageApi {