Merge pull request #4155 from backstage/rugvip/noreg

core-api: remove deprecated registerRoute and deprecate addRoute
This commit is contained in:
Patrik Oldsberg
2021-01-20 12:02:34 +01:00
committed by GitHub
5 changed files with 61 additions and 31 deletions
-3
View File
@@ -68,9 +68,6 @@ export class PluginImpl<
options,
});
},
registerRoute(path, component, options) {
outputs.push({ type: 'legacy-route', path, component, options });
},
},
featureFlags: {
register(name) {
+6 -10
View File
@@ -99,26 +99,22 @@ export type PluginConfig<
};
export type PluginHooks = {
/**
* @deprecated All router hooks have been deprecated
*/
router: RouterHooks;
featureFlags: FeatureFlagsHooks;
};
export type RouterHooks = {
/**
* @deprecated Use a routable extension instead, see https://backstage.io/docs/plugins/composability#porting-existing-plugins
*/
addRoute(
target: RouteRef,
Component: ComponentType<any>,
options?: RouteOptions,
): void;
/**
* @deprecated See the `addRoute` method
* @see https://github.com/backstage/backstage/issues/418
*/
registerRoute(
path: RoutePath,
Component: ComponentType<any>,
options?: RouteOptions,
): void;
};
export type FeatureFlagsHooks = {