Skip to content

Commit

Permalink
separate plugin configs from plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Nov 18, 2019
1 parent 9b93964 commit a87b7b0
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ export interface PluginsServiceSetup
| Property | Type | Description |
| --- | --- | --- |
| [contracts](./kibana-plugin-server.pluginsservicesetup.contracts.md) | <code>Map&lt;PluginName, unknown&gt;</code> | |
| [uiPlugins](./kibana-plugin-server.pluginsservicesetup.uiplugins.md) | <code>{</code><br/><code> public: Map&lt;PluginName, DiscoveredPlugin&gt;;</code><br/><code> internal: Map&lt;PluginName, DiscoveredPluginInternal&gt;;</code><br/><code> config: Map&lt;PluginName, Observable&lt;unknown&gt; &#124; null&gt;;</code><br/><code> }</code> | |
| [uiPluginConfigs](./kibana-plugin-server.pluginsservicesetup.uipluginconfigs.md) | <code>Map&lt;PluginName, Observable&lt;unknown&gt;&gt;</code> | |
| [uiPlugins](./kibana-plugin-server.pluginsservicesetup.uiplugins.md) | <code>{</code><br/><code> public: Map&lt;PluginName, DiscoveredPlugin&gt;;</code><br/><code> internal: Map&lt;PluginName, DiscoveredPluginInternal&gt;;</code><br/><code> }</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [PluginsServiceSetup](./kibana-plugin-server.pluginsservicesetup.md) &gt; [uiPluginConfigs](./kibana-plugin-server.pluginsservicesetup.uipluginconfigs.md)

## PluginsServiceSetup.uiPluginConfigs property

<b>Signature:</b>

```typescript
uiPluginConfigs: Map<PluginName, Observable<unknown>>;
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
uiPlugins: {
public: Map<PluginName, DiscoveredPlugin>;
internal: Map<PluginName, DiscoveredPluginInternal>;
config: Map<PluginName, Observable<unknown> | null>;
};
```
1 change: 1 addition & 0 deletions src/core/server/legacy/legacy_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ export class LegacyService implements CoreService<LegacyServiceSetup> {
hapiServer: setupDeps.core.http.server,
kibanaMigrator: startDeps.core.savedObjects.migrator,
uiPlugins: setupDeps.core.plugins.uiPlugins,
uiPluginConfigs: setupDeps.core.plugins.uiPluginConfigs,
elasticsearch: setupDeps.core.elasticsearch,
uiSettings: setupDeps.core.uiSettings,
savedObjectsClientProvider: startDeps.core.savedObjects.clientProvider,
Expand Down
8 changes: 3 additions & 5 deletions src/core/server/plugins/plugins_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export interface PluginsServiceSetup {
uiPlugins: {
public: Map<PluginName, DiscoveredPlugin>;
internal: Map<PluginName, DiscoveredPluginInternal>;
config: Map<PluginName, Observable<unknown> | null>;
};
uiPluginConfigs: Map<PluginName, Observable<unknown>>;
}

/** @public */
Expand Down Expand Up @@ -103,10 +103,8 @@ export class PluginsService implements CoreService<PluginsServiceSetup, PluginsS
const uiPlugins = this.pluginsSystem.uiPlugins();
return {
contracts,
uiPlugins: {
...uiPlugins,
config: this.generateUiPluginsConfigs(uiPlugins.public),
},
uiPlugins,
uiPluginConfigs: this.generateUiPluginsConfigs(uiPlugins.public),
};
}

Expand Down
3 changes: 2 additions & 1 deletion src/core/server/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1018,10 +1018,11 @@ export interface PluginsServiceSetup {
// (undocumented)
contracts: Map<PluginName, unknown>;
// (undocumented)
uiPluginConfigs: Map<PluginName, Observable<unknown>>;
// (undocumented)
uiPlugins: {
public: Map<PluginName, DiscoveredPlugin>;
internal: Map<PluginName, DiscoveredPluginInternal>;
config: Map<PluginName, Observable<unknown> | null>;
};
}

Expand Down
1 change: 1 addition & 0 deletions src/legacy/server/kbn_server.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export default class KbnServer {
__internals: {
hapiServer: LegacyServiceSetupDeps['core']['http']['server'];
uiPlugins: LegacyServiceSetupDeps['core']['plugins']['uiPlugins'];
uiPluginConfigs: LegacyServiceSetupDeps['core']['plugins']['uiPluginConfigs'];
elasticsearch: LegacyServiceSetupDeps['core']['elasticsearch'];
uiSettings: LegacyServiceSetupDeps['core']['uiSettings'];
kibanaMigrator: LegacyServiceStartDeps['core']['savedObjects']['migrator'];
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/ui/ui_render/ui_render_mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export function uiRenderMixin(kbnServer, server, config) {

// Get the list of new platform plugins.
// Convert the Map into an array of objects so it is JSON serializable and order is preserved.
const uiPluginConfigs = kbnServer.newPlatform.__internals.uiPlugins.config;
const uiPluginConfigs = kbnServer.newPlatform.__internals.uiPluginConfigs;
const uiPlugins = await Promise.all([
...kbnServer.newPlatform.__internals.uiPlugins.public.entries(),
].map(async ([id, plugin]) => {
Expand Down

0 comments on commit a87b7b0

Please sign in to comment.