From b291d0ed7eb8fa673ca7e07defc90b492440f90f Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 25 Nov 2021 18:30:28 +0100 Subject: [PATCH] core-plugin-api: bit clearer deprecation warning for createRouteRef Signed-off-by: Patrik Oldsberg --- .changeset/rude-brooms-raise.md | 5 +++++ packages/core-plugin-api/src/routing/RouteRef.ts | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/rude-brooms-raise.md diff --git a/.changeset/rude-brooms-raise.md b/.changeset/rude-brooms-raise.md new file mode 100644 index 0000000000..6b5bd3ca3a --- /dev/null +++ b/.changeset/rude-brooms-raise.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-plugin-api': patch +--- + +Tweaked the logged deprecation warning for `createRouteRef` to hopefully make it more clear. diff --git a/packages/core-plugin-api/src/routing/RouteRef.ts b/packages/core-plugin-api/src/routing/RouteRef.ts index 26e63c8f3a..8bd3d604f6 100644 --- a/packages/core-plugin-api/src/routing/RouteRef.ts +++ b/packages/core-plugin-api/src/routing/RouteRef.ts @@ -59,21 +59,21 @@ export class RouteRefImpl if (config.path) { // eslint-disable-next-line no-console console.warn( - `[core-plugin-api] - routeRefs no longer decide their own path, please remove the path for ${this.toString()}. This will be removed in upcoming versions.`, + `DEPRECATION WARNING: Passing a path to createRouteRef is deprecated, please remove the path for ${this}.`, ); } if (config.icon) { // eslint-disable-next-line no-console console.warn( - `[core-plugin-api] - routeRefs no longer decide their own icon, please remove the icon for ${this.toString()}. This will be removed in upcoming versions.`, + `DEPRECATION WARNING: Passing an icon to createRouteRef is deprecated, please remove the icon for ${this}.`, ); } if (config.title) { // eslint-disable-next-line no-console console.warn( - `[core-plugin-api] - routeRefs no longer decide their own title, please remove the title for ${this.toString()}. This will be removed in upcoming versions.`, + `DEPRECATION WARNING: Passing a title to createRouteRef is deprecated, please remove the title for ${this}.`, ); } }