forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Maps] Code split Maps app (elastic#64594)
Code-split the maps-plugin to reduce the initial `maps.plugin.js` size. There were two main code dependencies in the plugin initialization that were the root cause of the large bundle size. - `GisMap` wraps the entire application UX, including the add-layer-wizard. The layer wizards only need to be available there. This PR moves the `load_layer_wizard` dependency from the plugin-initialization to the `GisMap` component. - The `MapEmbeddableFactory` needs to be registered at plugin-initialization. However, this module imports a lot of core-application code. By code-splitting here, we avoid pulling in the entire Maps-app in the main bundle. This also introduces a lazy-initialization of the `GisMap` itself as an additional split to further reduce size of the bundles.
- Loading branch information
1 parent
89b0cfd
commit 17580dc
Showing
9 changed files
with
138 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
// These are map-dependencies of the embeddable. | ||
// By lazy-loading these, the Maps-app can register the embeddable when the plugin mounts, without actually pulling all the code. | ||
|
||
// @ts-ignore | ||
export * from '../../angular/services/gis_map_saved_object_loader'; | ||
export * from '../map_embeddable'; | ||
export * from '../../kibana_services'; | ||
export * from '../../reducers/store'; | ||
export * from '../../actions/map_actions'; | ||
export * from '../../selectors/map_selectors'; | ||
export * from '../../angular/get_initial_layers'; | ||
export * from './../merge_input_with_saved_map'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { IIndexPattern } from '../../../../../src/plugins/data/common/index_patterns'; | ||
import { MapSettings } from '../reducers/map'; | ||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths | ||
import { EmbeddableInput } from '../../../../../src/plugins/embeddable/public/lib/embeddables'; | ||
import { Filter, Query, RefreshInterval, TimeRange } from '../../../../../src/plugins/data/common'; | ||
import { MapCenterAndZoom } from '../../common/descriptor_types'; | ||
|
||
export interface MapEmbeddableConfig { | ||
editUrl?: string; | ||
indexPatterns: IIndexPattern[]; | ||
editable: boolean; | ||
title?: string; | ||
layerList: unknown[]; | ||
settings?: MapSettings; | ||
} | ||
|
||
export interface MapEmbeddableInput extends EmbeddableInput { | ||
timeRange?: TimeRange; | ||
filters: Filter[]; | ||
query?: Query; | ||
refreshConfig: RefreshInterval; | ||
isLayerTOCOpen: boolean; | ||
openTOCDetails?: string[]; | ||
disableTooltipControl?: boolean; | ||
disableInteractive?: boolean; | ||
hideToolbarOverlay?: boolean; | ||
hideLayerControl?: boolean; | ||
hideViewControl?: boolean; | ||
mapCenter?: MapCenterAndZoom; | ||
hiddenLayers?: string[]; | ||
hideFilterActions?: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters