Skip to content

Commit

Permalink
try to optimize bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwizp committed Sep 3, 2021
1 parent fdd5e4c commit cb3dac9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
import React, { Suspense, useEffect, useState } from 'react';

import { EuiLoadingSpinner, EuiOverlayMask } from '@elastic/eui';
import { CoreStart } from 'kibana/public';
import type { CoreStart } from 'kibana/public';
import type { SaveModalContainerProps } from '../save_modal_container';
import type { LensPluginStartDependencies } from '../../plugin';
import type { LensAppServices } from '../types';

const SaveModal = React.lazy(() => import('../save_modal_container'));

function LoadingSpinnerWithOverlay() {
Expand Down
9 changes: 6 additions & 3 deletions x-pack/plugins/lens/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ import type {
PieVisualizationPluginSetupPlugins,
} from './pie_visualization';
import type { HeatmapVisualization as HeatmapVisualizationType } from './heatmap_visualization';
import { AppNavLinkStatus } from '../../../../src/core/public';
import type { SavedObjectTaggingPluginStart } from '../../saved_objects_tagging/public';

import { AppNavLinkStatus } from '../../../../src/core/public';

import {
UiActionsStart,
ACTION_VISUALIZE_FIELD,
Expand All @@ -80,7 +81,6 @@ import { getSaveModalComponent } from './app_plugin/shared/saved_modal_lazy';
import type { SaveModalContainerProps } from './app_plugin/save_modal_container';

import { createStartServicesGetter } from '../../../../src/plugins/kibana_utils/public';
import { getTimeZone } from './utils';
import { setupExpressions } from './expressions';
import { getSearchProvider } from './search_provider';

Expand Down Expand Up @@ -222,7 +222,10 @@ export class LensPlugin {
setupExpressions(
expressions,
() => startServices().plugins.fieldFormats.deserialize,
() => getTimeZone(core.uiSettings)
async () => {
const { getTimeZone } = await import('./utils');
return getTimeZone(core.uiSettings);
}
);

const getPresentationUtilContext = () =>
Expand Down
5 changes: 3 additions & 2 deletions x-pack/plugins/lens/public/search_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
* 2.0.
*/

import { ApplicationStart } from 'kibana/public';
import type { ApplicationStart } from 'kibana/public';
import { from, of } from 'rxjs';
import { i18n } from '@kbn/i18n';
import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public';
import { GlobalSearchResultProvider } from '../../global_search/public';
import { getFullPath } from '../common/constants';

import type { GlobalSearchResultProvider } from '../../global_search/public';

/**
* Global search provider adding a Lens entry.
* This is necessary because Lens does not show up in the nav bar and is filtered out by the
Expand Down

0 comments on commit cb3dac9

Please sign in to comment.