mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Maps] Make bundle smaller (#95881)
This commit is contained in:
parent
524ce98805
commit
d2e2209cf2
15 changed files with 60 additions and 52 deletions
|
@ -49,7 +49,7 @@ pageLoadAssetSize:
|
|||
lists: 202261
|
||||
logstash: 53548
|
||||
management: 46112
|
||||
maps: 183610
|
||||
maps: 80000
|
||||
mapsLegacy: 87859
|
||||
mapsLegacyLicensing: 20214
|
||||
ml: 82187
|
||||
|
|
|
@ -24,7 +24,7 @@ import {
|
|||
import { useLayerList } from './useLayerList';
|
||||
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
|
||||
import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context';
|
||||
import { RenderTooltipContentParams } from '../../../../../../maps/public';
|
||||
import type { RenderTooltipContentParams } from '../../../../../../maps/public';
|
||||
import { MapToolTip } from './MapToolTip';
|
||||
import { useMapFilters } from './useMapFilters';
|
||||
import { EmbeddableStart } from '../../../../../../../../src/plugins/embeddable/public';
|
||||
|
|
|
@ -20,7 +20,7 @@ import {
|
|||
TRANSACTION_DURATION_COUNTRY,
|
||||
TRANSACTION_DURATION_REGION,
|
||||
} from './useLayerList';
|
||||
import { RenderTooltipContentParams } from '../../../../../../maps/public';
|
||||
import type { RenderTooltipContentParams } from '../../../../../../maps/public';
|
||||
import { I18LABELS } from '../translations';
|
||||
|
||||
type MapToolTipProps = Partial<RenderTooltipContentParams>;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import _ from 'lodash';
|
||||
import { Filter } from '../../../../../../src/plugins/data/public';
|
||||
import { TooltipFeature } from '../../../../../plugins/maps/common/descriptor_types';
|
||||
import type { TooltipFeature } from '../../../../../plugins/maps/common/descriptor_types';
|
||||
|
||||
export interface ITooltipProperty {
|
||||
getPropertyKey(): string;
|
||||
|
|
|
@ -11,7 +11,6 @@ import {
|
|||
EmbeddableFactoryDefinition,
|
||||
IContainer,
|
||||
} from '../../../../../src/plugins/embeddable/public';
|
||||
import '../index.scss';
|
||||
import { MAP_SAVED_OBJECT_TYPE, APP_ICON } from '../../common/constants';
|
||||
import { getMapEmbeddableDisplayName } from '../../common/i18n_getters';
|
||||
import { MapByReferenceInput, MapEmbeddableInput, MapByValueInput } from './types';
|
||||
|
|
|
@ -19,6 +19,8 @@ export const plugin: PluginInitializer<MapsPluginSetup, MapsPluginStart> = (
|
|||
|
||||
export { MAP_SAVED_OBJECT_TYPE } from '../common/constants';
|
||||
|
||||
export { RenderTooltipContentParams } from './classes/tooltips/tooltip_property';
|
||||
export type { RenderTooltipContentParams } from './classes/tooltips/tooltip_property';
|
||||
|
||||
export { MapsStartApi } from './api';
|
||||
|
||||
export type { MapEmbeddable, MapEmbeddableInput } from './embeddable';
|
||||
|
|
|
@ -5,13 +5,12 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import _ from 'lodash';
|
||||
import { CoreStart } from 'kibana/public';
|
||||
import type { CoreStart } from 'kibana/public';
|
||||
import type { MapsEmsConfig } from '../../../../src/plugins/maps_ems/public';
|
||||
import { MapsConfigType } from '../config';
|
||||
import { MapsPluginStartDependencies } from './plugin';
|
||||
import { EMSSettings } from '../common/ems_settings';
|
||||
import { PaletteRegistry } from '../../../../src/plugins/charts/public';
|
||||
import type { MapsConfigType } from '../config';
|
||||
import type { MapsPluginStartDependencies } from './plugin';
|
||||
import type { EMSSettings } from '../common/ems_settings';
|
||||
import type { PaletteRegistry } from '../../../../src/plugins/charts/public';
|
||||
|
||||
let kibanaVersion: string;
|
||||
export const setKibanaVersion = (version: string) => (kibanaVersion = version);
|
||||
|
@ -75,8 +74,22 @@ export const getEMSSettings = () => {
|
|||
|
||||
export const getEmsTileLayerId = () => getKibanaCommonConfig().emsTileLayerId;
|
||||
|
||||
export const getRegionmapLayers = () => _.get(getKibanaCommonConfig(), 'regionmap.layers', []);
|
||||
export const getTilemap = () => _.get(getKibanaCommonConfig(), 'tilemap', []);
|
||||
export const getRegionmapLayers = () => {
|
||||
const config = getKibanaCommonConfig();
|
||||
if (config.regionmap && config.regionmap.layers) {
|
||||
return config.regionmap.layers;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
};
|
||||
export const getTilemap = () => {
|
||||
const config = getKibanaCommonConfig();
|
||||
if (config.tilemap) {
|
||||
return config.tilemap;
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
export const getShareService = () => pluginsStart.share;
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import '../../index.scss';
|
||||
export * from '../../embeddable/map_embeddable';
|
||||
export * from '../../kibana_services';
|
||||
export { renderApp } from '../../render_app';
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import {
|
||||
import type {
|
||||
VisualizationsSetup,
|
||||
VisualizationStage,
|
||||
} from '../../../../src/plugins/visualizations/public';
|
||||
import { SavedObject } from '../../../../src/core/types/saved_objects';
|
||||
import { MapSavedObject } from '../common/map_saved_object_type';
|
||||
import type { SavedObject } from '../../../../src/core/types/saved_objects';
|
||||
import type { MapSavedObject } from '../common/map_saved_object_type';
|
||||
import {
|
||||
APP_ID,
|
||||
APP_ICON,
|
||||
|
|
|
@ -5,19 +5,19 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { Setup as InspectorSetupContract } from 'src/plugins/inspector/public';
|
||||
import { UiActionsStart } from 'src/plugins/ui_actions/public';
|
||||
import { NavigationPublicPluginStart } from 'src/plugins/navigation/public';
|
||||
import { Start as InspectorStartContract } from 'src/plugins/inspector/public';
|
||||
import { DashboardStart } from 'src/plugins/dashboard/public';
|
||||
import {
|
||||
import type { Setup as InspectorSetupContract } from 'src/plugins/inspector/public';
|
||||
import type { UiActionsStart } from 'src/plugins/ui_actions/public';
|
||||
import type { NavigationPublicPluginStart } from 'src/plugins/navigation/public';
|
||||
import type { Start as InspectorStartContract } from 'src/plugins/inspector/public';
|
||||
import type { DashboardStart } from 'src/plugins/dashboard/public';
|
||||
import type {
|
||||
AppMountParameters,
|
||||
CoreSetup,
|
||||
CoreStart,
|
||||
Plugin,
|
||||
PluginInitializerContext,
|
||||
DEFAULT_APP_CATEGORIES,
|
||||
} from '../../../../src/core/public';
|
||||
import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/public';
|
||||
// @ts-ignore
|
||||
import { MapView } from './inspector/views/map_view';
|
||||
import {
|
||||
|
@ -29,8 +29,8 @@ import {
|
|||
} from './kibana_services';
|
||||
import { featureCatalogueEntry } from './feature_catalogue_entry';
|
||||
import { getMapsVisTypeAlias } from './maps_vis_type_alias';
|
||||
import { HomePublicPluginSetup } from '../../../../src/plugins/home/public';
|
||||
import {
|
||||
import type { HomePublicPluginSetup } from '../../../../src/plugins/home/public';
|
||||
import type {
|
||||
VisualizationsSetup,
|
||||
VisualizationsStart,
|
||||
} from '../../../../src/plugins/visualizations/public';
|
||||
|
@ -43,28 +43,27 @@ import {
|
|||
} from './url_generator';
|
||||
import { visualizeGeoFieldAction } from './trigger_actions/visualize_geo_field_action';
|
||||
import { MapEmbeddableFactory } from './embeddable/map_embeddable_factory';
|
||||
import { EmbeddableSetup } from '../../../../src/plugins/embeddable/public';
|
||||
import type { EmbeddableSetup, EmbeddableStart } from '../../../../src/plugins/embeddable/public';
|
||||
import { MapsXPackConfig, MapsConfigType } from '../config';
|
||||
import { getAppTitle } from '../common/i18n_getters';
|
||||
import { lazyLoadMapModules } from './lazy_load_bundle';
|
||||
import { MapsStartApi } from './api';
|
||||
import { createLayerDescriptors, registerLayerWizard, registerSource } from './api';
|
||||
import { SharePluginSetup, SharePluginStart } from '../../../../src/plugins/share/public';
|
||||
import { EmbeddableStart } from '../../../../src/plugins/embeddable/public';
|
||||
import type { SharePluginSetup, SharePluginStart } from '../../../../src/plugins/share/public';
|
||||
import type { MapsEmsPluginSetup } from '../../../../src/plugins/maps_ems/public';
|
||||
import { DataPublicPluginStart } from '../../../../src/plugins/data/public';
|
||||
import { LicensingPluginSetup, LicensingPluginStart } from '../../licensing/public';
|
||||
import { FileUploadPluginStart } from '../../file_upload/public';
|
||||
import { SavedObjectsStart } from '../../../../src/plugins/saved_objects/public';
|
||||
import { PresentationUtilPluginStart } from '../../../../src/plugins/presentation_util/public';
|
||||
import type { DataPublicPluginStart } from '../../../../src/plugins/data/public';
|
||||
import type { LicensingPluginSetup, LicensingPluginStart } from '../../licensing/public';
|
||||
import type { FileUploadPluginStart } from '../../file_upload/public';
|
||||
import type { SavedObjectsStart } from '../../../../src/plugins/saved_objects/public';
|
||||
import type { PresentationUtilPluginStart } from '../../../../src/plugins/presentation_util/public';
|
||||
import {
|
||||
getIsEnterprisePlus,
|
||||
registerLicensedFeatures,
|
||||
setLicensingPluginStart,
|
||||
} from './licensed_features';
|
||||
import { EMSSettings } from '../common/ems_settings';
|
||||
import { SavedObjectTaggingPluginStart } from '../../saved_objects_tagging/public';
|
||||
import { ChartsPluginStart } from '../../../../src/plugins/charts/public';
|
||||
import type { SavedObjectTaggingPluginStart } from '../../saved_objects_tagging/public';
|
||||
import type { ChartsPluginStart } from '../../../../src/plugins/charts/public';
|
||||
|
||||
export interface MapsPluginSetupDependencies {
|
||||
inspector: InspectorSetupContract;
|
||||
|
|
|
@ -6,17 +6,17 @@
|
|||
*/
|
||||
|
||||
import rison from 'rison-node';
|
||||
import {
|
||||
import type {
|
||||
TimeRange,
|
||||
Filter,
|
||||
Query,
|
||||
esFilters,
|
||||
QueryState,
|
||||
RefreshInterval,
|
||||
} from '../../../../src/plugins/data/public';
|
||||
import { esFilters } from '../../../../src/plugins/data/public';
|
||||
import { setStateToKbnUrl } from '../../../../src/plugins/kibana_utils/public';
|
||||
import { UrlGeneratorsDefinition } from '../../../../src/plugins/share/public';
|
||||
import { LayerDescriptor } from '../common/descriptor_types';
|
||||
import type { UrlGeneratorsDefinition } from '../../../../src/plugins/share/public';
|
||||
import type { LayerDescriptor } from '../common/descriptor_types';
|
||||
import { INITIAL_LAYERS_KEY } from '../common/constants';
|
||||
import { lazyLoadMapModules } from './lazy_load_bundle';
|
||||
|
||||
|
|
|
@ -12,15 +12,11 @@ import minimatch from 'minimatch';
|
|||
import { IndexPatternMapping } from './types';
|
||||
import { getLayerList } from './map_config';
|
||||
import { MAP_SAVED_OBJECT_TYPE } from '../../../../../maps/public';
|
||||
import {
|
||||
import type {
|
||||
RenderTooltipContentParams,
|
||||
MapEmbeddable,
|
||||
MapEmbeddableInput,
|
||||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
|
||||
} from '../../../../../../plugins/maps/public/embeddable';
|
||||
import {
|
||||
RenderTooltipContentParams,
|
||||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
|
||||
} from '../../../../../../plugins/maps/public/classes/tooltips/tooltip_property';
|
||||
} from '../../../../../../plugins/maps/public';
|
||||
import * as i18n from './translations';
|
||||
import { Query, Filter } from '../../../../../../../src/plugins/data/public';
|
||||
import {
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
|
||||
import { RenderTooltipContentParams } from '../../../../../maps/public/classes/tooltips/tooltip_property';
|
||||
import type { RenderTooltipContentParams } from '../../../../../maps/public';
|
||||
|
||||
export interface IndexPatternMapping {
|
||||
title: string;
|
||||
|
|
|
@ -26,7 +26,7 @@ import {
|
|||
import { MAP_SAVED_OBJECT_TYPE } from '../../../../../../../maps/public';
|
||||
import { MapToolTipComponent } from './map_tool_tip';
|
||||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
|
||||
import { RenderTooltipContentParams } from '../../../../../../../maps/public/classes/tooltips/tooltip_property';
|
||||
import type { RenderTooltipContentParams } from '../../../../../../../maps/public/classes/tooltips/tooltip_property';
|
||||
|
||||
export interface EmbeddedMapProps {
|
||||
upPoints: LocationPoint[];
|
||||
|
|
|
@ -22,8 +22,7 @@ import { AppState } from '../../../../../state';
|
|||
import { monitorLocationsSelector } from '../../../../../state/selectors';
|
||||
import { useMonitorId } from '../../../../../hooks';
|
||||
import { MonitorLocation } from '../../../../../../common/runtime_types/monitor';
|
||||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
|
||||
import { RenderTooltipContentParams } from '../../../../../../../maps/public/classes/tooltips/tooltip_property';
|
||||
import type { RenderTooltipContentParams } from '../../../../../../../maps/public';
|
||||
import { formatAvailabilityValue } from '../../availability_reporting/availability_reporting';
|
||||
import { LastCheckLabel } from '../../translations';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue