diff --git a/packages/frontend-defaults/src/createApp.test.tsx b/packages/frontend-defaults/src/createApp.test.tsx index 4f627f1839..1d96c22ad0 100644 --- a/packages/frontend-defaults/src/createApp.test.tsx +++ b/packages/frontend-defaults/src/createApp.test.tsx @@ -282,6 +282,38 @@ describe('createApp', () => { ).resolves.toBeInTheDocument(); }); + it('should allow unknown extension config if the flag is set', async () => { + const app = createApp({ + configLoader: async () => ({ + config: mockApis.config({ + data: { + app: { + extensions: [{ 'unknown:lols/wut': false }], + }, + }, + }), + }), + features: [ + appPlugin, + createFrontendPlugin({ + pluginId: 'test', + extensions: [ + PageBlueprint.make({ + params: { + defaultPath: '/', + loader: async () =>
Derp
, + }, + }), + ], + }), + ], + flags: { allowUnknownExtensionConfig: true }, + }); + + await renderWithEffects(app.createRoot()); + + await expect(screen.findByText('Derp')).resolves.toBeInTheDocument(); + }); it('should make the app structure available through the AppTreeApi', async () => { let appTreeApi: AppTreeApi | undefined = undefined; diff --git a/packages/frontend-defaults/src/createApp.tsx b/packages/frontend-defaults/src/createApp.tsx index e8baa3a764..ab0ddf85a7 100644 --- a/packages/frontend-defaults/src/createApp.tsx +++ b/packages/frontend-defaults/src/createApp.tsx @@ -80,6 +80,7 @@ export interface CreateAppOptions { | ExtensionFactoryMiddleware | ExtensionFactoryMiddleware[]; pluginInfoResolver?: FrontendPluginInfoResolver; + flags?: { allowUnknownExtensionConfig?: boolean }; } /** @@ -115,6 +116,7 @@ export function createApp(options?: CreateAppOptions): { bindRoutes: options?.bindRoutes, extensionFactoryMiddleware: options?.extensionFactoryMiddleware, pluginInfoResolver: options?.pluginInfoResolver, + flags: options?.flags, }); const rootEl = app.tree.root.instance!.getData(