chore: adding deprecation warnings for routeRef deprecated options

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2021-10-20 14:58:41 +02:00
parent e29fb1a5d0
commit 6b28fa1312
@@ -23,7 +23,6 @@ import {
} from './types';
import { OldIconComponent } from '../icons/types';
// TODO(Rugvip): Remove this in the next breaking release, it's exported but unused
/**
* @deprecated
* @internal
@@ -53,13 +52,34 @@ export class RouteRefImpl<Params extends AnyParams>
icon?: OldIconComponent;
title?: string;
},
) {}
) {
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.`,
);
}
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.`,
);
}
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.`,
);
}
}
get icon() {
return this.config.icon;
}
// TODO(Rugvip): Remove this, routes are looked up via the registry instead
/** @deprecated */
get path() {
return this.config.path ?? '';
}