Skip to content

Commit 9ccf84e

Browse files
committed
frontend-plugin-api: move app blueprints to new app-react package
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
1 parent d15524f commit 9ccf84e

33 files changed

+653
-34
lines changed

.changeset/bright-pumas-cut.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@backstage/plugin-app-backend': patch
3+
'@backstage/plugin-app-node': patch
4+
---
5+
6+
Updated plugin metadata.

.changeset/common-heads-start.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@backstage/plugin-app-react': patch
3+
---
4+
5+
Moved the following blueprints from `@backstage/frontend-plugin-api`:
6+
7+
- `IconBundleBlueprint`
8+
- `NavContentBlueprint`
9+
- `RouterBlueprint`
10+
- `SignInPageBlueprint`
11+
- `SwappableComponentBlueprint`
12+
- `ThemeBlueprint`
13+
- `TranslationBlueprint`

.changeset/curvy-zoos-drop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@backstage/plugin-app-react': minor
3+
---
4+
5+
Initial release of this web library for `@backstage/plugin-app`.

.changeset/slick-beans-relax.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@backstage/frontend-plugin-api': patch
3+
---
4+
5+
The following blueprints are being restricted to only be used in app plugin overrides and modules. They are being moved to the `@backstage/plugin-app-react` package and have been deprecated:
6+
7+
- `IconBundleBlueprint`
8+
- `NavContentBlueprint`
9+
- `RouterBlueprint`
10+
- `SignInPageBlueprint`
11+
- `SwappableComponentBlueprint`
12+
- `ThemeBlueprint`
13+
- `TranslationBlueprint`

.changeset/warm-pets-accept.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@backstage/plugin-app': patch
3+
---
4+
5+
The following blueprints are being restricted to only be used in app plugin overrides and modules. They will now produce a deprecation warning when used outside of the app plugin:
6+
7+
- `IconBundleBlueprint`
8+
- `NavContentBlueprint`
9+
- `RouterBlueprint`
10+
- `SignInPageBlueprint`
11+
- `SwappableComponentBlueprint`
12+
- `ThemeBlueprint`
13+
- `TranslationBlueprint`

