diff --git a/.changeset/quiet-badgers-cheer.md b/.changeset/quiet-badgers-cheer.md new file mode 100644 index 0000000000..e22bf9492c --- /dev/null +++ b/.changeset/quiet-badgers-cheer.md @@ -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. diff --git a/packages/create-app/templates/default-app/packages/app/src/App.tsx b/packages/create-app/templates/default-app/packages/app/src/App.tsx index 1ed7aa030a..026771ce4f 100644 --- a/packages/create-app/templates/default-app/packages/app/src/App.tsx +++ b/packages/create-app/templates/default-app/packages/app/src/App.tsx @@ -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, diff --git a/packages/create-app/templates/default-app/packages/app/src/plugins.ts b/packages/create-app/templates/default-app/packages/app/src/plugins.ts deleted file mode 100644 index df53885723..0000000000 --- a/packages/create-app/templates/default-app/packages/app/src/plugins.ts +++ /dev/null @@ -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'; -