[Share] Convert Share registry to async registry#224139
[Share] Convert Share registry to async registry#224139nickpeihl wants to merge 1 commit intoelastic:mainfrom
Conversation
Currently not wired up to internal share contexts
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
💔 Build Failed
Failed CI StepsHistory |
| const [hasShareIntegration, setHasShareIntegration] = useState(false); | ||
|
|
||
| useEffect(() => { | ||
| let canceled = false; |
There was a problem hiding this comment.
Maybe it would be better to have a reusable custom hook that different plugins could use to check if their integrations are available?
There was a problem hiding this comment.
We could create one such hook, however I'd rather this api remains synchronous, so we don't have a situation where the share options flicker because on the first render pass we can't tell if there are any available integrations.
| shareService?.availableIntegrations('dashboard', 'export')?.length | ||
| ); | ||
| const [hasExportIntegration, setHasExportIntegration] = useState(false); | ||
| useEffect(() => { |
There was a problem hiding this comment.
| import { useEffect, useState } from 'react'; | ||
| import type { DiscoverServices } from '../../../build_services'; | ||
|
|
||
| export function useHasShareIntegration({ share }: DiscoverServices) { |
There was a problem hiding this comment.
| shareActionIntent: ShareActionIntents | ||
| ): void { | ||
| key: ShareContextMapKey, | ||
| getShareActionIntent: () => Promise<ShareActionIntents> |
There was a problem hiding this comment.
Since the getShareActionIntent returns a promise, we can't introspect the shareActionIntent to generate a key. So we must specify a key in the parameters.
There was a problem hiding this comment.
I think it might be better for this API we were to actually accept the groupId? for the integration and an id, so we can still manage the key for the integration internally based off these values that are meaningful to the consumer.
There was a problem hiding this comment.
Another advantage to this approach would mean that we'll be able to check available integrations synchronously rather than async, and not have to modify functions returning nav config for other apps becoming async, with the resolution of the share implementation still async.
| shareObject: string, | ||
| key: ShareIntegrationMapKey, | ||
| getShareActionIntent: () => Promise<Omit<I, 'shareType'>> |
There was a problem hiding this comment.
This forces users to specify a share object, we should at the very least specify that shareObject is either * | string
| shareActionIntent: ShareActionIntents | ||
| ): void { | ||
| key: ShareContextMapKey, | ||
| getShareActionIntent: () => Promise<ShareActionIntents> |
There was a problem hiding this comment.
I think it might be better for this API we were to actually accept the groupId? for the integration and an id, so we can still manage the key for the integration internally based off these values that are meaningful to the consumer.
| } | ||
|
|
||
| private resolveShareItemsForShareContext({ | ||
| private async resolveShareItemsForShareContext({ |
There was a problem hiding this comment.
Since this signature changed we'll need to in turn change the signature of toggleShareContextMenu to become async, because this method gets invoked within it. See 6a0319a
| const [hasShareIntegration, setHasShareIntegration] = useState(false); | ||
|
|
||
| useEffect(() => { | ||
| let canceled = false; |
There was a problem hiding this comment.
We could create one such hook, however I'd rather this api remains synchronous, so we don't have a situation where the share options flicker because on the first render pass we can't tell if there are any available integrations.
| shareActionIntent: ShareActionIntents | ||
| ): void { | ||
| key: ShareContextMapKey, | ||
| getShareActionIntent: () => Promise<ShareActionIntents> |
There was a problem hiding this comment.
Another advantage to this approach would mean that we'll be able to check available integrations synchronously rather than async, and not have to modify functions returning nav config for other apps becoming async, with the resolution of the share implementation still async.
|
Closing in preference to #228973 |
## Summary Informed from #224139 This PR makes changes to the share integration implementation, such that the definition for share config integration is a config that returns a promise. Adopting this approach allows checking the availability of a specific integration remains synchronous, however loading the implementation for any share integration would happen asynchronously, in turn allows us to have every share integration bundle to be defined as a separate chunk so we aren't loading every share integration render config up front but rather when it's been determined that the current user supports said integration. <!-- ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> --------- Co-authored-by: Nick Peihl <nick.peihl@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary Informed from elastic#224139 This PR makes changes to the share integration implementation, such that the definition for share config integration is a config that returns a promise. Adopting this approach allows checking the availability of a specific integration remains synchronous, however loading the implementation for any share integration would happen asynchronously, in turn allows us to have every share integration bundle to be defined as a separate chunk so we aren't loading every share integration render config up front but rather when it's been determined that the current user supports said integration. <!-- ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> --------- Co-authored-by: Nick Peihl <nick.peihl@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 63a0ed5) # Conflicts: # src/platform/packages/private/kbn-reporting/public/share/integrations/csv/csv_export_config.tsx # src/platform/packages/private/kbn-reporting/public/share/share_context_menu/register_pdf_png_modal_reporting.tsx # src/platform/plugins/shared/discover/public/application/main/components/top_nav/use_discover_topnav.ts # src/platform/plugins/shared/discover/public/application/main/components/top_nav/use_top_nav_links.tsx # src/platform/plugins/shared/share/public/services/share_menu_registry.test.ts # x-pack/platform/plugins/private/reporting/public/plugin.ts # x-pack/platform/plugins/shared/lens/public/app_plugin/csv_download_provider/csv_download_provider.tsx # x-pack/platform/plugins/shared/lens/public/plugin.ts
## Summary Informed from elastic#224139 This PR makes changes to the share integration implementation, such that the definition for share config integration is a config that returns a promise. Adopting this approach allows checking the availability of a specific integration remains synchronous, however loading the implementation for any share integration would happen asynchronously, in turn allows us to have every share integration bundle to be defined as a separate chunk so we aren't loading every share integration render config up front but rather when it's been determined that the current user supports said integration. <!-- ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> --------- Co-authored-by: Nick Peihl <nick.peihl@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 63a0ed5) # Conflicts: # src/platform/packages/private/kbn-reporting/public/share/integrations/csv/csv_export_config.tsx # src/platform/packages/private/kbn-reporting/public/share/share_context_menu/register_pdf_png_modal_reporting.tsx # src/platform/plugins/shared/share/public/services/share_menu_registry.test.ts # x-pack/platform/plugins/shared/lens/public/app_plugin/csv_download_provider/csv_download_provider.tsx # x-pack/platform/plugins/shared/lens/public/plugin.ts
## Summary Informed from elastic#224139 This PR makes changes to the share integration implementation, such that the definition for share config integration is a config that returns a promise. Adopting this approach allows checking the availability of a specific integration remains synchronous, however loading the implementation for any share integration would happen asynchronously, in turn allows us to have every share integration bundle to be defined as a separate chunk so we aren't loading every share integration render config up front but rather when it's been determined that the current user supports said integration. <!-- ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> --------- Co-authored-by: Nick Peihl <nick.peihl@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 63a0ed5) # Conflicts: # src/platform/packages/private/kbn-reporting/public/share/integrations/csv/csv_export_config.tsx # src/platform/packages/private/kbn-reporting/public/share/share_context_menu/register_pdf_png_modal_reporting.tsx # src/platform/plugins/shared/discover/public/application/main/components/top_nav/use_discover_topnav.ts # src/platform/plugins/shared/discover/public/application/main/components/top_nav/use_top_nav_links.tsx # src/platform/plugins/shared/share/public/services/share_menu_registry.test.ts # x-pack/platform/plugins/private/reporting/public/plugin.ts # x-pack/platform/plugins/shared/lens/public/app_plugin/csv_download_provider/csv_download_provider.tsx # x-pack/platform/plugins/shared/lens/public/plugin.ts
## Summary Informed from elastic#224139 This PR makes changes to the share integration implementation, such that the definition for share config integration is a config that returns a promise. Adopting this approach allows checking the availability of a specific integration remains synchronous, however loading the implementation for any share integration would happen asynchronously, in turn allows us to have every share integration bundle to be defined as a separate chunk so we aren't loading every share integration render config up front but rather when it's been determined that the current user supports said integration. <!-- ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> --------- Co-authored-by: Nick Peihl <nick.peihl@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 63a0ed5) # Conflicts: # src/platform/packages/private/kbn-reporting/public/share/integrations/csv/csv_export_config.tsx # src/platform/packages/private/kbn-reporting/public/share/share_context_menu/register_pdf_png_modal_reporting.tsx # src/platform/plugins/shared/discover/public/application/main/components/top_nav/use_discover_topnav.ts # src/platform/plugins/shared/discover/public/application/main/components/top_nav/use_top_nav_links.tsx # src/platform/plugins/shared/share/public/services/share_menu_registry.test.ts # x-pack/platform/plugins/private/reporting/public/plugin.ts # x-pack/platform/plugins/shared/lens/public/app_plugin/csv_download_provider/csv_download_provider.tsx # x-pack/platform/plugins/shared/lens/public/plugin.ts
## Summary Informed from elastic#224139 This PR makes changes to the share integration implementation, such that the definition for share config integration is a config that returns a promise. Adopting this approach allows checking the availability of a specific integration remains synchronous, however loading the implementation for any share integration would happen asynchronously, in turn allows us to have every share integration bundle to be defined as a separate chunk so we aren't loading every share integration render config up front but rather when it's been determined that the current user supports said integration. <!-- ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> --------- Co-authored-by: Nick Peihl <nick.peihl@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary Informed from elastic#224139 This PR makes changes to the share integration implementation, such that the definition for share config integration is a config that returns a promise. Adopting this approach allows checking the availability of a specific integration remains synchronous, however loading the implementation for any share integration would happen asynchronously, in turn allows us to have every share integration bundle to be defined as a separate chunk so we aren't loading every share integration render config up front but rather when it's been determined that the current user supports said integration. <!-- ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> --------- Co-authored-by: Nick Peihl <nick.peihl@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
WIP Currently not wired up to internal share contexts, but I've hit a wall trying to asynchronously load the menu items. Feel free to pick up where I left off or I can continue to work on it as I have time.
Summary
Changes the Share registry in the share plugin to an async registry.
With this PR:
registerShareIntegrationmethod onShareRegistryrequire ashareObject,key, and a function returning a Promise that returns theShareIntegration.availableIntegrationsandresolveShareItemsForShareContextnow return promises.TODO
ShareContextto asynchronously get the menuItems from theresolveShareItemsForShareContextpromise.availableIntegrationsto support promises.Preliminary initial page load decreases
I used
node scripts/build_kibana_platform_plugins --profile --no-cache --distto generatemetrics.jsonfiles for all plugins in this branch and the main branch. And then manually compared the sizes inmetrics.jsonfor each plugin against the other branch.Reference
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesIdentify risks
Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.