elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.35k stars 7.98k forks source link

[ObservabilitySolution] Remove usage of deprecated modules, Part II #182195

Closed tsullivan closed 4 days ago

tsullivan commented 2 weeks ago

Summary

Partially addresses https://github.com/elastic/kibana-team/issues/805

These changes come up from searching in the code and finding where certain kinds of deprecated AppEx-SharedUX modules are imported. Reviewers: Please interact with critical paths through the UI components touched in this PR, ESPECIALLY in terms of testing dark mode and i18n.

This is the 2nd PR to focus on code within Observability, following https://github.com/elastic/kibana/pull/180844.

image

Note: this also makes inclusion of i18n and analytics dependencies consistent. Analytics is an optional dependency for the SharedUX modules, which wrap KibanaErrorBoundaryProvider and is designed to capture telemetry about errors that are caught in the error boundary.

Checklist

Delete any items that are not applicable to this PR.

elasticmachine commented 1 week ago

Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs)

elasticmachine commented 1 week ago

Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services)

elasticmachine commented 1 week ago

Pinging @elastic/obs-knowledge-team (Team:obs-knowledge)

elasticmachine commented 1 week ago

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

tsullivan commented 5 days ago

While testing the changes I noticed that the Comparison field was pushed to the right side.

Hi @cauemarcondes I can reproduce this issue in my branch and see the difference from the main branch. I can track the behavior down to the EuiFlexGroup/EuiFlexItem in the file: x-pack/plugins/observability_solution/apm/public/components/shared/search_bar/search_bar.tsx. I can create the behavior you indicate you are looking for with this change:

diff --git x-pack/plugins/observability_solution/apm/public/components/shared/search_bar/search_bar.tsx x-pack/plugins/observability_solution/apm/public/components/shared/search_bar/search_bar.tsx
index 57033eb5f1d..7a3bf86849b 100644
--- x-pack/plugins/observability_solution/apm/public/components/shared/search_bar/search_bar.tsx
+++ x-pack/plugins/observability_solution/apm/public/components/shared/search_bar/search_bar.tsx
@@ -31,7 +31,7 @@ export function SearchBar({
   searchBarPlaceholder,
   searchBarBoolFilter,
 }: Props) {
-  const { isSmall, isMedium, isLarge, isXl, isXXL, isXXXL } = useBreakpoints();
+  const { isSmall, isMedium, isLarge, isXl, isXXXL } = useBreakpoints();

   if (hidden) {
     return null;
@@ -69,7 +69,6 @@ export function SearchBar({
         <EuiFlexItem grow={showTimeComparison && !isXXXL}>
           <EuiFlexGroup
             direction={isSmall || isMedium || isLarge ? 'columnReverse' : 'row'}
-            justifyContent={isXXL ? 'flexEnd' : undefined}
             gutterSize="s"
             responsive={false}
           >

The new positioning effect must be related somehow to different way that EuiProvider is being injected. But I wonder if there actually was a bug in main which is being fixed as a side-effect of this PR. The justifyContext prop is clearly intended to push the flex item context to the "end" when the screen width is XXL and above. I will hold off on making this change for now.

kibana-ci commented 4 days ago

:green_heart: Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1805 1807 +2
infra 1545 1555 +10
metricsDataAccess 264 275 +11
observabilityOnboarding 186 200 +14
total +37

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
apm 3.3MB 3.3MB +3.7KB
infra 1.5MB 1.5MB -446.0B
metricsDataAccess 83.4KB 85.2KB +1.8KB
observability 286.3KB 286.3KB +53.0B
observabilityOnboarding 197.3KB 199.6KB +2.3KB
slo 854.0KB 854.5KB +496.0B
total +7.9KB

Canvas Sharable Runtime

The Canvas "shareable runtime" is an bundle produced to enable running Canvas workpads outside of Kibana. This bundle is included in third-party webpages that embed canvas and therefor should be as slim as possible.

id before after diff
module count - 5407 +5407
total size - 8.8MB +8.8MB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
infra 103.4KB 105.4KB +2.0KB
metricsDataAccess 56.8KB 56.9KB +91.0B
observabilityOnboarding 6.5KB 6.7KB +213.0B
slo 22.9KB 23.2KB +280.0B
total +2.5KB
Unknown metric groups #### References to deprecated APIs | id | [before](https://github.com/elastic/kibana/commit/3ecd73c2e595f6c4a77ba030e991b8c9d0b50dd7) | [after](https://github.com/elastic/kibana/commit/814b9d8311569e2452b66b51ce996ad7f59a3d17) | diff | | --- | --- | --- | --- | | `apm` | 30 | 27 | -3 | | `infra` | 5 | 2 | -3 | | `metricsDataAccess` | 3 | 0 | -3 | | `observabilityOnboarding` | 4 | 1 | -3 | | total | | | -12 | #### Unreferenced deprecated APIs | id | [before](https://github.com/elastic/kibana/commit/3ecd73c2e595f6c4a77ba030e991b8c9d0b50dd7) | [after](https://github.com/elastic/kibana/commit/814b9d8311569e2452b66b51ce996ad7f59a3d17) | diff | | --- | --- | --- | --- | | `kibanaReact` | 2 | 3 | +1 |

History

To update your PR or re-run it, just comment with: @elasticmachine merge upstream

cc @tsullivan

tsullivan commented 4 days ago

I'm reading in other channels that Cauê's approval can be accepted on behalf of @elastic/obs-knowledge-team