frontend-plugin-api: AppRootElementBlueprint now only accepts an element

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2025-07-31 16:19:49 +02:00
parent 484e500f49
commit 121899a641
9 changed files with 25 additions and 11 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-app': minor
---
**BREAKING**: The `app-root-element` extension now only accepts `JSX.Element` in its `element` param, meaning overrides need to be updated.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/frontend-plugin-api': minor
---
**BREAKING**: The `element` param for `AppRootElementBlueprint` no longer accepts a component. If you are currently passing a component such as `element: () => <MyComponent />` or `element: MyComponent`, simply switch to `element: <MyComponent />`.
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-signals': patch
'@backstage/plugin-home': patch
---
**BREAKING ALPHA**: The `app-root-element` extension now only accepts `JSX.Element` in its `element` param, meaning overrides need to be updated.
+1 -1
View File
@@ -254,7 +254,7 @@ export const AppRootElementBlueprint: ExtensionBlueprint<{
kind: 'app-root-element';
name: undefined;
params: {
element: JSX.Element | (() => JSX.Element);
element: JSX.Element;
};
output: ConfigurableExtensionDataRef<JSX_3.Element, 'core.reactElement', {}>;
inputs: {};
@@ -26,9 +26,7 @@ export const AppRootElementBlueprint = createExtensionBlueprint({
kind: 'app-root-element',
attachTo: { id: 'app/root', input: 'elements' },
output: [coreExtensionData.reactElement],
*factory(params: { element: JSX.Element | (() => JSX.Element) }) {
yield coreExtensionData.reactElement(
typeof params.element === 'function' ? params.element() : params.element,
);
*factory(params: { element: JSX.Element }) {
yield coreExtensionData.reactElement(params.element);
},
});
+3 -3
View File
@@ -816,7 +816,7 @@ const appPlugin: FrontendPlugin<
kind: 'app-root-element';
name: 'alert-display';
params: {
element: JSX.Element | (() => JSX.Element);
element: JSX.Element;
};
}>;
'app-root-element:app/dialog-display': ExtensionDefinition<{
@@ -839,7 +839,7 @@ const appPlugin: FrontendPlugin<
kind: 'app-root-element';
name: 'dialog-display';
params: {
element: JSX.Element | (() => JSX.Element);
element: JSX.Element;
};
}>;
'app-root-element:app/oauth-request-dialog': ExtensionDefinition<{
@@ -854,7 +854,7 @@ const appPlugin: FrontendPlugin<
>;
inputs: {};
params: {
element: JSX.Element | (() => JSX.Element);
element: JSX.Element;
};
}>;
'sign-in-page:app': ExtensionDefinition<{
+1 -1
View File
@@ -41,7 +41,7 @@ export const alertDisplayAppRootElement =
},
factory: (originalFactory, { config }) => {
return originalFactory({
element: () => <AlertDisplay {...config} />,
element: <AlertDisplay {...config} />,
});
},
});
+1 -1
View File
@@ -53,7 +53,7 @@ const _default: FrontendPlugin<
>;
inputs: {};
params: {
element: JSX.Element | (() => JSX.Element);
element: JSX.Element;
};
}>;
'page:home': ExtensionDefinition<{
+1 -1
View File
@@ -47,7 +47,7 @@ const _default: FrontendPlugin<
>;
inputs: {};
params: {
element: JSX.Element | (() => JSX.Element);
element: JSX.Element;
};
}>;
}