Merge pull request #8249 from backstage/rugvip/korvspad

core-plugin-api: bit clearer deprecation warning for createRouteRef
This commit is contained in:
Patrik Oldsberg
2021-11-25 19:43:31 +01:00
committed by GitHub
2 changed files with 8 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-plugin-api': patch
---
Tweaked the logged deprecation warning for `createRouteRef` to hopefully make it more clear.
@@ -59,21 +59,21 @@ export class RouteRefImpl<Params extends AnyParams>
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}.`,
);
}
}