Skip to content

Commit afd115a

Browse files
Spencerjoshdoverspalgerelasticmachine
committed
[kbn/optimizer] implement "requiredBundles" property of KP plugins (#70911)
Co-authored-by: Josh Dover <me@joshdover.com> Co-authored-by: spalger <spalger@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> # Conflicts: # packages/kbn-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap # src/plugins/embeddable/kibana.json # src/plugins/telemetry/kibana.json # src/plugins/ui_actions/kibana.json # x-pack/plugins/apm/kibana.json # x-pack/plugins/upgrade_assistant/kibana.json
1 parent 1d8e67e commit afd115a

127 files changed

Lines changed: 890 additions & 184 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/development/core/server/kibana-plugin-core-server.discoveredplugin.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ export interface DiscoveredPlugin
1919
| [configPath](./kibana-plugin-core-server.discoveredplugin.configpath.md) | <code>ConfigPath</code> | Root configuration path used by the plugin, defaults to "id" in snake\_case format. |
2020
| [id](./kibana-plugin-core-server.discoveredplugin.id.md) | <code>PluginName</code> | Identifier of the plugin. |
2121
| [optionalPlugins](./kibana-plugin-core-server.discoveredplugin.optionalplugins.md) | <code>readonly PluginName[]</code> | An optional list of the other plugins that if installed and enabled \*\*may be\*\* leveraged by this plugin for some additional functionality but otherwise are not required for this plugin to work properly. |
22+
| [requiredBundles](./kibana-plugin-core-server.discoveredplugin.requiredbundles.md) | <code>readonly PluginName[]</code> | List of plugin ids that this plugin's UI code imports modules from that are not in <code>requiredPlugins</code>. |
2223
| [requiredPlugins](./kibana-plugin-core-server.discoveredplugin.requiredplugins.md) | <code>readonly PluginName[]</code> | An optional list of the other plugins that \*\*must be\*\* installed and enabled for this plugin to function properly. |
2324

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [DiscoveredPlugin](./kibana-plugin-core-server.discoveredplugin.md) &gt; [requiredBundles](./kibana-plugin-core-server.discoveredplugin.requiredbundles.md)
4+
5+
## DiscoveredPlugin.requiredBundles property
6+
7+
List of plugin ids that this plugin's UI code imports modules from that are not in `requiredPlugins`<!-- -->.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
readonly requiredBundles: readonly PluginName[];
13+
```
14+
15+
## Remarks
16+
17+
The plugins listed here will be loaded in the browser, even if the plugin is disabled. Required by `@kbn/optimizer` to support cross-plugin imports. "core" and plugins already listed in `requiredPlugins` do not need to be duplicated here.
18+

docs/development/core/server/kibana-plugin-core-server.pluginmanifest.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Should never be used in code outside of Core but is exported for documentation p
2525
| [id](./kibana-plugin-core-server.pluginmanifest.id.md) | <code>PluginName</code> | Identifier of the plugin. Must be a string in camelCase. Part of a plugin public contract. Other plugins leverage it to access plugin API, navigate to the plugin, etc. |
2626
| [kibanaVersion](./kibana-plugin-core-server.pluginmanifest.kibanaversion.md) | <code>string</code> | The version of Kibana the plugin is compatible with, defaults to "version". |
2727
| [optionalPlugins](./kibana-plugin-core-server.pluginmanifest.optionalplugins.md) | <code>readonly PluginName[]</code> | An optional list of the other plugins that if installed and enabled \*\*may be\*\* leveraged by this plugin for some additional functionality but otherwise are not required for this plugin to work properly. |
28+
| [requiredBundles](./kibana-plugin-core-server.pluginmanifest.requiredbundles.md) | <code>readonly string[]</code> | List of plugin ids that this plugin's UI code imports modules from that are not in <code>requiredPlugins</code>. |
2829
| [requiredPlugins](./kibana-plugin-core-server.pluginmanifest.requiredplugins.md) | <code>readonly PluginName[]</code> | An optional list of the other plugins that \*\*must be\*\* installed and enabled for this plugin to function properly. |
2930
| [server](./kibana-plugin-core-server.pluginmanifest.server.md) | <code>boolean</code> | Specifies whether plugin includes some server-side specific functionality. |
3031
| [ui](./kibana-plugin-core-server.pluginmanifest.ui.md) | <code>boolean</code> | Specifies whether plugin includes some client/browser specific functionality that should be included into client bundle via <code>public/ui_plugin.js</code> file. |
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [PluginManifest](./kibana-plugin-core-server.pluginmanifest.md) &gt; [requiredBundles](./kibana-plugin-core-server.pluginmanifest.requiredbundles.md)
4+
5+
## PluginManifest.requiredBundles property
6+
7+
List of plugin ids that this plugin's UI code imports modules from that are not in `requiredPlugins`<!-- -->.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
readonly requiredBundles: readonly string[];
13+
```
14+
15+
## Remarks
16+
17+
The plugins listed here will be loaded in the browser, even if the plugin is disabled. Required by `@kbn/optimizer` to support cross-plugin imports. "core" and plugins already listed in `requiredPlugins` do not need to be duplicated here.
18+

examples/bfetch_explorer/kibana.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"server": true,
66
"ui": true,
77
"requiredPlugins": ["bfetch", "developerExamples"],
8-
"optionalPlugins": []
8+
"optionalPlugins": [],
9+
"requiredBundles": ["kibanaReact"]
910
}

examples/dashboard_embeddable_examples/kibana.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"server": false,
66
"ui": true,
77
"requiredPlugins": ["embeddable", "embeddableExamples", "dashboard", "developerExamples"],
8-
"optionalPlugins": []
8+
"optionalPlugins": [],
9+
"requiredBundles": ["esUiShared"]
910
}

examples/embeddable_examples/kibana.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
"ui": true,
77
"requiredPlugins": ["embeddable", "uiActions"],
88
"optionalPlugins": [],
9-
"extraPublicDirs": ["public/todo", "public/hello_world", "public/todo/todo_ref_embeddable"]
9+
"extraPublicDirs": ["public/todo", "public/hello_world", "public/todo/todo_ref_embeddable"],
10+
"requiredBundles": ["kibanaReact"]
1011
}

examples/state_containers_examples/kibana.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"server": true,
66
"ui": true,
77
"requiredPlugins": ["navigation", "data", "developerExamples"],
8-
"optionalPlugins": []
8+
"optionalPlugins": [],
9+
"requiredBundles": ["kibanaUtils", "kibanaReact"]
910
}

examples/ui_action_examples/kibana.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"server": false,
66
"ui": true,
77
"requiredPlugins": ["uiActions"],
8-
"optionalPlugins": []
8+
"optionalPlugins": [],
9+
"requiredBundles": ["kibanaReact"]
910
}

examples/ui_actions_explorer/kibana.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"server": false,
66
"ui": true,
77
"requiredPlugins": ["uiActions", "uiActionsExamples", "developerExamples"],
8-
"optionalPlugins": []
8+
"optionalPlugins": [],
9+
"requiredBundles": ["kibanaReact"]
910
}

0 commit comments

Comments
 (0)