From 2f88f88882d173fb4f0a2a856872c13d88014bce Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 18 Sep 2024 15:22:41 +0200 Subject: [PATCH] docs: remove function call from all backend feature installation instructions Signed-off-by: Patrik Oldsberg --- .changeset/shy-olives-swim.md | 11 +++++++++++ docs/backend-system/architecture/02-backends.md | 2 +- docs/backend-system/architecture/04-plugins.md | 2 +- docs/backend-system/building-backends/08-migrating.md | 8 ++++---- docs/features/software-templates/writing-templates.md | 2 +- docs/features/techdocs/how-to-guides.md | 2 +- docs/integrations/github/org.md | 2 +- docs/integrations/gitlab/discovery.md | 4 ++-- docs/integrations/gitlab/org.md | 4 ++-- docs/plugins/new-backend-system.md | 4 ++-- packages/backend-dynamic-feature-service/README.md | 4 ++-- plugins/events-backend-module-github/README.md | 4 ++-- plugins/events-backend-module-gitlab/README.md | 4 ++-- plugins/events-node/README.md | 2 +- plugins/search-backend-module-catalog/README.md | 8 ++++---- plugins/search-backend-module-explore/README.md | 4 ++-- plugins/search-backend-module-techdocs/README.md | 4 ++-- 17 files changed, 41 insertions(+), 30 deletions(-) create mode 100644 .changeset/shy-olives-swim.md diff --git a/.changeset/shy-olives-swim.md b/.changeset/shy-olives-swim.md new file mode 100644 index 0000000000..8a9a07fa81 --- /dev/null +++ b/.changeset/shy-olives-swim.md @@ -0,0 +1,11 @@ +--- +'@backstage/backend-dynamic-feature-service': patch +'@backstage/plugin-search-backend-module-techdocs': patch +'@backstage/plugin-search-backend-module-catalog': patch +'@backstage/plugin-search-backend-module-explore': patch +'@backstage/plugin-events-backend-module-github': patch +'@backstage/plugin-events-backend-module-gitlab': patch +'@backstage/plugin-events-node': patch +--- + +Updated backend installation instructions. diff --git a/docs/backend-system/architecture/02-backends.md b/docs/backend-system/architecture/02-backends.md index 3386cff3f7..4afdeea560 100644 --- a/docs/backend-system/architecture/02-backends.md +++ b/docs/backend-system/architecture/02-backends.md @@ -24,7 +24,7 @@ const backend = createBackend(); backend.add(import('@backstage/plugin-catalog-backend/alpha')); // Features can also be installed using an explicit reference -backend.add(scaffolderPlugin()); +backend.add(scaffolderPlugin); // Start up the backend backend.start(); diff --git a/docs/backend-system/architecture/04-plugins.md b/docs/backend-system/architecture/04-plugins.md index 5aef71e24f..f2a6b856b9 100644 --- a/docs/backend-system/architecture/04-plugins.md +++ b/docs/backend-system/architecture/04-plugins.md @@ -41,7 +41,7 @@ The `createBackendPlugin` return value is exported as `examplePlugin`, which is ```ts import { examplePlugin } from 'backstage-plugin-example-backend'; -backend.add(examplePlugin()); +backend.add(examplePlugin); ``` By convention every plugin package should export its plugin instance as the default export from the package: diff --git a/docs/backend-system/building-backends/08-migrating.md b/docs/backend-system/building-backends/08-migrating.md index fb2923f4c9..188cd4f26f 100644 --- a/docs/backend-system/building-backends/08-migrating.md +++ b/docs/backend-system/building-backends/08-migrating.md @@ -675,7 +675,7 @@ backend.add( import('@backstage/plugin-catalog-backend-module-scaffolder-entity-model'), ); /* highlight-add-next-line */ -backend.add(catalogModuleCustomExtensions()); +backend.add(catalogModuleCustomExtensions); ``` This also requires that you have a dependency on the corresponding node package, @@ -762,9 +762,9 @@ const otherPluginModuleCustomExtensions = createBackendModule({ const backend = createBackend(); backend.add(import('@backstage/plugin-events-backend/alpha')); /* highlight-add-next-line */ -backend.add(eventsModuleCustomExtensions()); +backend.add(eventsModuleCustomExtensions); /* highlight-add-next-line */ -backend.add(otherPluginModuleCustomExtensions()); +backend.add(otherPluginModuleCustomExtensions); ``` Here we've placed the module directly in the backend index file just to get @@ -841,7 +841,7 @@ const scaffolderModuleCustomExtensions = createBackendModule({ const backend = createBackend(); backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); /* highlight-add-next-line */ -backend.add(scaffolderModuleCustomExtensions()); +backend.add(scaffolderModuleCustomExtensions); ``` This also requires that you have a dependency on the corresponding node package, diff --git a/docs/features/software-templates/writing-templates.md b/docs/features/software-templates/writing-templates.md index 05e238ec26..71ca0c56ae 100644 --- a/docs/features/software-templates/writing-templates.md +++ b/docs/features/software-templates/writing-templates.md @@ -891,7 +891,7 @@ const scaffolderModuleCustomFilters = createBackendModule({ const backend = createBackend(); backend.add(import('@backstage/plugin-scaffolder-backend/alpha')); /* highlight-add-next-line */ -backend.add(scaffolderModuleCustomFilters()); +backend.add(scaffolderModuleCustomFilters); ``` If you still use the legacy backend system, then you will use the `createRouter()` function of the `Scaffolder plugin` diff --git a/docs/features/techdocs/how-to-guides.md b/docs/features/techdocs/how-to-guides.md index e47af8d1d7..f2d41aa319 100644 --- a/docs/features/techdocs/how-to-guides.md +++ b/docs/features/techdocs/how-to-guides.md @@ -800,7 +800,7 @@ const techdocsCustomBuildStrategy = createBackendModule({ /* highlight-add-start */ backend.add(import('@backstage/plugin-techdocs-backend/alpha')); -backend.add(techdocsCustomBuildStrategy()); +backend.add(techdocsCustomBuildStrategy); /* highlight-add-end */ backend.start(); diff --git a/docs/integrations/github/org.md b/docs/integrations/github/org.md index 61e42567a9..22b55fee98 100644 --- a/docs/integrations/github/org.md +++ b/docs/integrations/github/org.md @@ -169,7 +169,7 @@ const backend = createBackend(); backend.add(import('@backstage/plugin-catalog-backend/alpha')); -backend.add(githubOrgModule()); +backend.add(githubOrgModule); backend.start(); ``` diff --git a/docs/integrations/gitlab/discovery.md b/docs/integrations/gitlab/discovery.md index 79bd37061a..10746aff88 100644 --- a/docs/integrations/gitlab/discovery.md +++ b/docs/integrations/gitlab/discovery.md @@ -34,9 +34,9 @@ Then add the following to your backend initialization: // optional if you want to use AWS SQS instead of HTTP endpoints to receive external events // backend.add(import('@backstage/plugin-events-backend-module-aws-sqs/alpha')); // optional - event router for gitlab. See.: https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-gitlab/README.md -// backend.add(eventsModuleGitlabEventRouter()); +// backend.add(eventsModuleGitlabEventRouter); // optional - token validator for the gitlab topic -// backend.add(eventsModuleGitlabWebhook()); +// backend.add(eventsModuleGitlabWebhook); backend.add(import('@backstage/plugin-catalog-backend-module-gitlab/alpha')); ``` diff --git a/docs/integrations/gitlab/org.md b/docs/integrations/gitlab/org.md index 5fa2e229eb..c13db4401b 100644 --- a/docs/integrations/gitlab/org.md +++ b/docs/integrations/gitlab/org.md @@ -39,9 +39,9 @@ Then add the following to your backend initialization: // optional if you want to use AWS SQS instead of HTTP endpoints to receive external events // backend.add(import('@backstage/plugin-events-backend-module-aws-sqs/alpha')); // optional - event router for gitlab. See.: https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-gitlab/README.md -// backend.add(eventsModuleGitlabEventRouter()); +// backend.add(eventsModuleGitlabEventRouter); // optional - token validator for the gitlab topic -// backend.add(eventsModuleGitlabWebhook()); +// backend.add(eventsModuleGitlabWebhook); backend.add(import('@backstage/plugin-catalog-backend-module-gitlab-org')); ``` diff --git a/docs/plugins/new-backend-system.md b/docs/plugins/new-backend-system.md index e8a2ca1b19..12525b9f95 100644 --- a/docs/plugins/new-backend-system.md +++ b/docs/plugins/new-backend-system.md @@ -101,7 +101,7 @@ export const examplePlugin = createBackendPlugin({ The plugin can then be installed in the backend using the returned plugin factory function: ```ts -backend.add(examplePlugin()); +backend.add(examplePlugin); ``` If we wanted our plugin to accept options as well, we'd accept the options as the second parameter of the register method: @@ -266,7 +266,7 @@ class GoogleCloudLogger implements LoggerService { const backend = createBackend(); // supplies additional or replacement services to the backend -backend.add(GoogleCloudLogger.factory()); +backend.add(GoogleCloudLogger.factory); ``` ## Testing diff --git a/packages/backend-dynamic-feature-service/README.md b/packages/backend-dynamic-feature-service/README.md index a2f29b3d8f..33033cf884 100644 --- a/packages/backend-dynamic-feature-service/README.md +++ b/packages/backend-dynamic-feature-service/README.md @@ -15,8 +15,8 @@ In the `backend` application, it can be enabled by adding the `backend-dynamic-f ```ts const backend = createBackend(); + -+ backend.add(dynamicPluginsFeatureDiscoveryServiceFactory()) // overridden version of the FeatureDiscoveryService which provides features loaded by dynamic plugins -+ backend.add(dynamicPluginsServiceFactory()) ++ backend.add(dynamicPluginsFeatureDiscoveryServiceFactory) // overridden version of the FeatureDiscoveryService which provides features loaded by dynamic plugins ++ backend.add(dynamicPluginsServiceFactory) + ``` diff --git a/plugins/events-backend-module-github/README.md b/plugins/events-backend-module-github/README.md index fec27b62e3..adc91da4ec 100644 --- a/plugins/events-backend-module-github/README.md +++ b/plugins/events-backend-module-github/README.md @@ -33,7 +33,7 @@ yarn --cwd packages/backend add @backstage/plugin-events-backend-module-github // packages/backend/src/index.ts import { eventsModuleGithubEventRouter } from '@backstage/plugin-events-backend-module-github/alpha'; // ... -backend.add(eventsModuleGithubEventRouter()); +backend.add(eventsModuleGithubEventRouter); ``` #### Legacy Backend System @@ -50,7 +50,7 @@ await eventRouter.subscribe(); // packages/backend/src/index.ts import { eventsModuleGithubWebhook } from '@backstage/plugin-events-backend-module-github/alpha'; // ... -backend.add(eventsModuleGithubWebhook()); +backend.add(eventsModuleGithubWebhook); ``` #### Legacy Backend System diff --git a/plugins/events-backend-module-gitlab/README.md b/plugins/events-backend-module-gitlab/README.md index 73d5bf2d87..eeede370c0 100644 --- a/plugins/events-backend-module-gitlab/README.md +++ b/plugins/events-backend-module-gitlab/README.md @@ -32,7 +32,7 @@ yarn --cwd packages/backend add @backstage/plugin-events-backend-module-gitlab // packages/backend/src/index.ts import { eventsModuleGitlabEventRouter } from '@backstage/plugin-events-backend-module-gitlab/alpha'; // ... -backend.add(eventsModuleGitlabEventRouter()); +backend.add(eventsModuleGitlabEventRouter); ``` #### Legacy Backend System @@ -49,7 +49,7 @@ await eventRouter.subscribe(); // packages/backend/src/index.ts import { eventsModuleGitlabWebhook } from '@backstage/plugin-events-backend-module-gitlab/alpha'; // ... -backend.add(eventsModuleGitlabWebhook()); +backend.add(eventsModuleGitlabWebhook); ``` #### Legacy Backend System diff --git a/plugins/events-node/README.md b/plugins/events-node/README.md index ce4d705025..b07303ff72 100644 --- a/plugins/events-node/README.md +++ b/plugins/events-node/README.md @@ -78,5 +78,5 @@ and your custom implementation: ```diff // packages/backend/src/index.ts -+ backend.add(customEventsServiceFactory()); ++ backend.add(customEventsServiceFactory); ``` diff --git a/plugins/search-backend-module-catalog/README.md b/plugins/search-backend-module-catalog/README.md index 925d8d3b09..607c246390 100644 --- a/plugins/search-backend-module-catalog/README.md +++ b/plugins/search-backend-module-catalog/README.md @@ -20,8 +20,8 @@ import { searchPlugin } from '@backstage/plugin-search-backend/alpha'; import { searchModuleCatalogCollator } from '@backstage/plugin-search-backend-module-catalog/alpha'; const backend = createBackend(); -backend.add(searchPlugin()); -backend.add(searchModuleCatalogCollator()); +backend.add(searchPlugin); +backend.add(searchModuleCatalogCollator); backend.start(); ``` @@ -54,8 +54,8 @@ const customTransformer: CatalogCollatorEntityTransformer = entity => ({ }); const backend = createBackend(); -backend.add(searchPlugin()); -backend.add(searchModuleCatalogCollator()); +backend.add(searchPlugin); +backend.add(searchModuleCatalogCollator); backend.add( createBackendModule({ pluginId: 'search', diff --git a/plugins/search-backend-module-explore/README.md b/plugins/search-backend-module-explore/README.md index b2d6ff8758..d91ee92163 100644 --- a/plugins/search-backend-module-explore/README.md +++ b/plugins/search-backend-module-explore/README.md @@ -20,8 +20,8 @@ import { searchPlugin } from '@backstage/plugin-search-backend/alpha'; import { searchModuleExploreCollator } from '@backstage/plugin-search-backend-module-explore/alpha'; const backend = createBackend(); -backend.add(searchPlugin()); -backend.add(searchModuleExploreCollator()); +backend.add(searchPlugin); +backend.add(searchModuleExploreCollator); backend.start(); ``` diff --git a/plugins/search-backend-module-techdocs/README.md b/plugins/search-backend-module-techdocs/README.md index 68bb4b956e..63094cca7d 100644 --- a/plugins/search-backend-module-techdocs/README.md +++ b/plugins/search-backend-module-techdocs/README.md @@ -20,8 +20,8 @@ import { searchPlugin } from '@backstage/plugin-search-backend/alpha'; import { searchModuleTechDocsCollator } from '@backstage/plugin-search-backend-module-techdocs/alpha'; const backend = createBackend(); -backend.add(searchPlugin()); -backend.add(searchModuleTechDocsCollator()); +backend.add(searchPlugin); +backend.add(searchModuleTechDocsCollator); backend.start(); ```