Skip to content

Commit

Permalink
[Maps] do not lazy load setup API methods (#114150)
Browse files Browse the repository at this point in the history
* [Maps] do not lazy load setup API methods

* remove test code
  • Loading branch information
nreese authored Oct 7, 2021
1 parent 758eb15 commit c2aeac5
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 37 deletions.
1 change: 0 additions & 1 deletion x-pack/plugins/maps/public/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
export { MapsStartApi } from './start_api';
export { MapsSetupApi } from './setup_api';
export { createLayerDescriptors } from './create_layer_descriptors';
export { registerLayerWizard, registerSource } from './register';
export { suggestEMSTermJoinConfig } from './ems';
20 changes: 0 additions & 20 deletions x-pack/plugins/maps/public/api/register.ts

This file was deleted.

4 changes: 2 additions & 2 deletions x-pack/plugins/maps/public/api/setup_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ import type { SourceRegistryEntry } from '../classes/sources/source_registry';
import type { LayerWizard } from '../classes/layers/layer_wizard_registry';

export interface MapsSetupApi {
registerLayerWizard(layerWizard: LayerWizard): Promise<void>;
registerSource(entry: SourceRegistryEntry): Promise<void>;
registerLayerWizard(layerWizard: LayerWizard): void;
registerSource(entry: SourceRegistryEntry): void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/* eslint-disable @typescript-eslint/consistent-type-definitions */

import { ReactElement, FunctionComponent } from 'react';
import { LayerDescriptor } from '../../../common/descriptor_types';
import type { LayerDescriptor } from '../../../common/descriptor_types';
import { LAYER_WIZARD_CATEGORY } from '../../../common/constants';

export type RenderWizardArguments = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/* eslint-disable @typescript-eslint/consistent-type-definitions */

import { ISource } from './source';
import type { ISource } from './source';
import { Adapters } from '../../../../../../src/plugins/inspector/common/adapters';

export type SourceRegistryEntry = {
Expand Down
8 changes: 0 additions & 8 deletions x-pack/plugins/maps/public/lazy_load_bundle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import type {
MapEmbeddableInput,
MapEmbeddableType,
} from '../embeddable/types';
import { SourceRegistryEntry } from '../classes/sources/source_registry';
import { LayerWizard } from '../classes/layers/layer_wizard_registry';
import type { CreateLayerDescriptorParams } from '../classes/sources/es_search_source';
import type { EMSTermJoinConfig, SampleValuesConfig } from '../ems_autosuggest';
import type { CreateTileMapLayerDescriptorParams } from '../classes/layers/create_tile_map_layer_descriptor';
Expand All @@ -36,8 +34,6 @@ export interface LazyLoadedMapModules {
indexPatternId: string,
indexPatternTitle: string
) => LayerDescriptor[];
registerLayerWizard: (layerWizard: LayerWizard) => void;
registerSource(entry: SourceRegistryEntry): void;
createTileMapLayerDescriptor: ({
label,
mapType,
Expand Down Expand Up @@ -77,8 +73,6 @@ export async function lazyLoadMapModules(): Promise<LazyLoadedMapModules> {
getMapsCapabilities,
renderApp,
createSecurityLayerDescriptors,
registerLayerWizard,
registerSource,
createTileMapLayerDescriptor,
createRegionMapLayerDescriptor,
createBasemapLayerDescriptor,
Expand All @@ -91,8 +85,6 @@ export async function lazyLoadMapModules(): Promise<LazyLoadedMapModules> {
getMapsCapabilities,
renderApp,
createSecurityLayerDescriptors,
registerLayerWizard,
registerSource,
createTileMapLayerDescriptor,
createRegionMapLayerDescriptor,
createBasemapLayerDescriptor,
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/maps/public/lazy_load_bundle/lazy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export * from '../../embeddable/map_embeddable';
export * from '../../kibana_services';
export { renderApp } from '../../render_app';
export * from '../../classes/layers/solution_layers/security';
export { registerLayerWizard } from '../../classes/layers/layer_wizard_registry';
export { registerSource } from '../../classes/sources/source_registry';
export { createTileMapLayerDescriptor } from '../../classes/layers/create_tile_map_layer_descriptor';
export { createRegionMapLayerDescriptor } from '../../classes/layers/create_region_map_layer_descriptor';
export { createBasemapLayerDescriptor } from '../../classes/layers/create_basemap_layer_descriptor';
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/maps/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ import { getAppTitle } from '../common/i18n_getters';
import { lazyLoadMapModules } from './lazy_load_bundle';
import {
createLayerDescriptors,
registerLayerWizard,
registerSource,
MapsSetupApi,
MapsStartApi,
suggestEMSTermJoinConfig,
} from './api';
import { registerLayerWizard } from './classes/layers/layer_wizard_registry';
import { registerSource } from './classes/sources/source_registry';
import type { SharePluginSetup, SharePluginStart } from '../../../../src/plugins/share/public';
import type { MapsEmsPluginSetup } from '../../../../src/plugins/maps_ems/public';
import type { DataPublicPluginStart } from '../../../../src/plugins/data/public';
Expand Down

0 comments on commit c2aeac5

Please sign in to comment.