55 */
66
77import { i18n } from '@kbn/i18n' ;
8+ import { lazy } from 'react' ;
9+ import { ConfigSchema } from '.' ;
810import {
911 AppMountParameters ,
1012 CoreSetup ,
1113 CoreStart ,
14+ DEFAULT_APP_CATEGORIES ,
1215 Plugin ,
1316 PluginInitializerContext ,
1417} from '../../../../src/core/public' ;
15- import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public' ;
16-
17- import {
18- PluginSetupContract as AlertingPluginPublicSetup ,
19- PluginStartContract as AlertingPluginPublicStart ,
20- } from '../../alerts/public' ;
21- import { FeaturesPluginSetup } from '../../features/public' ;
2218import {
2319 DataPublicPluginSetup ,
2420 DataPublicPluginStart ,
2521} from '../../../../src/plugins/data/public' ;
2622import { HomePublicPluginSetup } from '../../../../src/plugins/home/public' ;
23+ import {
24+ PluginSetupContract as AlertingPluginPublicSetup ,
25+ PluginStartContract as AlertingPluginPublicStart ,
26+ } from '../../alerts/public' ;
27+ import { FeaturesPluginSetup } from '../../features/public' ;
2728import { LicensingPluginSetup } from '../../licensing/public' ;
2829import {
2930 TriggersAndActionsUIPublicPluginSetup ,
3031 TriggersAndActionsUIPublicPluginStart ,
3132} from '../../triggers_actions_ui/public' ;
32- import { ConfigSchema } from '.' ;
33- import { createCallApmApi } from './services/rest/createCallApmApi' ;
34- import { featureCatalogueEntry } from './featureCatalogueEntry' ;
3533import { AlertType } from '../common/alert_types' ;
36- import { ErrorRateAlertTrigger } from './components/shared/ErrorRateAlertTrigger' ;
37- import { TransactionDurationAlertTrigger } from './components/shared/TransactionDurationAlertTrigger' ;
34+ import { featureCatalogueEntry } from './featureCatalogueEntry' ;
35+ import { createCallApmApi } from './services/rest/createCallApmApi' ;
36+ import { createStaticIndexPattern } from './services/rest/index_pattern' ;
3837import { setHelpExtension } from './setHelpExtension' ;
3938import { toggleAppLinkInNav } from './toggleAppLinkInNav' ;
4039import { setReadonlyBadge } from './updateBadge' ;
41- import { createStaticIndexPattern } from './services/rest/index_pattern' ;
4240
4341export type ApmPluginSetup = void ;
4442export type ApmPluginStart = void ;
@@ -112,7 +110,9 @@ export class ApmPlugin implements Plugin<ApmPluginSetup, ApmPluginStart> {
112110 defaultMessage : 'Error rate' ,
113111 } ) ,
114112 iconClass : 'bell' ,
115- alertParamsExpression : ErrorRateAlertTrigger ,
113+ alertParamsExpression : lazy ( ( ) =>
114+ import ( './components/shared/ErrorRateAlertTrigger' )
115+ ) ,
116116 validate : ( ) => ( {
117117 errors : [ ] ,
118118 } ) ,
@@ -125,7 +125,9 @@ export class ApmPlugin implements Plugin<ApmPluginSetup, ApmPluginStart> {
125125 defaultMessage : 'Transaction duration' ,
126126 } ) ,
127127 iconClass : 'bell' ,
128- alertParamsExpression : TransactionDurationAlertTrigger ,
128+ alertParamsExpression : lazy ( ( ) =>
129+ import ( './components/shared/TransactionDurationAlertTrigger' )
130+ ) ,
129131 validate : ( ) => ( {
130132 errors : [ ] ,
131133 } ) ,
0 commit comments