diff --git a/.changeset/green-llamas-wink.md b/.changeset/green-llamas-wink.md new file mode 100644 index 0000000000..0590b59ef3 --- /dev/null +++ b/.changeset/green-llamas-wink.md @@ -0,0 +1,6 @@ +--- +'@backstage/core-compat-api': patch +'@backstage/plugin-app-visualizer': patch +--- + +Internal updates for blueprint moves to `@backstage/plugin-app-react`. diff --git a/.changeset/lemon-eyes-grin.md b/.changeset/lemon-eyes-grin.md new file mode 100644 index 0000000000..890a143c47 --- /dev/null +++ b/.changeset/lemon-eyes-grin.md @@ -0,0 +1,5 @@ +--- +'@backstage/create-app': patch +--- + +Switched `next-app` template to use blueprint from `@backstage/plugin-app-react. diff --git a/.changeset/polite-glasses-throw.md b/.changeset/polite-glasses-throw.md new file mode 100644 index 0000000000..67f554591a --- /dev/null +++ b/.changeset/polite-glasses-throw.md @@ -0,0 +1,13 @@ +--- +'@backstage/frontend-plugin-api': minor +--- + +**BREAKING**: The following blueprints have been removed and are now only available from `@backstage/plugin-app-react`: + +- `IconBundleBlueprint` +- `NavContentBlueprint` +- `RouterBlueprint` +- `SignInPageBlueprint` +- `SwappableComponentBlueprint` +- `ThemeBlueprint` +- `TranslationBlueprint` diff --git a/.changeset/quiet-humans-hammer.md b/.changeset/quiet-humans-hammer.md index 1878473ff0..d47fd647f1 100644 --- a/.changeset/quiet-humans-hammer.md +++ b/.changeset/quiet-humans-hammer.md @@ -1,8 +1,8 @@ --- -'@backstage/plugin-app': patch +'@backstage/plugin-app': minor --- -The deprecation of the following blueprints listed below is not complete. These blueprints must now be provided via an override or a module for the `app` plugin. Extensions from other plugins will now trigger a warning in the app and be ignored. +**BREAKING**: Extensions created with the following blueprints must now be provided via an override or a module for the `app` plugin. Extensions from other plugins will now trigger a warning in the app and be ignored. - `IconBundleBlueprint` - `NavContentBlueprint` diff --git a/.changeset/slimy-dots-cross.md b/.changeset/slimy-dots-cross.md new file mode 100644 index 0000000000..fa1cf18aa2 --- /dev/null +++ b/.changeset/slimy-dots-cross.md @@ -0,0 +1,5 @@ +--- +'@backstage/frontend-defaults': patch +--- + +Dependency update for tests. diff --git a/packages/app-next/package.json b/packages/app-next/package.json index 46fcabbf5a..866979f4a1 100644 --- a/packages/app-next/package.json +++ b/packages/app-next/package.json @@ -48,6 +48,7 @@ "@backstage/integration-react": "workspace:^", "@backstage/plugin-api-docs": "workspace:^", "@backstage/plugin-app": "workspace:^", + "@backstage/plugin-app-react": "workspace:^", "@backstage/plugin-app-visualizer": "workspace:^", "@backstage/plugin-auth": "workspace:^", "@backstage/plugin-auth-react": "workspace:^", diff --git a/packages/app-next/src/examples/notFoundErrorPageExtension.tsx b/packages/app-next/src/examples/notFoundErrorPageExtension.tsx index 7f690f90cb..965fe92eb8 100644 --- a/packages/app-next/src/examples/notFoundErrorPageExtension.tsx +++ b/packages/app-next/src/examples/notFoundErrorPageExtension.tsx @@ -14,10 +14,8 @@ * limitations under the License. */ -import { - SwappableComponentBlueprint, - NotFoundErrorPage, -} from '@backstage/frontend-plugin-api'; +import { NotFoundErrorPage } from '@backstage/frontend-plugin-api'; +import { SwappableComponentBlueprint } from '@backstage/plugin-app-react'; import Box from '@material-ui/core/Box'; import Typography from '@material-ui/core/Typography'; import { Button } from '@backstage/core-components'; diff --git a/packages/app-next/src/modules/appModuleNav.tsx b/packages/app-next/src/modules/appModuleNav.tsx index ff89b2d1de..9da6358dd3 100644 --- a/packages/app-next/src/modules/appModuleNav.tsx +++ b/packages/app-next/src/modules/appModuleNav.tsx @@ -28,10 +28,8 @@ import { import SearchIcon from '@material-ui/icons/Search'; import MenuIcon from '@material-ui/icons/Menu'; import BuildIcon from '@material-ui/icons/Build'; -import { - createFrontendModule, - NavContentBlueprint, -} from '@backstage/frontend-plugin-api'; +import { createFrontendModule } from '@backstage/frontend-plugin-api'; +import { NavContentBlueprint } from '@backstage/plugin-app-react'; import { SidebarSearchModal } from '@backstage/plugin-search'; import { NotificationsSidebarItem } from '@backstage/plugin-notifications'; import { diff --git a/packages/core-compat-api/package.json b/packages/core-compat-api/package.json index 7262eb20bd..eb34da3d34 100644 --- a/packages/core-compat-api/package.json +++ b/packages/core-compat-api/package.json @@ -33,6 +33,7 @@ "dependencies": { "@backstage/core-plugin-api": "workspace:^", "@backstage/frontend-plugin-api": "workspace:^", + "@backstage/plugin-app-react": "workspace:^", "@backstage/plugin-catalog-react": "workspace:^", "@backstage/types": "workspace:^", "@backstage/version-bridge": "workspace:^", diff --git a/packages/core-compat-api/src/convertLegacyAppOptions.tsx b/packages/core-compat-api/src/convertLegacyAppOptions.tsx index 650ea9cd58..09b8329112 100644 --- a/packages/core-compat-api/src/convertLegacyAppOptions.tsx +++ b/packages/core-compat-api/src/convertLegacyAppOptions.tsx @@ -16,21 +16,23 @@ import { ComponentType } from 'react'; import { - SwappableComponentBlueprint, ApiBlueprint, ErrorDisplayProps, createExtension, createFrontendModule, ExtensionDefinition, FrontendModule, - IconBundleBlueprint, - RouterBlueprint, - SignInPageBlueprint, - ThemeBlueprint, ErrorDisplay as SwappableErrorDisplay, NotFoundErrorPage as SwappableNotFoundErrorPage, Progress as SwappableProgress, } from '@backstage/frontend-plugin-api'; +import { + IconBundleBlueprint, + RouterBlueprint, + SignInPageBlueprint, + SwappableComponentBlueprint, + ThemeBlueprint, +} from '@backstage/plugin-app-react'; import { AnyApiFactory, AppComponents, diff --git a/packages/create-app/src/lib/versions.ts b/packages/create-app/src/lib/versions.ts index 51fa8dff84..db865a2db5 100644 --- a/packages/create-app/src/lib/versions.ts +++ b/packages/create-app/src/lib/versions.ts @@ -55,6 +55,7 @@ import { version as ui } from '../../../ui/package.json'; import { version as pluginApiDocs } from '../../../../plugins/api-docs/package.json'; import { version as pluginAppVisualizer } from '../../../../plugins/app-visualizer/package.json'; import { version as pluginAppBackend } from '../../../../plugins/app-backend/package.json'; +import { version as pluginAppReact } from '../../../../plugins/app-react/package.json'; import { version as pluginAuthBackend } from '../../../../plugins/auth-backend/package.json'; import { version as pluginAuthBackendModuleGithubProvider } from '../../../../plugins/auth-backend-module-github-provider/package.json'; import { version as pluginAuthBackendModuleGuestProvider } from '../../../../plugins/auth-backend-module-guest-provider/package.json'; @@ -118,6 +119,7 @@ export const packageVersions = { '@backstage/repo-tools': repoTools, '@backstage/plugin-api-docs': pluginApiDocs, '@backstage/plugin-app-backend': pluginAppBackend, + '@backstage/plugin-app-react': pluginAppReact, '@backstage/plugin-app-visualizer': pluginAppVisualizer, '@backstage/plugin-auth-backend': pluginAuthBackend, '@backstage/plugin-auth-backend-module-github-provider': diff --git a/packages/create-app/templates/next-app/packages/app/package.json.hbs b/packages/create-app/templates/next-app/packages/app/package.json.hbs index 726983fd69..bda3b32007 100644 --- a/packages/create-app/templates/next-app/packages/app/package.json.hbs +++ b/packages/create-app/templates/next-app/packages/app/package.json.hbs @@ -21,6 +21,7 @@ "@backstage/frontend-defaults": "^{{ version '@backstage/frontend-defaults'}}", "@backstage/frontend-plugin-api": "^{{ version '@backstage/frontend-plugin-api'}}", "@backstage/integration-react": "^{{ version '@backstage/integration-react'}}", + "@backstage/plugin-app-react": "^{{ version '@backstage/plugin-app-react'}}", "@backstage/plugin-app-visualizer": "^{{ version '@backstage/plugin-app-visualizer'}}", "@backstage/plugin-catalog": "^{{ version '@backstage/plugin-catalog'}}", "@backstage/plugin-notifications": "^{{ version '@backstage/plugin-notifications'}}", diff --git a/packages/create-app/templates/next-app/packages/app/src/modules/nav/Sidebar.tsx b/packages/create-app/templates/next-app/packages/app/src/modules/nav/Sidebar.tsx index ddfdde64d0..4d229714fa 100644 --- a/packages/create-app/templates/next-app/packages/app/src/modules/nav/Sidebar.tsx +++ b/packages/create-app/templates/next-app/packages/app/src/modules/nav/Sidebar.tsx @@ -7,7 +7,7 @@ import { } from '@backstage/core-components'; import { compatWrapper } from '@backstage/core-compat-api'; import { Sidebar } from '@backstage/core-components'; -import { NavContentBlueprint } from '@backstage/frontend-plugin-api'; +import { NavContentBlueprint } from '@backstage/plugin-app-react'; import { SidebarLogo } from './SidebarLogo'; import CreateComponentIcon from '@material-ui/icons/AddCircleOutline'; import HomeIcon from '@material-ui/icons/Home'; diff --git a/packages/frontend-defaults/package.json b/packages/frontend-defaults/package.json index c47987083d..2a69357878 100644 --- a/packages/frontend-defaults/package.json +++ b/packages/frontend-defaults/package.json @@ -42,6 +42,7 @@ "devDependencies": { "@backstage/cli": "workspace:^", "@backstage/core-plugin-api": "workspace:^", + "@backstage/plugin-app-react": "workspace:^", "@backstage/test-utils": "workspace:^", "@testing-library/jest-dom": "^6.0.0", "@testing-library/react": "^16.0.0", diff --git a/packages/frontend-defaults/src/createApp.test.tsx b/packages/frontend-defaults/src/createApp.test.tsx index c0928e7815..47f6b7895d 100644 --- a/packages/frontend-defaults/src/createApp.test.tsx +++ b/packages/frontend-defaults/src/createApp.test.tsx @@ -22,11 +22,11 @@ import { PageBlueprint, createFrontendPlugin, createFrontendFeatureLoader, - ThemeBlueprint, createFrontendModule, useAppNode, FrontendPluginInfo, } from '@backstage/frontend-plugin-api'; +import { ThemeBlueprint } from '@backstage/plugin-app-react'; import { screen, waitFor } from '@testing-library/react'; import { createApp } from './createApp'; import { mockApis, renderWithEffects } from '@backstage/test-utils'; diff --git a/packages/frontend-defaults/src/createPublicSignInApp.test.tsx b/packages/frontend-defaults/src/createPublicSignInApp.test.tsx index e80d058140..398dbcbf4a 100644 --- a/packages/frontend-defaults/src/createPublicSignInApp.test.tsx +++ b/packages/frontend-defaults/src/createPublicSignInApp.test.tsx @@ -14,10 +14,8 @@ * limitations under the License. */ -import { - SignInPageBlueprint, - createFrontendModule, -} from '@backstage/frontend-plugin-api'; +import { createFrontendModule } from '@backstage/frontend-plugin-api'; +import { SignInPageBlueprint } from '@backstage/plugin-app-react'; import { render, screen, waitFor } from '@testing-library/react'; import { useEffect } from 'react'; import { createPublicSignInApp } from './createPublicSignInApp'; diff --git a/packages/frontend-plugin-api/report.api.md b/packages/frontend-plugin-api/report.api.md index 3d5efd5765..76ca364952 100644 --- a/packages/frontend-plugin-api/report.api.md +++ b/packages/frontend-plugin-api/report.api.md @@ -13,7 +13,6 @@ import { ExpandRecursive } from '@backstage/types'; import { ExtensionBlueprint as ExtensionBlueprint_2 } from '@backstage/frontend-plugin-api'; import { ExtensionBlueprintParams as ExtensionBlueprintParams_2 } from '@backstage/frontend-plugin-api'; import { ExtensionDataRef as ExtensionDataRef_2 } from '@backstage/frontend-plugin-api'; -import { IconComponent as IconComponent_2 } from '@backstage/frontend-plugin-api'; import { JsonObject } from '@backstage/types'; import { JsonValue } from '@backstage/types'; import { JSX as JSX_2 } from 'react/jsx-runtime'; @@ -21,7 +20,6 @@ import { JSX as JSX_3 } from 'react'; import { Observable } from '@backstage/types'; import { PropsWithChildren } from 'react'; import { ReactNode } from 'react'; -import { RouteRef as RouteRef_2 } from '@backstage/frontend-plugin-api'; import { SwappableComponentRef as SwappableComponentRef_2 } from '@backstage/frontend-plugin-api'; import type { z } from 'zod'; @@ -271,30 +269,6 @@ export const AppRootElementBlueprint: ExtensionBlueprint_2<{ dataRefs: never; }>; -// @public @deprecated -export const AppRootWrapperBlueprint: ExtensionBlueprint_2<{ - kind: 'app-root-wrapper'; - params: { - Component?: [error: 'Use the `component` parameter instead']; - component: (props: { children: ReactNode }) => JSX.Element | null; - }; - output: ExtensionDataRef_2< - (props: { children: ReactNode }) => JSX.Element | null, - 'app.root.wrapper', - {} - >; - inputs: {}; - config: {}; - configInput: {}; - dataRefs: { - component: ConfigurableExtensionDataRef_2< - (props: { children: ReactNode }) => JSX.Element | null, - 'app.root.wrapper', - {} - >; - }; -}>; - // @public export type AppTheme = { id: string; @@ -1461,33 +1435,6 @@ export const googleAuthApiRef: ApiRef< SessionApi >; -// @public @deprecated (undocumented) -export const IconBundleBlueprint: ExtensionBlueprint_2<{ - kind: 'icon-bundle'; - params: { - icons: { [key in string]: IconComponent }; - }; - output: ExtensionDataRef_2< - { - [x: string]: IconComponent; - }, - 'core.icons', - {} - >; - inputs: {}; - config: {}; - configInput: {}; - dataRefs: { - icons: ConfigurableExtensionDataRef_2< - { - [x: string]: IconComponent; - }, - 'core.icons', - {} - >; - }; -}>; - // @public export type IconComponent = ComponentType<{ fontSize?: 'medium' | 'large' | 'small' | 'inherit'; @@ -1526,45 +1473,6 @@ export const microsoftAuthApiRef: ApiRef< SessionApi >; -// @public @deprecated -export const NavContentBlueprint: ExtensionBlueprint_2<{ - kind: 'nav-content'; - params: { - component: NavContentComponent; - }; - output: ExtensionDataRef_2< - NavContentComponent, - 'core.nav-content.component', - {} - >; - inputs: {}; - config: {}; - configInput: {}; - dataRefs: { - component: ConfigurableExtensionDataRef_2< - NavContentComponent, - 'core.nav-content.component', - {} - >; - }; -}>; - -// @public -export type NavContentComponent = ( - props: NavContentComponentProps, -) => JSX.Element | null; - -// @public -export interface NavContentComponentProps { - items: Array<{ - icon: IconComponent_2; - title: string; - routeRef: RouteRef_2; - to: string; - text: string; - }>; -} - // @public export const NavItemBlueprint: ExtensionBlueprint_2<{ kind: 'nav-item'; @@ -1927,30 +1835,6 @@ export type RouteFunc = ( : readonly [params: TParams] ) => string; -// @public @deprecated (undocumented) -export const RouterBlueprint: ExtensionBlueprint_2<{ - kind: 'app-router-component'; - params: { - Component?: [error: 'Use the `component` parameter instead']; - component: (props: { children: ReactNode }) => JSX.Element | null; - }; - output: ExtensionDataRef_2< - (props: { children: ReactNode }) => JSX.Element | null, - 'app.router.wrapper', - {} - >; - inputs: {}; - config: {}; - configInput: {}; - dataRefs: { - component: ConfigurableExtensionDataRef_2< - (props: { children: ReactNode }) => JSX.Element | null, - 'app.router.wrapper', - {} - >; - }; -}>; - // @public export interface RouteRef< TParams extends AnyRouteRefParams = AnyRouteRefParams, @@ -2002,35 +1886,6 @@ export namespace SessionState { export type SignedOut = typeof SessionState.SignedOut; } -// @public @deprecated -export const SignInPageBlueprint: ExtensionBlueprint_2<{ - kind: 'sign-in-page'; - params: { - loader: () => Promise>; - }; - output: ExtensionDataRef_2< - ComponentType, - 'core.sign-in-page.component', - {} - >; - inputs: {}; - config: {}; - configInput: {}; - dataRefs: { - component: ConfigurableExtensionDataRef_2< - ComponentType, - 'core.sign-in-page.component', - {} - >; - }; -}>; - -// @public -export type SignInPageProps = { - onSignInSuccess(identityApi: IdentityApi): void; - children?: ReactNode; -}; - // @public export interface StorageApi { forBucket(name: string): StorageApi; @@ -2070,65 +1925,6 @@ export interface SubRouteRef< readonly T: TParams; } -// @public @deprecated -export const SwappableComponentBlueprint: ExtensionBlueprint_2<{ - kind: 'component'; - params: >(params: { - component: Ref extends SwappableComponentRef< - any, - infer IExternalComponentProps - > - ? { - ref: Ref; - } & ((props: IExternalComponentProps) => JSX.Element | null) - : never; - loader: Ref extends SwappableComponentRef - ? - | (() => (props: IInnerComponentProps) => JSX.Element | null) - | (() => Promise<(props: IInnerComponentProps) => JSX.Element | null>) - : never; - }) => ExtensionBlueprintParams_2<{ - component: Ref extends SwappableComponentRef< - any, - infer IExternalComponentProps - > - ? { - ref: Ref; - } & ((props: IExternalComponentProps) => JSX.Element | null) - : never; - loader: Ref extends SwappableComponentRef - ? - | (() => (props: IInnerComponentProps) => JSX.Element | null) - | (() => Promise<(props: IInnerComponentProps) => JSX.Element | null>) - : never; - }>; - output: ExtensionDataRef_2< - { - ref: SwappableComponentRef; - loader: - | (() => (props: {}) => JSX.Element | null) - | (() => Promise<(props: {}) => JSX.Element | null>); - }, - 'core.swappableComponent', - {} - >; - inputs: {}; - config: {}; - configInput: {}; - dataRefs: { - component: ConfigurableExtensionDataRef_2< - { - ref: SwappableComponentRef; - loader: - | (() => (props: {}) => JSX.Element | null) - | (() => Promise<(props: {}) => JSX.Element | null>); - }, - 'core.swappableComponent', - {} - >; - }; -}>; - // @public (undocumented) export type SwappableComponentRef< TInnerComponentProps extends {} = {}, @@ -2154,21 +1950,6 @@ export interface SwappableComponentsApi { // @public export const swappableComponentsApiRef: ApiRef_2; -// @public @deprecated -export const ThemeBlueprint: ExtensionBlueprint_2<{ - kind: 'theme'; - params: { - theme: AppTheme; - }; - output: ExtensionDataRef_2; - inputs: {}; - config: {}; - configInput: {}; - dataRefs: { - theme: ConfigurableExtensionDataRef_2; - }; -}>; - // @public (undocumented) export type TranslationApi = { getTranslation< @@ -2190,43 +1971,6 @@ export type TranslationApi = { // @public (undocumented) export const translationApiRef: ApiRef; -// @public @deprecated -export const TranslationBlueprint: ExtensionBlueprint_2<{ - kind: 'translation'; - params: { - resource: TranslationResource | TranslationMessages; - }; - output: ExtensionDataRef_2< - | TranslationResource - | TranslationMessages< - string, - { - [x: string]: string; - }, - boolean - >, - 'core.translation.translation', - {} - >; - inputs: {}; - config: {}; - configInput: {}; - dataRefs: { - translation: ConfigurableExtensionDataRef_2< - | TranslationResource - | TranslationMessages< - string, - { - [x: string]: string; - }, - boolean - >, - 'core.translation.translation', - {} - >; - }; -}>; - // @public (undocumented) export type TranslationFunction< TMessages extends { diff --git a/packages/frontend-plugin-api/src/blueprints/index.ts b/packages/frontend-plugin-api/src/blueprints/index.ts index 379c8d237b..344b44dbff 100644 --- a/packages/frontend-plugin-api/src/blueprints/index.ts +++ b/packages/frontend-plugin-api/src/blueprints/index.ts @@ -20,20 +20,5 @@ export { } from './AnalyticsImplementationBlueprint'; export { ApiBlueprint } from './ApiBlueprint'; export { AppRootElementBlueprint } from './AppRootElementBlueprint'; -export { AppRootWrapperBlueprint } from './AppRootWrapperBlueprint'; -export { IconBundleBlueprint } from './IconBundleBlueprint'; -export { - NavContentBlueprint, - type NavContentComponent, - type NavContentComponentProps, -} from './NavContentBlueprint'; export { NavItemBlueprint } from './NavItemBlueprint'; export { PageBlueprint } from './PageBlueprint'; -export { RouterBlueprint } from './RouterBlueprint'; -export { - type SignInPageProps, - SignInPageBlueprint, -} from './SignInPageBlueprint'; -export { ThemeBlueprint } from './ThemeBlueprint'; -export { TranslationBlueprint } from './TranslationBlueprint'; -export { SwappableComponentBlueprint } from './SwappableComponentBlueprint'; diff --git a/plugins/app-react/report.api.md b/plugins/app-react/report.api.md index 251152a9e6..78f4bd3bfb 100644 --- a/plugins/app-react/report.api.md +++ b/plugins/app-react/report.api.md @@ -10,10 +10,9 @@ import { ExtensionBlueprint } from '@backstage/frontend-plugin-api'; import { ExtensionBlueprintParams } from '@backstage/frontend-plugin-api'; import { ExtensionDataRef } from '@backstage/frontend-plugin-api'; import { IconComponent } from '@backstage/frontend-plugin-api'; -import { NavContentComponent } from '@backstage/frontend-plugin-api'; -import { NavContentComponentProps } from '@backstage/frontend-plugin-api'; +import { IdentityApi } from '@backstage/frontend-plugin-api'; import { ReactNode } from 'react'; -import { SignInPageProps } from '@backstage/frontend-plugin-api'; +import { RouteRef } from '@backstage/frontend-plugin-api'; import { SwappableComponentRef } from '@backstage/frontend-plugin-api'; import { TranslationMessages } from '@backstage/frontend-plugin-api'; import { TranslationResource } from '@backstage/frontend-plugin-api'; @@ -92,9 +91,21 @@ export const NavContentBlueprint: ExtensionBlueprint<{ }; }>; -export { NavContentComponent }; +// @public +export type NavContentComponent = ( + props: NavContentComponentProps, +) => JSX.Element | null; -export { NavContentComponentProps }; +// @public +export interface NavContentComponentProps { + items: Array<{ + icon: IconComponent; + title: string; + routeRef: RouteRef; + to: string; + text: string; + }>; +} // @public export const RouterBlueprint: ExtensionBlueprint<{ @@ -143,7 +154,11 @@ export const SignInPageBlueprint: ExtensionBlueprint<{ }; }>; -export { SignInPageProps }; +// @public +export type SignInPageProps = { + onSignInSuccess(identityApi: IdentityApi): void; + children?: ReactNode; +}; // @public export const SwappableComponentBlueprint: ExtensionBlueprint<{ @@ -160,14 +175,7 @@ export const SwappableComponentBlueprint: ExtensionBlueprint<{ loader: Ref extends SwappableComponentRef ? | (() => (props: IInnerComponentProps) => JSX.Element | null) - | (() => Promise< - (props: IInnerComponentProps) => JSX.Element - /** - * Creates an extension that replaces the router component. This blueprint is limited to use by the app plugin. - * - * @public - */ | null - >) + | (() => Promise<(props: IInnerComponentProps) => JSX.Element | null>) : never; }) => ExtensionBlueprintParams<{ component: Ref extends SwappableComponentRef< @@ -181,14 +189,7 @@ export const SwappableComponentBlueprint: ExtensionBlueprint<{ loader: Ref extends SwappableComponentRef ? | (() => (props: IInnerComponentProps) => JSX.Element | null) - | (() => Promise< - (props: IInnerComponentProps) => JSX.Element - /** - * Creates an extension that replaces the router component. This blueprint is limited to use by the app plugin. - * - * @public - */ | null - >) + | (() => Promise<(props: IInnerComponentProps) => JSX.Element | null>) : never; }>; output: ExtensionDataRef< diff --git a/packages/frontend-plugin-api/src/blueprints/AppRootWrapperBlueprint.test.tsx b/plugins/app-react/src/blueprints/AppRootWrapperBlueprint.test.tsx similarity index 97% rename from packages/frontend-plugin-api/src/blueprints/AppRootWrapperBlueprint.test.tsx rename to plugins/app-react/src/blueprints/AppRootWrapperBlueprint.test.tsx index 0f26af3243..cd459b371f 100644 --- a/packages/frontend-plugin-api/src/blueprints/AppRootWrapperBlueprint.test.tsx +++ b/plugins/app-react/src/blueprints/AppRootWrapperBlueprint.test.tsx @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2026 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ import { coreExtensionData, createExtension, createExtensionInput, -} from '../wiring'; +} from '@backstage/frontend-plugin-api'; import { renderTestApp } from '@backstage/frontend-test-utils'; describe('AppRootWrapperBlueprint', () => { diff --git a/packages/frontend-plugin-api/src/blueprints/AppRootWrapperBlueprint.tsx b/plugins/app-react/src/blueprints/AppRootWrapperBlueprint.tsx similarity index 79% rename from packages/frontend-plugin-api/src/blueprints/AppRootWrapperBlueprint.tsx rename to plugins/app-react/src/blueprints/AppRootWrapperBlueprint.tsx index 184a8c3327..bfeef61e1d 100644 --- a/packages/frontend-plugin-api/src/blueprints/AppRootWrapperBlueprint.tsx +++ b/plugins/app-react/src/blueprints/AppRootWrapperBlueprint.tsx @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2026 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,10 @@ */ import { ReactNode } from 'react'; -import { createExtensionBlueprint, createExtensionDataRef } from '../wiring'; +import { + createExtensionBlueprint, + createExtensionDataRef, +} from '@backstage/frontend-plugin-api'; const componentDataRef = createExtensionDataRef< (props: { children: ReactNode }) => JSX.Element | null @@ -24,12 +27,9 @@ const componentDataRef = createExtensionDataRef< /** * Creates a extensions that render a React wrapper at the app root, enclosing * the app layout. This is useful for example for adding global React contexts - * and similar. + * and similar. This blueprint is limited to use by the app plugin. * * @public - * @deprecated Use {@link @backstage/plugin-app-react#AppRootWrapperBlueprint} instead. - * If you were using this blueprint to provide a context for your plugin, - * use `PluginWrapperBlueprint` from `@backstage/frontend-plugin-api/alpha` instead. */ export const AppRootWrapperBlueprint = createExtensionBlueprint({ kind: 'app-root-wrapper', diff --git a/packages/frontend-plugin-api/src/blueprints/IconBundleBlueprint.ts b/plugins/app-react/src/blueprints/IconBundleBlueprint.ts similarity index 75% rename from packages/frontend-plugin-api/src/blueprints/IconBundleBlueprint.ts rename to plugins/app-react/src/blueprints/IconBundleBlueprint.ts index 2f52f7590a..ce340c2aeb 100644 --- a/packages/frontend-plugin-api/src/blueprints/IconBundleBlueprint.ts +++ b/plugins/app-react/src/blueprints/IconBundleBlueprint.ts @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2026 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,16 +14,20 @@ * limitations under the License. */ -import { IconComponent } from '../icons'; -import { createExtensionBlueprint, createExtensionDataRef } from '../wiring'; +import { IconComponent } from '@backstage/frontend-plugin-api'; +import { + createExtensionBlueprint, + createExtensionDataRef, +} from '@backstage/frontend-plugin-api'; const iconsDataRef = createExtensionDataRef<{ [key in string]: IconComponent; }>().with({ id: 'core.icons' }); /** + * Creates an extension that adds icon bundles to your app. This blueprint is limited to use by the app plugin. + * * @public - * @deprecated Use {@link @backstage/plugin-app-react#IconBundleBlueprint} instead. */ export const IconBundleBlueprint = createExtensionBlueprint({ kind: 'icon-bundle', diff --git a/packages/frontend-plugin-api/src/blueprints/NavContentBlueprint.test.tsx b/plugins/app-react/src/blueprints/NavContentBlueprint.test.tsx similarity index 100% rename from packages/frontend-plugin-api/src/blueprints/NavContentBlueprint.test.tsx rename to plugins/app-react/src/blueprints/NavContentBlueprint.test.tsx diff --git a/packages/frontend-plugin-api/src/blueprints/NavContentBlueprint.ts b/plugins/app-react/src/blueprints/NavContentBlueprint.ts similarity index 87% rename from packages/frontend-plugin-api/src/blueprints/NavContentBlueprint.ts rename to plugins/app-react/src/blueprints/NavContentBlueprint.ts index f56de2032b..0f21ed832a 100644 --- a/packages/frontend-plugin-api/src/blueprints/NavContentBlueprint.ts +++ b/plugins/app-react/src/blueprints/NavContentBlueprint.ts @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2026 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,10 @@ */ import { IconComponent, RouteRef } from '@backstage/frontend-plugin-api'; -import { createExtensionBlueprint, createExtensionDataRef } from '../wiring'; +import { + createExtensionBlueprint, + createExtensionDataRef, +} from '@backstage/frontend-plugin-api'; /** * The props for the {@link NavContentComponent}. @@ -25,7 +28,7 @@ import { createExtensionBlueprint, createExtensionDataRef } from '../wiring'; export interface NavContentComponentProps { /** * The nav items available to the component. These are all the items created - * with the {@link NavItemBlueprint} in the app. + * with the {@link @backstage/frontend-plugin-api#NavItemBlueprint} in the app. * * In addition to the original properties from the nav items, these also * include a resolved route path as `to`, and duplicated `title` as `text` to @@ -57,10 +60,9 @@ const componentDataRef = createExtensionDataRef().with({ }); /** - * Creates an extension that replaces the entire nav bar with your own component. + * Creates an extension that replaces the entire nav bar with your own component. This blueprint is limited to use by the app plugin. * * @public - * @deprecated Use {@link @backstage/plugin-app-react#NavContentBlueprint} instead. */ export const NavContentBlueprint = createExtensionBlueprint({ kind: 'nav-content', diff --git a/packages/frontend-plugin-api/src/blueprints/RouterBlueprint.test.tsx b/plugins/app-react/src/blueprints/RouterBlueprint.test.tsx similarity index 98% rename from packages/frontend-plugin-api/src/blueprints/RouterBlueprint.test.tsx rename to plugins/app-react/src/blueprints/RouterBlueprint.test.tsx index f2e5199124..0371794fff 100644 --- a/packages/frontend-plugin-api/src/blueprints/RouterBlueprint.test.tsx +++ b/plugins/app-react/src/blueprints/RouterBlueprint.test.tsx @@ -20,7 +20,7 @@ import { coreExtensionData, createExtension, createExtensionInput, -} from '../wiring'; +} from '@backstage/frontend-plugin-api'; import { createExtensionTester } from '@backstage/frontend-test-utils'; describe('RouterBlueprint', () => { diff --git a/packages/frontend-plugin-api/src/blueprints/RouterBlueprint.tsx b/plugins/app-react/src/blueprints/RouterBlueprint.tsx similarity index 83% rename from packages/frontend-plugin-api/src/blueprints/RouterBlueprint.tsx rename to plugins/app-react/src/blueprints/RouterBlueprint.tsx index 88096cf16a..dde2bc83e8 100644 --- a/packages/frontend-plugin-api/src/blueprints/RouterBlueprint.tsx +++ b/plugins/app-react/src/blueprints/RouterBlueprint.tsx @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2026 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,15 +15,19 @@ */ import { ReactNode } from 'react'; -import { createExtensionBlueprint, createExtensionDataRef } from '../wiring'; +import { + createExtensionBlueprint, + createExtensionDataRef, +} from '@backstage/frontend-plugin-api'; const componentDataRef = createExtensionDataRef< (props: { children: ReactNode }) => JSX.Element | null >().with({ id: 'app.router.wrapper' }); /** + * Creates an extension that replaces the router component. This blueprint is limited to use by the app plugin. + * * @public - * @deprecated Use {@link @backstage/plugin-app-react#RouterBlueprint} instead. */ export const RouterBlueprint = createExtensionBlueprint({ kind: 'app-router-component', diff --git a/packages/frontend-plugin-api/src/blueprints/SignInPageBlueprint.test.tsx b/plugins/app-react/src/blueprints/SignInPageBlueprint.test.tsx similarity index 100% rename from packages/frontend-plugin-api/src/blueprints/SignInPageBlueprint.test.tsx rename to plugins/app-react/src/blueprints/SignInPageBlueprint.test.tsx diff --git a/packages/frontend-plugin-api/src/blueprints/SignInPageBlueprint.tsx b/plugins/app-react/src/blueprints/SignInPageBlueprint.tsx similarity index 83% rename from packages/frontend-plugin-api/src/blueprints/SignInPageBlueprint.tsx rename to plugins/app-react/src/blueprints/SignInPageBlueprint.tsx index 9f51e8f666..fd60947b0a 100644 --- a/packages/frontend-plugin-api/src/blueprints/SignInPageBlueprint.tsx +++ b/plugins/app-react/src/blueprints/SignInPageBlueprint.tsx @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2026 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,9 +15,12 @@ */ import { ComponentType, lazy, ReactNode } from 'react'; -import { createExtensionBlueprint, createExtensionDataRef } from '../wiring'; -import { ExtensionBoundary } from '../components'; -import { IdentityApi } from '../apis'; +import { + createExtensionBlueprint, + createExtensionDataRef, + ExtensionBoundary, + IdentityApi, +} from '@backstage/frontend-plugin-api'; /** * Props for the `SignInPage` component. @@ -41,10 +44,9 @@ const componentDataRef = createExtensionDataRef< >().with({ id: 'core.sign-in-page.component' }); /** - * Creates an extension that replaces the sign in page. + * Creates an extension that replaces the sign in page. This blueprint is limited to use by the app plugin. * * @public - * @deprecated Use {@link @backstage/plugin-app-react#SignInPageBlueprint} instead. */ export const SignInPageBlueprint = createExtensionBlueprint({ kind: 'sign-in-page', diff --git a/packages/frontend-plugin-api/src/blueprints/SwappableComponentBlueprint.test.tsx b/plugins/app-react/src/blueprints/SwappableComponentBlueprint.test.tsx similarity index 97% rename from packages/frontend-plugin-api/src/blueprints/SwappableComponentBlueprint.test.tsx rename to plugins/app-react/src/blueprints/SwappableComponentBlueprint.test.tsx index 63436308ed..8d9f886c58 100644 --- a/packages/frontend-plugin-api/src/blueprints/SwappableComponentBlueprint.test.tsx +++ b/plugins/app-react/src/blueprints/SwappableComponentBlueprint.test.tsx @@ -14,9 +14,11 @@ * limitations under the License. */ import { renderTestApp } from '@backstage/frontend-test-utils'; -import { createSwappableComponent } from '../components'; +import { + createSwappableComponent, + PageBlueprint, +} from '@backstage/frontend-plugin-api'; import { SwappableComponentBlueprint } from './SwappableComponentBlueprint'; -import { PageBlueprint } from './PageBlueprint'; import { screen } from '@testing-library/react'; describe('SwappableComponentBlueprint', () => { diff --git a/packages/frontend-plugin-api/src/blueprints/SwappableComponentBlueprint.ts b/plugins/app-react/src/blueprints/SwappableComponentBlueprint.ts similarity index 89% rename from packages/frontend-plugin-api/src/blueprints/SwappableComponentBlueprint.ts rename to plugins/app-react/src/blueprints/SwappableComponentBlueprint.ts index 38e333826a..801e258367 100644 --- a/packages/frontend-plugin-api/src/blueprints/SwappableComponentBlueprint.ts +++ b/plugins/app-react/src/blueprints/SwappableComponentBlueprint.ts @@ -1,5 +1,5 @@ /* - * Copyright 2025 The Backstage Authors + * Copyright 2026 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,12 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { SwappableComponentRef } from '../components'; + +import { SwappableComponentRef } from '@backstage/frontend-plugin-api'; import { createExtensionBlueprint, createExtensionBlueprintParams, createExtensionDataRef, -} from '../wiring'; +} from '@backstage/frontend-plugin-api'; export const componentDataRef = createExtensionDataRef<{ ref: SwappableComponentRef; @@ -28,10 +29,9 @@ export const componentDataRef = createExtensionDataRef<{ }>().with({ id: 'core.swappableComponent' }); /** - * Blueprint for creating swappable components from a SwappableComponentRef and a loader + * Blueprint for creating swappable components from a SwappableComponentRef and a loader. This blueprint is limited to use by the app plugin. * * @public - * @deprecated Use {@link @backstage/plugin-app-react#SwappableComponentBlueprint} instead. */ export const SwappableComponentBlueprint = createExtensionBlueprint({ kind: 'component', diff --git a/packages/frontend-plugin-api/src/blueprints/ThemeBlueprint.test.ts b/plugins/app-react/src/blueprints/ThemeBlueprint.test.ts similarity index 96% rename from packages/frontend-plugin-api/src/blueprints/ThemeBlueprint.test.ts rename to plugins/app-react/src/blueprints/ThemeBlueprint.test.ts index 7a53f28fa3..5ee66ece67 100644 --- a/packages/frontend-plugin-api/src/blueprints/ThemeBlueprint.test.ts +++ b/plugins/app-react/src/blueprints/ThemeBlueprint.test.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AppTheme } from '../apis/definitions/AppThemeApi'; +import { AppTheme } from '@backstage/frontend-plugin-api'; import { ThemeBlueprint } from './ThemeBlueprint'; import { createExtensionTester } from '@backstage/frontend-test-utils'; diff --git a/packages/frontend-plugin-api/src/blueprints/ThemeBlueprint.ts b/plugins/app-react/src/blueprints/ThemeBlueprint.ts similarity index 75% rename from packages/frontend-plugin-api/src/blueprints/ThemeBlueprint.ts rename to plugins/app-react/src/blueprints/ThemeBlueprint.ts index f93075181e..559b442f4c 100644 --- a/packages/frontend-plugin-api/src/blueprints/ThemeBlueprint.ts +++ b/plugins/app-react/src/blueprints/ThemeBlueprint.ts @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2026 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,18 +14,20 @@ * limitations under the License. */ -import { AppTheme } from '../apis/definitions/AppThemeApi'; -import { createExtensionBlueprint, createExtensionDataRef } from '../wiring'; +import { AppTheme } from '@backstage/frontend-plugin-api'; +import { + createExtensionBlueprint, + createExtensionDataRef, +} from '@backstage/frontend-plugin-api'; const themeDataRef = createExtensionDataRef().with({ id: 'core.theme.theme', }); /** - * Creates an extension that adds/replaces an app theme. + * Creates an extension that adds/replaces an app theme. This blueprint is limited to use by the app plugin. * * @public - * @deprecated Use {@link @backstage/plugin-app-react#ThemeBlueprint} instead. */ export const ThemeBlueprint = createExtensionBlueprint({ kind: 'theme', diff --git a/packages/frontend-plugin-api/src/blueprints/TranslationBlueprint.test.ts b/plugins/app-react/src/blueprints/TranslationBlueprint.test.ts similarity index 98% rename from packages/frontend-plugin-api/src/blueprints/TranslationBlueprint.test.ts rename to plugins/app-react/src/blueprints/TranslationBlueprint.test.ts index 07e02c1562..bf291526ca 100644 --- a/packages/frontend-plugin-api/src/blueprints/TranslationBlueprint.test.ts +++ b/plugins/app-react/src/blueprints/TranslationBlueprint.test.ts @@ -17,7 +17,7 @@ import { createExtensionTester } from '@backstage/frontend-test-utils'; import { createTranslationMessages, createTranslationRef, -} from '../translation'; +} from '@backstage/frontend-plugin-api'; import { TranslationBlueprint } from './TranslationBlueprint'; describe('TranslationBlueprint', () => { diff --git a/packages/frontend-plugin-api/src/blueprints/TranslationBlueprint.ts b/plugins/app-react/src/blueprints/TranslationBlueprint.ts similarity index 76% rename from packages/frontend-plugin-api/src/blueprints/TranslationBlueprint.ts rename to plugins/app-react/src/blueprints/TranslationBlueprint.ts index 491053d763..a45fb26b49 100644 --- a/packages/frontend-plugin-api/src/blueprints/TranslationBlueprint.ts +++ b/plugins/app-react/src/blueprints/TranslationBlueprint.ts @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Backstage Authors + * Copyright 2026 The Backstage Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,18 +14,21 @@ * limitations under the License. */ -import { createExtensionBlueprint, createExtensionDataRef } from '../wiring'; -import { TranslationMessages, TranslationResource } from '../translation'; +import { + createExtensionBlueprint, + createExtensionDataRef, + TranslationMessages, + TranslationResource, +} from '@backstage/frontend-plugin-api'; const translationDataRef = createExtensionDataRef< TranslationResource | TranslationMessages >().with({ id: 'core.translation.translation' }); /** - * Creates an extension that adds translations to your app. + * Creates an extension that adds translations to your app. This blueprint is limited to use by the app plugin. * * @public - * @deprecated Use {@link @backstage/plugin-app-react#TranslationBlueprint} instead. */ export const TranslationBlueprint = createExtensionBlueprint({ kind: 'translation', diff --git a/plugins/app-react/src/blueprints/index.ts b/plugins/app-react/src/blueprints/index.ts index f5e4d7ac4a..15a0fdcd47 100644 --- a/plugins/app-react/src/blueprints/index.ts +++ b/plugins/app-react/src/blueprints/index.ts @@ -14,94 +14,16 @@ * limitations under the License. */ -import { - AppRootWrapperBlueprint as _AppRootWrapperBlueprint, - IconBundleBlueprint as _IconBundleBlueprint, - NavContentBlueprint as _NavContentBlueprint, - type NavContentComponent, - type NavContentComponentProps, - RouterBlueprint as _RouterBlueprint, - SignInPageBlueprint as _SignInPageBlueprint, - type SignInPageProps, - SwappableComponentBlueprint as _SwappableComponentBlueprint, - ThemeBlueprint as _ThemeBlueprint, - TranslationBlueprint as _TranslationBlueprint, -} from '@backstage/frontend-plugin-api'; - -/** - * Creates an extension that renders a React wrapper at the app root, enclosing - * the app layout. This blueprint is limited to use by the app plugin. - * - * @public - */ -export const AppRootWrapperBlueprint = _AppRootWrapperBlueprint; - -/** - * Creates an extension that adds/replaces an app theme. This blueprint is limited to use by the app plugin. - * - * @public - */ -export const ThemeBlueprint = _ThemeBlueprint; - -/** - * Blueprint for creating swappable components from a SwappableComponentRef and a loader. This blueprint is limited to use by the app plugin. - * - * @public - */ -export const SwappableComponentBlueprint = _SwappableComponentBlueprint; - -/** - * Creates an extension that replaces the sign in page. This blueprint is limited to use by the app plugin. - * - * @public - */ -export const SignInPageBlueprint = _SignInPageBlueprint; - -/** - * Creates an extension that replaces the router component. This blueprint is limited to use by the app plugin. - * - * @public - */ -export const RouterBlueprint = _RouterBlueprint; - -/** - * Creates an extension that replaces the entire nav bar with your own component. This blueprint is limited to use by the app plugin. - * - * @public - */ -export const NavContentBlueprint = _NavContentBlueprint; - -/** - * Creates an extension that adds icon bundles to your app. This blueprint is limited to use by the app plugin. - * - * @public - */ -export const IconBundleBlueprint = _IconBundleBlueprint; - -/** - * Props for the `SignInPage` component. - * - * @public - */ -export type { SignInPageProps }; - -/** - * The props for the {@link NavContentComponent}. - * - * @public - */ -export type { NavContentComponentProps }; - -/** - * A component that renders the nav bar content, to be passed to the {@link NavContentBlueprint}. - * - * @public - */ -export type { NavContentComponent }; - -/** - * Creates an extension that adds translations to your app. This blueprint is limited to use by the app plugin. - * - * @public - */ -export const TranslationBlueprint = _TranslationBlueprint; +export { AppRootWrapperBlueprint } from './AppRootWrapperBlueprint'; +export { IconBundleBlueprint } from './IconBundleBlueprint'; +export { NavContentBlueprint } from './NavContentBlueprint'; +export type { + NavContentComponent, + NavContentComponentProps, +} from './NavContentBlueprint'; +export { RouterBlueprint } from './RouterBlueprint'; +export { SignInPageBlueprint } from './SignInPageBlueprint'; +export type { SignInPageProps } from './SignInPageBlueprint'; +export { SwappableComponentBlueprint } from './SwappableComponentBlueprint'; +export { ThemeBlueprint } from './ThemeBlueprint'; +export { TranslationBlueprint } from './TranslationBlueprint'; diff --git a/plugins/app-visualizer/src/components/AppVisualizerPage/DetailedVisualizer.tsx b/plugins/app-visualizer/src/components/AppVisualizerPage/DetailedVisualizer.tsx index 1d38ec8267..d6423b48f0 100644 --- a/plugins/app-visualizer/src/components/AppVisualizerPage/DetailedVisualizer.tsx +++ b/plugins/app-visualizer/src/components/AppVisualizerPage/DetailedVisualizer.tsx @@ -21,7 +21,6 @@ import { coreExtensionData, ApiBlueprint, NavItemBlueprint, - ThemeBlueprint, useApi, routeResolutionApiRef, } from '@backstage/frontend-plugin-api'; @@ -78,7 +77,6 @@ const getOutputColor = createOutputColorGenerator( [coreExtensionData.routePath.id]: '#ffeb3b', [coreExtensionData.routeRef.id]: '#9c27b0', [ApiBlueprint.dataRefs.factory.id]: '#2196f3', - [ThemeBlueprint.dataRefs.theme.id]: '#cddc39', [NavItemBlueprint.dataRefs.target.id]: '#ff9800', }, @@ -280,7 +278,6 @@ const legendMap = { 'Route Path': coreExtensionData.routePath, 'Route Ref': coreExtensionData.routeRef, 'Nav Target': NavItemBlueprint.dataRefs.target, - Theme: ThemeBlueprint.dataRefs.theme, }; function Legend() { diff --git a/plugins/app/report.api.md b/plugins/app/report.api.md index a966ddeff1..256517b86f 100644 --- a/plugins/app/report.api.md +++ b/plugins/app/report.api.md @@ -15,12 +15,12 @@ import { ExtensionDataRef } from '@backstage/frontend-plugin-api'; import { ExtensionInput } from '@backstage/frontend-plugin-api'; import { IconComponent } from '@backstage/frontend-plugin-api'; import { JSX as JSX_2 } from 'react'; -import { NavContentComponent } from '@backstage/frontend-plugin-api'; +import { NavContentComponent } from '@backstage/plugin-app-react'; import { OverridableExtensionDefinition } from '@backstage/frontend-plugin-api'; import { OverridableFrontendPlugin } from '@backstage/frontend-plugin-api'; import { ReactNode } from 'react'; import { RouteRef } from '@backstage/frontend-plugin-api'; -import { SignInPageProps } from '@backstage/frontend-plugin-api'; +import { SignInPageProps } from '@backstage/plugin-app-react'; import { SwappableComponentRef } from '@backstage/frontend-plugin-api'; import { TranslationMessages } from '@backstage/frontend-plugin-api'; import { TranslationResource } from '@backstage/frontend-plugin-api'; diff --git a/plugins/app/src/alpha/appModulePublicSignIn.test.tsx b/plugins/app/src/alpha/appModulePublicSignIn.test.tsx index 787b8949e5..c7f1e5a68d 100644 --- a/plugins/app/src/alpha/appModulePublicSignIn.test.tsx +++ b/plugins/app/src/alpha/appModulePublicSignIn.test.tsx @@ -14,10 +14,8 @@ * limitations under the License. */ -import { - SignInPageBlueprint, - createFrontendModule, -} from '@backstage/frontend-plugin-api'; +import { createFrontendModule } from '@backstage/frontend-plugin-api'; +import { SignInPageBlueprint } from '@backstage/plugin-app-react'; import { render, screen, waitFor } from '@testing-library/react'; import { useEffect } from 'react'; import { appModulePublicSignIn } from './appModulePublicSignIn'; diff --git a/plugins/app/src/apis/SwappableComponentsApi/DefaultSwappableComponentsApi.test.tsx b/plugins/app/src/apis/SwappableComponentsApi/DefaultSwappableComponentsApi.test.tsx index bdd81f338c..9d3483319f 100644 --- a/plugins/app/src/apis/SwappableComponentsApi/DefaultSwappableComponentsApi.test.tsx +++ b/plugins/app/src/apis/SwappableComponentsApi/DefaultSwappableComponentsApi.test.tsx @@ -20,9 +20,9 @@ import { createExtensionInput, createFrontendModule, createSwappableComponent, - SwappableComponentBlueprint, swappableComponentsApiRef, } from '@backstage/frontend-plugin-api'; +import { SwappableComponentBlueprint } from '@backstage/plugin-app-react'; import { DefaultSwappableComponentsApi } from './DefaultSwappableComponentsApi'; import { render, screen } from '@testing-library/react'; import { renderInTestApp, renderTestApp } from '@backstage/frontend-test-utils'; diff --git a/plugins/app/src/apis/SwappableComponentsApi/DefaultSwappableComponentsApi.tsx b/plugins/app/src/apis/SwappableComponentsApi/DefaultSwappableComponentsApi.tsx index 593fff24ff..b7c496b3d1 100644 --- a/plugins/app/src/apis/SwappableComponentsApi/DefaultSwappableComponentsApi.tsx +++ b/plugins/app/src/apis/SwappableComponentsApi/DefaultSwappableComponentsApi.tsx @@ -17,8 +17,8 @@ import { SwappableComponentRef, SwappableComponentsApi, - SwappableComponentBlueprint, } from '@backstage/frontend-plugin-api'; +import { SwappableComponentBlueprint } from '@backstage/plugin-app-react'; import { OpaqueSwappableComponentRef } from '@internal/frontend'; import { lazy } from 'react'; diff --git a/plugins/app/src/extensions/AppNav.tsx b/plugins/app/src/extensions/AppNav.tsx index bba27d1414..12e0c1a5c8 100644 --- a/plugins/app/src/extensions/AppNav.tsx +++ b/plugins/app/src/extensions/AppNav.tsx @@ -19,14 +19,16 @@ import { coreExtensionData, createExtensionInput, NavItemBlueprint, - NavContentBlueprint, - NavContentComponentProps, routeResolutionApiRef, IconComponent, RouteRef, useApi, - NavContentComponent, } from '@backstage/frontend-plugin-api'; +import { + NavContentBlueprint, + NavContentComponent, + NavContentComponentProps, +} from '@backstage/plugin-app-react'; import { Sidebar, SidebarItem } from '@backstage/core-components'; import { useMemo } from 'react'; diff --git a/plugins/app/src/extensions/AppRoot.tsx b/plugins/app/src/extensions/AppRoot.tsx index 43e10a2288..6237643056 100644 --- a/plugins/app/src/extensions/AppRoot.tsx +++ b/plugins/app/src/extensions/AppRoot.tsx @@ -22,9 +22,6 @@ import { JSX, } from 'react'; import { - AppRootWrapperBlueprint, - RouterBlueprint, - SignInPageBlueprint, coreExtensionData, discoveryApiRef, fetchApiRef, @@ -33,6 +30,11 @@ import { createExtensionInput, routeResolutionApiRef, } from '@backstage/frontend-plugin-api'; +import { + AppRootWrapperBlueprint, + RouterBlueprint, + SignInPageBlueprint, +} from '@backstage/plugin-app-react'; import { DiscoveryApi, ErrorApi, diff --git a/plugins/app/src/extensions/AppThemeApi.tsx b/plugins/app/src/extensions/AppThemeApi.tsx index cf46cab09e..e9fa23b574 100644 --- a/plugins/app/src/extensions/AppThemeApi.tsx +++ b/plugins/app/src/extensions/AppThemeApi.tsx @@ -22,10 +22,10 @@ import DarkIcon from '@material-ui/icons/Brightness2'; import LightIcon from '@material-ui/icons/WbSunny'; import { createExtensionInput, - ThemeBlueprint, ApiBlueprint, appThemeApiRef, } from '@backstage/frontend-plugin-api'; +import { ThemeBlueprint } from '@backstage/plugin-app-react'; // eslint-disable-next-line @backstage/no-relative-monorepo-imports import { AppThemeSelector } from '../../../../packages/core-app-api/src/apis/implementations'; diff --git a/plugins/app/src/extensions/DefaultSignInPage.tsx b/plugins/app/src/extensions/DefaultSignInPage.tsx index 10ad638b00..48d34c09c2 100644 --- a/plugins/app/src/extensions/DefaultSignInPage.tsx +++ b/plugins/app/src/extensions/DefaultSignInPage.tsx @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { SignInPageBlueprint } from '@backstage/frontend-plugin-api'; +import { SignInPageBlueprint } from '@backstage/plugin-app-react'; import { SignInPage } from '@backstage/core-components'; export const DefaultSignInPage = SignInPageBlueprint.make({ diff --git a/plugins/app/src/extensions/IconsApi.ts b/plugins/app/src/extensions/IconsApi.ts index 9be4a3e79a..d8a97eb7c7 100644 --- a/plugins/app/src/extensions/IconsApi.ts +++ b/plugins/app/src/extensions/IconsApi.ts @@ -16,10 +16,10 @@ import { createExtensionInput, - IconBundleBlueprint, ApiBlueprint, iconsApiRef, } from '@backstage/frontend-plugin-api'; +import { IconBundleBlueprint } from '@backstage/plugin-app-react'; // eslint-disable-next-line @backstage/no-relative-monorepo-imports import { DefaultIconsApi } from '../../../../packages/frontend-app-api/src/apis/implementations/IconsApi'; // eslint-disable-next-line @backstage/no-relative-monorepo-imports diff --git a/plugins/app/src/extensions/SwappableComponentsApi.ts b/plugins/app/src/extensions/SwappableComponentsApi.ts index d72b52a332..838b80e942 100644 --- a/plugins/app/src/extensions/SwappableComponentsApi.ts +++ b/plugins/app/src/extensions/SwappableComponentsApi.ts @@ -15,11 +15,11 @@ */ import { - SwappableComponentBlueprint, createExtensionInput, ApiBlueprint, swappableComponentsApiRef, } from '@backstage/frontend-plugin-api'; +import { SwappableComponentBlueprint } from '@backstage/plugin-app-react'; import { DefaultSwappableComponentsApi } from '../apis/SwappableComponentsApi'; /** diff --git a/plugins/app/src/extensions/TranslationsApi.tsx b/plugins/app/src/extensions/TranslationsApi.tsx index 8421dba9d9..a327aba299 100644 --- a/plugins/app/src/extensions/TranslationsApi.tsx +++ b/plugins/app/src/extensions/TranslationsApi.tsx @@ -15,9 +15,9 @@ */ import { ApiBlueprint, - TranslationBlueprint, createExtensionInput, } from '@backstage/frontend-plugin-api'; +import { TranslationBlueprint } from '@backstage/plugin-app-react'; import { appLanguageApiRef, translationApiRef, diff --git a/plugins/app/src/extensions/components.tsx b/plugins/app/src/extensions/components.tsx index 99f6291e87..72a77e2446 100644 --- a/plugins/app/src/extensions/components.tsx +++ b/plugins/app/src/extensions/components.tsx @@ -17,9 +17,8 @@ import { NotFoundErrorPage as SwappableNotFoundErrorPage, Progress as SwappableProgress, ErrorDisplay as SwappableErrorDisplay, - SwappableComponentBlueprint, } from '@backstage/frontend-plugin-api'; - +import { SwappableComponentBlueprint } from '@backstage/plugin-app-react'; import { ErrorPage, ErrorPanel, diff --git a/yarn.lock b/yarn.lock index 675eba1c8c..a47cb186d9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3571,6 +3571,7 @@ __metadata: "@backstage/frontend-app-api": "workspace:^" "@backstage/frontend-plugin-api": "workspace:^" "@backstage/frontend-test-utils": "workspace:^" + "@backstage/plugin-app-react": "workspace:^" "@backstage/plugin-catalog": "workspace:^" "@backstage/plugin-catalog-react": "workspace:^" "@backstage/test-utils": "workspace:^" @@ -3861,6 +3862,7 @@ __metadata: "@backstage/frontend-app-api": "workspace:^" "@backstage/frontend-plugin-api": "workspace:^" "@backstage/plugin-app": "workspace:^" + "@backstage/plugin-app-react": "workspace:^" "@backstage/test-utils": "workspace:^" "@react-hookz/web": "npm:^24.0.0" "@testing-library/jest-dom": "npm:^6.0.0" @@ -30966,6 +30968,7 @@ __metadata: "@backstage/integration-react": "workspace:^" "@backstage/plugin-api-docs": "workspace:^" "@backstage/plugin-app": "workspace:^" + "@backstage/plugin-app-react": "workspace:^" "@backstage/plugin-app-visualizer": "workspace:^" "@backstage/plugin-auth": "workspace:^" "@backstage/plugin-auth-react": "workspace:^"