refactor: lazy load core components
Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
@@ -32,21 +32,21 @@ import { AppContextProvider } from '../../../core-app-api/src/app/AppContext';
|
||||
import { useApp } from '../../../core-plugin-api/src/app/useApp';
|
||||
|
||||
export const DefaultProgressComponent = createProgressExtension({
|
||||
component: defaultComponents.Progress,
|
||||
component: async () => defaultComponents.Progress,
|
||||
});
|
||||
|
||||
export const DefaultBootErrorPageComponent = createBootErrorPageExtension({
|
||||
component: defaultComponents.BootErrorPage,
|
||||
component: async () => defaultComponents.BootErrorPage,
|
||||
});
|
||||
|
||||
export const DefaultNotFoundErrorPageComponent =
|
||||
createNotFoundErrorPageExtension({
|
||||
component: defaultComponents.NotFoundErrorPage,
|
||||
component: async () => defaultComponents.NotFoundErrorPage,
|
||||
});
|
||||
|
||||
export const DefaultErrorBoundaryComponent =
|
||||
createErrorBoundaryFallbackExtension({
|
||||
component: defaultComponents.ErrorBoundaryFallback,
|
||||
component: async () => defaultComponents.ErrorBoundaryFallback,
|
||||
});
|
||||
|
||||
export const CoreComponents = createExtension({
|
||||
|
||||
@@ -390,6 +390,7 @@ function createLegacyAppContext(plugins: BackstagePlugin[]): AppContext {
|
||||
getComponents(): AppComponents {
|
||||
return {
|
||||
...defaultComponents,
|
||||
// The default nullable components are overridden by the CoreComponents built-in extension
|
||||
Progress: () => null,
|
||||
BootErrorPage: () => null,
|
||||
NotFoundErrorPage: () => null,
|
||||
|
||||
Reference in New Issue
Block a user