diff --git a/x-pack/plugins/lists/public/exceptions/components/builder/index.tsx b/x-pack/plugins/lists/public/exceptions/components/builder/index.tsx index 2fe756c56c38e..551889e4a821d 100644 --- a/x-pack/plugins/lists/public/exceptions/components/builder/index.tsx +++ b/x-pack/plugins/lists/public/exceptions/components/builder/index.tsx @@ -8,6 +8,7 @@ import { EuiLoadingSpinner } from '@elastic/eui'; import React, { Suspense, lazy } from 'react'; +// Note: Only use import type/export type here to avoid pulling anything non-lazy into the main plugin and increasing the plugin size import type { ExceptionBuilderProps } from './exception_items_renderer'; export type { OnChangeProps } from './exception_items_renderer'; @@ -16,6 +17,11 @@ interface ExtraProps { idAria: string; } +/** + * This lazy load allows the exception builder to pull everything out into a plugin chunk. + * You want to be careful of not directly importing/exporting things from exception_items_renderer + * unless you use a import type, and/or a export type to ensure full type erasure + */ const ExceptionBuilderComponentLazy = lazy(() => import('./exception_items_renderer')); export const getExceptionBuilderComponentLazy = ( props: ExceptionBuilderProps & ExtraProps