From 55a484379a18b198739f9f286f89772d8fda8e1e Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 17 Sep 2024 10:31:45 +0200 Subject: [PATCH] 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