[customIntegrations] async load all components (#145166)

This commit is contained in:
Spencer 2022-11-14 13:50:39 -07:00 committed by GitHub
parent fdfeda4192
commit 565ccacf6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 8 deletions

View file

@ -20,7 +20,7 @@ pageLoadAssetSize:
controls: 40000
core: 435325
crossClusterReplication: 65408
customIntegrations: 44305
customIntegrations: 22034
dashboard: 82025
dashboardEnhanced: 65646
data: 454087

View file

@ -0,0 +1,11 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
export { SampleClientReadme } from './components/fleet_integration/sample/sample_client_readme';
export { ElasticsearchJsClientReadme } from './components/fleet_integration/elasticsearch_js/elasticsearch_js_readme';
export { ElasticsearchPyClientReadme } from './components/fleet_integration/elasticsearch_py/elasticsearch_py_readme';

View file

@ -22,10 +22,6 @@ import {
import { CustomIntegrationsServicesProvider } from './services';
import { servicesFactory } from './services/kibana';
import { SampleClientReadme } from './components/fleet_integration/sample/sample_client_readme';
import { ElasticsearchJsClientReadme } from './components/fleet_integration/elasticsearch_js/elasticsearch_js_readme';
import { ElasticsearchPyClientReadme } from './components/fleet_integration/elasticsearch_py/elasticsearch_py_readme';
export class CustomIntegrationsPlugin
implements Plugin<CustomIntegrationsSetup, CustomIntegrationsStart>
{
@ -49,9 +45,15 @@ export class CustomIntegrationsPlugin
const services = servicesFactory({ coreStart, startPlugins });
const languageClientsUiComponents = {
sample: SampleClientReadme,
javascript: ElasticsearchJsClientReadme,
python: ElasticsearchPyClientReadme,
sample: React.lazy(async () => ({
default: (await import('./language_components')).SampleClientReadme,
})),
javascript: React.lazy(async () => ({
default: (await import('./language_components')).ElasticsearchJsClientReadme,
})),
python: React.lazy(async () => ({
default: (await import('./language_components')).ElasticsearchPyClientReadme,
})),
};
const ContextProvider: React.FC = ({ children }) => (