mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Logs Shared] Reduce load bundle size (#184925)
## 📓 Summary
I found a couple of heavy components which could be dynamically exported
and reduce the load bundle for the plugin by ~50kb.
Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
This commit is contained in:
parent
e5ea1d43ce
commit
bdb722ff20
3 changed files with 10 additions and 3 deletions
|
@ -209,6 +209,9 @@ export const LogEntryFlyout = ({
|
|||
);
|
||||
};
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default LogEntryFlyout;
|
||||
|
||||
const loadingProgressMessage = i18n.translate('xpack.logsShared.logFlyout.loadingMessage', {
|
||||
defaultMessage: 'Searching log entry in shards',
|
||||
});
|
||||
|
|
|
@ -38,3 +38,6 @@ export const WithSummary = ({ serializedParsedQuery, children }: WithSummaryProp
|
|||
|
||||
return children({ buckets, start, end });
|
||||
};
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default WithSummary;
|
||||
|
|
|
@ -33,8 +33,6 @@ export {
|
|||
useLogHighlightsStateContext,
|
||||
} from './containers/logs/log_highlights';
|
||||
export type { LogSummaryBuckets, WithSummaryProps } from './containers/logs/log_summary';
|
||||
export { useLogSummary, WithSummary } from './containers/logs/log_summary';
|
||||
export { useLogEntryFlyout } from './components/logging/log_entry_flyout';
|
||||
|
||||
// Shared components
|
||||
export type { LogAIAssistantDocument } from './components/log_ai_assistant/log_ai_assistant';
|
||||
|
@ -46,10 +44,13 @@ export {
|
|||
iconColumnId,
|
||||
useColumnWidths,
|
||||
} from './components/logging/log_text_stream/log_entry_column';
|
||||
export { LogEntryFlyout } from './components/logging/log_entry_flyout';
|
||||
export type { LogAIAssistantProps } from './components/log_ai_assistant/log_ai_assistant';
|
||||
export type { LogStreamProps } from './components/log_stream/log_stream';
|
||||
|
||||
export const WithSummary = dynamic(() => import('./containers/logs/log_summary/with_summary'));
|
||||
export const LogEntryFlyout = dynamic(
|
||||
() => import('./components/logging/log_entry_flyout/log_entry_flyout')
|
||||
);
|
||||
export const LogAIAssistant = dynamic(
|
||||
() => import('./components/log_ai_assistant/log_ai_assistant')
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue