Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression #208891

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

mbondyra
Copy link
Contributor

@mbondyra mbondyra commented Jan 30, 2025

Summary

part of #208908

Replaces scss to css-in-js. I've tested all the changes.

@mbondyra mbondyra added Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens v9.0.0 backport:version Backport to applied version labels v8.18.0 labels Jan 30, 2025
@mbondyra mbondyra requested review from a team as code owners January 30, 2025 09:34
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@mbondyra mbondyra added the release_note:skip Skip the PR/issue when compiling release notes label Jan 30, 2025
@mbondyra mbondyra changed the title [Lens] Remove scss from annotations plugin [Lens] Remove scss from annotations plugin nad visualization-ui-components Jan 30, 2025
@mbondyra mbondyra changed the title [Lens] Remove scss from annotations plugin nad visualization-ui-components [Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression Jan 30, 2025
Copy link
Contributor

@MichaelMarcialis MichaelMarcialis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @mbondyra. I've left two small comments/question regarding whether we can reduce some style repetition/redundancy, but this looks good to me otherwise. Assuming you're able to address those, I'll approve now so I don't hold you up.

Comment on lines +370 to +374
css={css`
& + .lnsRowCompressedMargin {
margin-top: ${euiThemeVars.euiSizeS};
}
`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This same style is used multiple times throughout this PR. To keep things DRY, would it be better to store this style in a separate .style.ts file and reference that one style in all locations, rather than repeating the style?

Comment on lines +65 to +68
css: {
color: !fieldOption.compatible ? euiThemeVars.euiColorLightShade : undefined,
backgroundColor: !fieldOptionExists ? euiThemeVars.euiColorLightestShade : undefined,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here as previous. Is there anything that can be done here to avoid repeating the same styles?

} from '@elastic/eui';
import type { DataViewBase, Query } from '@kbn/es-query';
import { css } from '@emotion/react';
import { euiThemeVars } from '@kbn/ui-theme';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like the EUI team is asking people to move away from using euiThemeVars and instead using the useEuiTheme hook. See #199715 and search for euiThemeVars.

Before:

import { EuiIcon, EuiCode, EuiText, useEuiTheme } from '@elastic/eui';
height: ${euiThemeVars.euiSizeXS} / 2;

After:

import { useEuiTheme } from '@elastic/eui'
const { euiTheme } = useEuiTheme();
height: ${euiTheme.size.xs} / 2;

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
eventAnnotationListing 741 705 -36
expressionGauge 102 82 -20
lens 1810 1738 -72
observability 1353 1317 -36
total -164

Async chunks

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

id before after diff
eventAnnotationListing 241.0KB 231.9KB -9.1KB
expressionGauge 24.0KB 16.5KB -7.6KB
lens 1.6MB 1.6MB -8.3KB
observability 1.3MB 1.3MB +49.1KB
total +24.2KB

Page load bundle

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

id before after diff
eventAnnotationListing 10.9KB 11.0KB +163.0B
expressionGauge 13.8KB 13.9KB +87.0B
lens 50.2KB 50.2KB -1.0B
observability 102.1KB 102.5KB +420.0B
total +669.0B
Unknown metric groups

async chunk count

id before after diff
eventAnnotationListing 5 6 +1
observability 21 25 +4
total +5

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants