diff --git a/.changeset/healthy-dancers-dream.md b/.changeset/healthy-dancers-dream.md new file mode 100644 index 0000000000..6a9869f03a --- /dev/null +++ b/.changeset/healthy-dancers-dream.md @@ -0,0 +1,5 @@ +--- +'@backstage/frontend-app-api': patch +--- + +The options parameter of `createApp` is now optional. diff --git a/packages/frontend-app-api/api-report.md b/packages/frontend-app-api/api-report.md index 11c9ac03c5..3d6d936018 100644 --- a/packages/frontend-app-api/api-report.md +++ b/packages/frontend-app-api/api-report.md @@ -27,7 +27,7 @@ export type AppRouteBinder = < ) => void; // @public (undocumented) -export function createApp(options: { +export function createApp(options?: { features?: (BackstagePlugin | ExtensionOverrides)[]; configLoader?: () => Promise; bindRoutes?(context: { bind: AppRouteBinder }): void; diff --git a/packages/frontend-app-api/src/wiring/createApp.tsx b/packages/frontend-app-api/src/wiring/createApp.tsx index d726773fd3..ef37b695df 100644 --- a/packages/frontend-app-api/src/wiring/createApp.tsx +++ b/packages/frontend-app-api/src/wiring/createApp.tsx @@ -222,7 +222,7 @@ function deduplicateFeatures( } /** @public */ -export function createApp(options: { +export function createApp(options?: { features?: (BackstagePlugin | ExtensionOverrides)[]; configLoader?: () => Promise; bindRoutes?(context: { bind: AppRouteBinder }): void; @@ -240,11 +240,11 @@ export function createApp(options: { ); const discoveredFeatures = getAvailableFeatures(config); - const loadedFeatures = (await options.featureLoader?.({ config })) ?? []; + const loadedFeatures = (await options?.featureLoader?.({ config })) ?? []; const allFeatures = deduplicateFeatures([ ...discoveredFeatures, ...loadedFeatures, - ...(options.features ?? []), + ...(options?.features ?? []), ]); const tree = createAppTree({ @@ -268,7 +268,7 @@ export function createApp(options: {