From 55a484379a18b198739f9f286f89772d8fda8e1e Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 17 Sep 2024 10:31:45 +0200 Subject: [PATCH 1/3] docs/frontend-system: more 1.31 migration docs Signed-off-by: Patrik Oldsberg --- .../architecture/60-migrations.md | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/docs/frontend-system/architecture/60-migrations.md b/docs/frontend-system/architecture/60-migrations.md index 3687106600..eb9fae408c 100644 --- a/docs/frontend-system/architecture/60-migrations.md +++ b/docs/frontend-system/architecture/60-migrations.md @@ -14,7 +14,7 @@ This section provides migration guides for different versions of the frontend sy This guide is intended for app and plugin authors who have already migrated their code to the new frontend system, and are looking to keep it up to date with the latest changes. These guides do not cover trivial migrations that can be explained in a deprecation message, such as a renamed export. -## 1.31.0 +## 1.31 ### `namespace` parameter should be removed @@ -68,6 +68,36 @@ export default createFrontendModule({ }); ``` +### Removed support for "v1" extensions + +Extensions created with `@backstage/frontend-plugin-api` from before the 1.30 release are no longer supported by `createApp`. To be able to use extensions in a new app, they need to be created with `@backstage/frontend-plugin-api` version 0.7.0 or later. + +### New type parameters for `ExtensionDefinition` and `ExtensionBlueprint` + +The type parameters of `ExtensionDefinition` and `ExtensionBlueprint` have been updated to use a single type parameter with a object, in order by make them easier to read and evolve. + +Existing usage can generally be updated as follows: + +`ExtensionDefinition` -> `ExtensionDefinition` +`ExtensionDefinition` -> `ExtensionDefinition` +`ExtensionDefinition` -> `ExtensionDefinition<{ config: TConfig }>` +`ExtensionDefinition` -> `ExtensionDefinition<{ config: TConfig, configInput: TConfigInput }>` + +If you need to infer the parameter you can use `ExtensionDefinitionParameters` and `ExtensionBlueprintParameters`, for example: + +```tsx +import { + ExtensionDefinition, + ExtensionDefinitionParameters, +} from '@backstage/frontend-plugin-api'; + +function myUtility( + ext: ExtensionDefinition, +): T['config'] { + // ... +} +``` + ## 1.30 ### Reworked extension inputs and outputs From 2542b9046eaf4b5f217f2bba9067c79965533690 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 17 Sep 2024 10:39:52 +0200 Subject: [PATCH 2/3] Update docs/frontend-system/architecture/60-migrations.md Co-authored-by: Johan Haals Signed-off-by: Patrik Oldsberg --- docs/frontend-system/architecture/60-migrations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/frontend-system/architecture/60-migrations.md b/docs/frontend-system/architecture/60-migrations.md index eb9fae408c..a8282d95db 100644 --- a/docs/frontend-system/architecture/60-migrations.md +++ b/docs/frontend-system/architecture/60-migrations.md @@ -74,7 +74,7 @@ Extensions created with `@backstage/frontend-plugin-api` from before the 1.30 re ### New type parameters for `ExtensionDefinition` and `ExtensionBlueprint` -The type parameters of `ExtensionDefinition` and `ExtensionBlueprint` have been updated to use a single type parameter with a object, in order by make them easier to read and evolve. +The type parameters of `ExtensionDefinition` and `ExtensionBlueprint` have been updated to use a single type parameter with an object, in order to make them easier to read and evolve. Existing usage can generally be updated as follows: From d1d2116641fcca4f603d29104dcdf29190af98d5 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 17 Sep 2024 10:46:04 +0200 Subject: [PATCH 3/3] docs/frontend-system: mention createApp move Signed-off-by: Patrik Oldsberg --- docs/frontend-system/architecture/60-migrations.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/frontend-system/architecture/60-migrations.md b/docs/frontend-system/architecture/60-migrations.md index a8282d95db..9e84899dc2 100644 --- a/docs/frontend-system/architecture/60-migrations.md +++ b/docs/frontend-system/architecture/60-migrations.md @@ -68,6 +68,10 @@ export default createFrontendModule({ }); ``` +### Moved `createApp` + +The `createApp` function has been moved to the new `@backstage/frontend-defaults` package. The old export from `@backstage/frontend-app-api` is now deprecated and should be replaced with the new one. + ### Removed support for "v1" extensions Extensions created with `@backstage/frontend-plugin-api` from before the 1.30 release are no longer supported by `createApp`. To be able to use extensions in a new app, they need to be created with `@backstage/frontend-plugin-api` version 0.7.0 or later.