Skip to content

Commit

Permalink
Make the public export lazy
Browse files Browse the repository at this point in the history
  • Loading branch information
afgomez authored and Alejandro Fernández Gómez committed Sep 4, 2020
1 parent 87438f3 commit 9ce68b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions x-pack/plugins/infra/public/components/log_stream/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,7 @@ const LogStreamContent = euiStyled.div<{ height: string }>`
background-color: ${(props) => props.theme.eui.euiColorEmptyShade};
height: ${(props) => props.height};
`;

// Allow for lazy loading
// eslint-disable-next-line import/no-default-export
export default LogStream;
4 changes: 2 additions & 2 deletions x-pack/plugins/infra/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import { lazy } from 'react';
import { PluginInitializer, PluginInitializerContext } from 'kibana/public';
import { Plugin } from './plugin';
import {
Expand All @@ -28,4 +28,4 @@ export { InfraFormatterType } from './lib/lib';
export type InfraAppId = 'logs' | 'metrics';

// Shared components
export { LogStream } from './components/log_stream';
export const LogStream = lazy(() => import('./components/log_stream'));

0 comments on commit 9ce68b9

Please sign in to comment.