You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/dynamic-plugins/export-derived-package.md
+27-1
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ If you are developing your own plugin that is going to be used as a dynamic plug
43
43
To be compatible with the showcase dynamic plugin support, and used as dynamic plugins, existing plugins must be based on, or compatible with, the new backend system, as well as rebuilt with a dedicated CLI command.
44
44
45
45
The new backend system standard entry point (created using `createBackendPlugin()` or `createBackendModule()`) should be exported as the default export of either the main package or of an `alpha` package (if the new backend support is still provided as `alpha` APIs). This doesn't add any additional requirement on top of the standard plugin development guidelines of the new backend system.
46
-
For a practical example of a dynamic plugin entry point built upon the new backend system, please refer to the [Janus plugins repository](https://github.com/backstage/community-plugins/blob/main/workspaces/3scale/plugins/3scale-backend/src/module.ts).
46
+
For a practical example of a dynamic plugin entry point built upon the new backend system, please refer to the [Backstage community plugins repository](https://github.com/backstage/community-plugins/blob/main/workspaces/3scale/plugins/3scale-backend/src/module.ts).
47
47
48
48
The dynamic export mechanism identifies private, non-backstage dependencies, and sets the `bundleDependencies` field in the `package.json` file for them, so that the dynamic plugin package can be published as a self-contained package, along with its private dependencies bundled in a private `node_modules` folder.
To include components provided by other dynamic plugins inside static JSX as element children with your dynamically imported component, you can extract them from [dynamicConfig](https://github.com/redhat-developer/rhdh/blob/main/packages/app/src/components/DynamicRoot/DynamicRootContext.tsx#L115) that is passed to the `staticJSXContent`:
134
+
135
+
```tsx
136
+
// Used by a static plugin
137
+
exportconst EntityTechdocsContent = () => {...}
138
+
139
+
// Custom function that extracts addon components from dynamic config
140
+
function getTechdocsAddonComponents(dynamicConfig:DynamicConfig) {
Important part of the frontend dynamic plugins is its layout configuration (bindings and routes). For more information on how to configure bindings and routes, see [Frontend Plugin Wiring](frontend-plugin-wiring.md).
Copy file name to clipboardexpand all lines: docs/dynamic-plugins/frontend-plugin-wiring.md
+33
Original file line number
Diff line number
Diff line change
@@ -581,6 +581,39 @@ A plugin can specify multiple field extensions, in which case each field extensi
581
581
- `importName`is an optional import name that should reference the value returned the scaffolder field extension API
582
582
- `module`is an optional argument which allows you to specify which set of assets you want to access within the plugin. If not provided, the default module named `PluginRoot` is used. This is the same as the key in `scalprum.exposedModules` key in plugin's `package.json`.
583
583
584
+
## Provide custom TechDocs addons
585
+
586
+
The Backstage TechDocs component supports specifying [custom addons](https://backstage.io/docs/features/techdocs/addons/) to extend TechDocs functionality, like rendering a component or accessing and manipulating TechDocs's DOM.
These components can be contributed by plugins by exposing the TechDocs addon component via the `techdocsAddons` configuration:
601
+
602
+
```yaml
603
+
dynamicPlugins:
604
+
frontend:
605
+
<package_name>: # same as `scalprum.name` key in plugin's `package.json`
606
+
techdocsAddons:
607
+
- importName: ExampleAddon
608
+
config:
609
+
props: ... # optional, React props to pass to the addon
610
+
```
611
+
612
+
A plugin can specify multiple addons, in which case each techdocsAddon will need to supply an `importName` for each addon.
613
+
614
+
- `importName`name of an exported `Addon` component
615
+
- `module`is an optional argument which allows you to specify which set of assets you want to access within the plugin. If not provided, the default module named `PluginRoot` is used. This is the same as the key in `scalprum.exposedModules` key in plugin's `package.json`.
616
+
584
617
## Add a custom Backstage theme or replace the provided theme
585
618
586
619
The look and feel of a Backstage application is handled by Backstage theming. Out of the box Developer Hub provides a theme with a number of [configuration overrides](../customization.md) that allow for user customization. It's also possible to provide additional Backstage themes as well as replace the out of box Developer Hub themes from a dynamic plugin.
0 commit comments