docs/frontend-system/building-apps/08-migrating.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ const app = createApp({
444444
Can be converted to the following extension:
445445

446446
```tsx
447-
import { SignInPageBlueprint } from '@backstage/frontend-plugin-api';
447+
import { SignInPageBlueprint } from '@backstage/plugin-app-react';
448448
449449
const signInPage = SignInPageBlueprint.make({
450450
params: {
@@ -492,7 +492,7 @@ const app = createApp({
492492
Can be converted to the following extension:
493493

494494
```tsx
495-
import { ThemeBlueprint } from '@backstage/frontend-plugin-api';
495+
import { ThemeBlueprint } from '@backstage/plugin-app-react';
496496
497497
const customLightThemeExtension = ThemeBlueprint.make({
498498
name: 'custom-light',
@@ -535,7 +535,7 @@ const app = createApp({
535535
Icons are now installed as extensions, using the `IconBundleBlueprint` to make new instances which can be added to the app.
536536

537537
```ts
538-
import { IconBundleBlueprint } from '@backstage/frontend-plugin-api';
538+
import { IconBundleBlueprint } from '@backstage/plugin-app-react';
539539
540540
const exampleIconBundle = IconBundleBlueprint.make({
541541
name: 'example-bundle',
@@ -586,10 +586,8 @@ Can be converted to the following extension:
586586

587587
```tsx
588588
import { catalogTranslationRef } from '@backstage/plugin-catalog/alpha';
589-
import {
590-
createTranslationMessages,
591-
TranslationBlueprint,
592-
} from '@backstage/frontend-plugin-api';
589+
import { createTranslationMessages } from '@backstage/frontend-plugin-api';
590+
import { TranslationBlueprint } from '@backstage/plugin-app-react';
593591
594592
const catalogTranslations = TranslationBlueprint.make({
595593
name: 'catalog-overrides',
@@ -705,7 +703,7 @@ export const navModule = createFrontendModule({
705703
Then in the actual implementation for the `SidebarContent` extension, you can provide something like the following, where you implement the entire `Sidebar` component.
706704

707705
```tsx title="in packages/app/src/modules/nav/Sidebar.tsx"
708-
import { NavContentBlueprint } from '@backstage/frontend-plugin-api';
706+
import { NavContentBlueprint } from '@backstage/plugin-app-react';
709707
710708
export const SidebarContent = NavContentBlueprint.make({
711709
params: {

docs/frontend-system/building-plugins/03-common-extension-blueprints.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Navigation item extensions are used to provide menu items that link to different
2323

2424
Page extensions provide content for a particular route in the app. By default pages are attached to the app routes extensions, which renders the root routes.
2525

26+
## Extension blueprints in `@backstage/plugin-app-react`
27+
2628
### SignInPage - [Reference](https://backstage.io/api/stable/variables/_backstage_frontend-plugin-api.SignInPageBlueprint.html)
2729

2830
Sign-in page extension have a single purpose - to implement a custom sign-in page. They are always attached to the app root extension and are rendered before the rest of the app until the user is signed in.
@@ -43,6 +45,14 @@ Icon bundle extensions provide the ability to replace or provide new icons to th
4345

4446
Translation extension provide custom translation messages for the app. They can be used both to override the default english messages to custom ones, as well as provide translations for additional languages.
4547

48+
### NavContent - [Reference](https://backstage.io/api/stable/variables/_backstage_frontend-plugin-api.NavContentBlueprint.html)
49+
50+
Nav content extensions allow you to replace the entire navbar with your own component. They are always attached to the app nav extension.
51+
52+
### Router - [Reference](https://backstage.io/api/stable/variables/_backstage_frontend-plugin-api.RouterBlueprint.html)
53+
54+
Router extensions allow you to replace the router component used by the app. They are always attached to the app root extension.
55+
4656
## Extension blueprints in `@backstage/plugin-catalog-react/alpha`
4757

4858
These are the [extension blueprints](../architecture/23-extension-blueprints.md) provided by the Catalog plugin.

docs/frontend-system/building-plugins/06-swappable-components.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,8 @@ In order to override a Swappable Component, you need to create a `SwappableCompo
5252
There are two different ways to add extensions to the `app` plugin, both are documented below in an example of overriding the `Progress` Swappable Component.
5353

5454
```tsx title="in packages/app/src/App.tsx"
55-
import {
56-
Progress,
57-
SwappableComponentBlueprint,
58-
createFrontendModule,
59-
} from '@backstage/frontend-plugin-api';
55+
import { Progress, createFrontendModule } from '@backstage/frontend-plugin-api';
56+
import { SwappableComponentBlueprint } from '@backstage/plugin-app-react';
6057
import { MyCustomProgress } from './CustomProgress';
6158
import { createApp } from '@backstage/frontend-defaults';
6259
import appPlugin from '@backstage/plugin-app';

packages/frontend-plugin-api/report.api.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,7 +1457,7 @@ export const googleAuthApiRef: ApiRef<
14571457
SessionApi
14581458
>;
14591459

1460-
// @public (undocumented)
1460+
// @public @deprecated (undocumented)
14611461
export const IconBundleBlueprint: ExtensionBlueprint_2<{
14621462
kind: 'icon-bundle';
14631463
params: {
@@ -1522,7 +1522,7 @@ export const microsoftAuthApiRef: ApiRef<
15221522
SessionApi
15231523
>;
15241524

1525-
// @public
1525+
// @public @deprecated
15261526
export const NavContentBlueprint: ExtensionBlueprint_2<{
15271527
kind: 'nav-content';
15281528
params: {
@@ -1923,7 +1923,7 @@ export type RouteFunc<TParams extends AnyRouteRefParams> = (
19231923
: readonly [params: TParams]
19241924
) => string;
19251925

1926-
// @public (undocumented)
1926+
// @public @deprecated (undocumented)
19271927
export const RouterBlueprint: ExtensionBlueprint_2<{
19281928
kind: 'app-router-component';
19291929
params: {
@@ -1998,7 +1998,7 @@ export namespace SessionState {
19981998
export type SignedOut = typeof SessionState.SignedOut;
19991999
}
20002000

2001-
// @public
2001+
// @public @deprecated
20022002
export const SignInPageBlueprint: ExtensionBlueprint_2<{
20032003
kind: 'sign-in-page';
20042004
params: {
@@ -2066,7 +2066,7 @@ export interface SubRouteRef<
20662066
readonly T: TParams;
20672067
}
20682068

2069-
// @public
2069+
// @public @deprecated
20702070
export const SwappableComponentBlueprint: ExtensionBlueprint_2<{
20712071
kind: 'component';
20722072
params: <Ref extends SwappableComponentRef<any>>(params: {
@@ -2150,7 +2150,7 @@ export interface SwappableComponentsApi {
21502150
// @public
21512151
export const swappableComponentsApiRef: ApiRef_2<SwappableComponentsApi>;
21522152

2153-
// @public
2153+
// @public @deprecated
21542154
export const ThemeBlueprint: ExtensionBlueprint_2<{
21552155
kind: 'theme';
21562156
params: {
@@ -2186,7 +2186,7 @@ export type TranslationApi = {
21862186
// @public (undocumented)
21872187
export const translationApiRef: ApiRef<TranslationApi>;
21882188

2189-
// @public
2189+
// @public @deprecated
21902190
export const TranslationBlueprint: ExtensionBlueprint_2<{
21912191
kind: 'translation';
21922192
params: {

packages/frontend-plugin-api/src/blueprints/IconBundleBlueprint.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ const iconsDataRef = createExtensionDataRef<{
2121
[key in string]: IconComponent;
2222
}>().with({ id: 'core.icons' });
2323

24-
/** @public */
24+
/**
25+
* @public
26+
* @deprecated Use {@link @backstage/plugin-app-react#IconBundleBlueprint} instead.
27+
*/
2528
export const IconBundleBlueprint = createExtensionBlueprint({
2629
kind: 'icon-bundle',
2730
attachTo: { id: 'api:app/icons', input: 'icons' },

0 commit comments

Comments
 (0)