create-app: removed plugins.ts

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-04-15 19:23:00 +02:00
parent 46b7f84c89
commit ee22773e90
3 changed files with 11 additions and 11 deletions
+11
View File
@@ -0,0 +1,11 @@
---
'@backstage/create-app': patch
---
Removed `plugins.ts` from the app, as plugins are now discovered through the react tree.
To apply this change to an existing app, simply delete `packages/app/src/plugins.ts` along with the import and usage in `packages/app/src/App.tsx`.
Note that there are a few plugins that require explicit registration, in which case you would need to keep them in `plugins.ts`. The set of plugins that need explicit registration is any plugin that doesn't have a component extension that gets rendered as part of the app element tree. An example of such a plugin in the main Backstage repo is `@backstage/plugin-badges`. In the case of the badges plugin this is because there is not yet a component-based API for adding context menu items to the entity layout.
If you have plugins that still rely on route registration through the `register` method of `createPlugin`, these need to be kept in `plugins.ts` as well. However, it is recommended to migrate these to export an extensions component instead.
@@ -21,11 +21,9 @@ import { UserSettingsPage } from '@backstage/plugin-user-settings';
import { apis } from './apis';
import { entityPage } from './components/catalog/EntityPage';
import { Root } from './components/Root';
import * as plugins from './plugins';
const app = createApp({
apis,
plugins: Object.values(plugins),
bindRoutes({ bind }) {
bind(catalogPlugin.externalRoutes, {
createComponent: scaffolderPlugin.routes.root,
@@ -1,9 +0,0 @@
export { plugin as ApiDocs } from '@backstage/plugin-api-docs';
export { plugin as CatalogPlugin } from '@backstage/plugin-catalog';
export { plugin as CatalogImport } from '@backstage/plugin-catalog-import';
export { plugin as GithubActions } from '@backstage/plugin-github-actions';
export { plugin as ScaffolderPlugin } from '@backstage/plugin-scaffolder';
export { plugin as TechDocsPlugin } from '@backstage/plugin-techdocs';
export { plugin as TechRadar } from '@backstage/plugin-tech-radar';
export { plugin as UserSettings } from '@backstage/plugin-user-settings';