From 5aa736fb47d0a3d9b30124695a7cf34c70d2018f Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 24 Oct 2024 12:02:20 +0200 Subject: [PATCH 1/2] docs/backend-system: add backend common deprecation section to migration docs Signed-off-by: Patrik Oldsberg --- .../building-backends/08-migrating.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/backend-system/building-backends/08-migrating.md b/docs/backend-system/building-backends/08-migrating.md index 71cccab784..e3557b7788 100644 --- a/docs/backend-system/building-backends/08-migrating.md +++ b/docs/backend-system/building-backends/08-migrating.md @@ -210,6 +210,25 @@ argument of `createBackend`. ::: +## Removing `@backstage/backend-common` + +The `@backstage/backend-common` package has been deprecated as part of moving to the new backend system, an you will need to replace existing usage of it. All exports from the package have been marked as deprecated in the last few releases of the package, and each export has its own deprecation message that explains how to replace that particular export. + +These are the deprecation messages for the most common replacements: + +- `createLegacyAuthAdapters` - Migrate to use the new backend system and auth services instead. +- `errorHandler` - Use `MiddlewareFactory.create.error` from `@backstage/backend-defaults/rootHttpRouter` instead. +- `getRootLogger` - This function will be removed in the future. If you need to get the root logger in the new system, please check out this documentation: https://backstage.io/docs/backend-system/core-services/logger +- `getVoidLogger` - This function will be removed in the future. If you need to mock the root logger in the new system, please use `mockServices.logger.mock()` from `@backstage/test-utils` instead. +- `legacyPlugin` - Fully use the new backend system instead. +- `loadBackendConfig` - Please migrate to the new backend system and use `coreServices.rootConfig` instead, or the [@backstage/config-loader#ConfigSources](https://backstage.io/docs/reference/config-loader.configsources) facilities if required. +- `loggerToWinstonLogger` - Migrate to use the new `LoggerService` instead. +- `resolveSafeChildPath` - This function is deprecated and will be removed in a future release, see [#24493](https://github.com/backstage/backstage/issues/24493). Please use the `resolveSafeChildPath` function from the `@backstage/backend-plugin-api` package instead. +- `ServerTokenManager` - Please [migrate](https://backstage.io/docs/tutorials/auth-service-migration) to the new `coreServices.auth`, `coreServices.httpAuth`, and `coreServices.userInfo` services as needed instead. +- `useHotMemoize` - Hot module reloading is no longer supported for backends. + +If you want to browse all of the deprecations in one place you can look at the `dist/index.d.ts` file in the package, either in `node_modules/@backstage/backend-common/dist/index.d.ts` in your own project, or it can found in the [code tab on npmjs.com](https://www.npmjs.com/package/@backstage/backend-common?activeTab=code). + ## Cleaning Up the Plugins Folder For plugins that are private and your own, you can follow a [dedicated migration guide](../building-plugins-and-modules/08-migrating.md) as you see fit, at a From 7744703c4634c90f90bb4459bf33bd2b40e92a97 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 24 Oct 2024 13:40:32 +0200 Subject: [PATCH 2/2] Update docs/backend-system/building-backends/08-migrating.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fredrik Adelöw Signed-off-by: Patrik Oldsberg --- docs/backend-system/building-backends/08-migrating.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/backend-system/building-backends/08-migrating.md b/docs/backend-system/building-backends/08-migrating.md index e3557b7788..a827171ff7 100644 --- a/docs/backend-system/building-backends/08-migrating.md +++ b/docs/backend-system/building-backends/08-migrating.md @@ -219,7 +219,7 @@ These are the deprecation messages for the most common replacements: - `createLegacyAuthAdapters` - Migrate to use the new backend system and auth services instead. - `errorHandler` - Use `MiddlewareFactory.create.error` from `@backstage/backend-defaults/rootHttpRouter` instead. - `getRootLogger` - This function will be removed in the future. If you need to get the root logger in the new system, please check out this documentation: https://backstage.io/docs/backend-system/core-services/logger -- `getVoidLogger` - This function will be removed in the future. If you need to mock the root logger in the new system, please use `mockServices.logger.mock()` from `@backstage/test-utils` instead. +- `getVoidLogger` - This function will be removed in the future. If you need to mock the root logger in the new system, please use `mockServices.logger.mock()` from `@backstage/backend-test-utils` instead. - `legacyPlugin` - Fully use the new backend system instead. - `loadBackendConfig` - Please migrate to the new backend system and use `coreServices.rootConfig` instead, or the [@backstage/config-loader#ConfigSources](https://backstage.io/docs/reference/config-loader.configsources) facilities if required. - `loggerToWinstonLogger` - Migrate to use the new `LoggerService` instead.