-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Conversation
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
d2cd1ac
to
21bf098
Compare
There was a problem hiding this 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.
css={css` | ||
& + .lnsRowCompressedMargin { | ||
margin-top: ${euiThemeVars.euiSizeS}; | ||
} | ||
`} |
There was a problem hiding this comment.
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?
css: { | ||
color: !fieldOption.compatible ? euiThemeVars.euiColorLightShade : undefined, | ||
backgroundColor: !fieldOptionExists ? euiThemeVars.euiColorLightestShade : undefined, | ||
}, |
There was a problem hiding this comment.
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?
21bf098
to
56d998a
Compare
} from '@elastic/eui'; | ||
import type { DataViewBase, Query } from '@kbn/es-query'; | ||
import { css } from '@emotion/react'; | ||
import { euiThemeVars } from '@kbn/ui-theme'; |
There was a problem hiding this comment.
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;
2aa224f
to
6e1fc08
Compare
6e1fc08
to
864c6db
Compare
864c6db
to
5c76252
Compare
e895517
to
9e73246
Compare
09a900e
to
3b653dc
Compare
8ee793d
to
006d20a
Compare
3e3c709
to
774dae9
Compare
"sideEffects": [ | ||
"*.scss" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should change this to sideEffects: false
to avoid a different treeshake in the bundle.
sideEffects is by default true
@@ -2,8 +2,5 @@ | |||
"name": "@kbn/event-annotation-components", | |||
"private": true, | |||
"version": "1.0.0", | |||
"license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", | |||
"sideEffects": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep sideEffects: false
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
|
Starting backport for target branches: 8.18, 8.x, 9.0 |
…ts and gauge expression (elastic#208891) ## Summary part of elastic#208908 Replaces scss to css-in-js. I've tested all the changes. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 91a19c0)
…ts and gauge expression (elastic#208891) ## Summary part of elastic#208908 Replaces scss to css-in-js. I've tested all the changes. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 91a19c0)
…ts and gauge expression (elastic#208891) ## Summary part of elastic#208908 Replaces scss to css-in-js. I've tested all the changes. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 91a19c0)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…mponents and gauge expression (#208891) (#211567) # Backport This will backport the following commits from `main` to `9.0`: - [[Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression (#208891)](#208891) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Marta Bondyra","email":"4283304+mbondyra@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-18T12:31:09Z","message":"[Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression (#208891)\n\n## Summary\r\n\r\npart of https://github.com/elastic/kibana/issues/208908\r\n\r\nReplaces scss to css-in-js. I've tested all the changes.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"91a19c0969bc140ad4c16e69eb23f424b0ecae4f","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","Feature:Lens","v9.0.0","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression","number":208891,"url":"https://github.com/elastic/kibana/pull/208891","mergeCommit":{"message":"[Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression (#208891)\n\n## Summary\r\n\r\npart of https://github.com/elastic/kibana/issues/208908\r\n\r\nReplaces scss to css-in-js. I've tested all the changes.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"91a19c0969bc140ad4c16e69eb23f424b0ecae4f"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/208891","number":208891,"mergeCommit":{"message":"[Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression (#208891)\n\n## Summary\r\n\r\npart of https://github.com/elastic/kibana/issues/208908\r\n\r\nReplaces scss to css-in-js. I've tested all the changes.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"91a19c0969bc140ad4c16e69eb23f424b0ecae4f"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
…omponents and gauge expression (#208891) (#211565) # Backport This will backport the following commits from `main` to `8.18`: - [[Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression (#208891)](#208891) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Marta Bondyra","email":"4283304+mbondyra@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-18T12:31:09Z","message":"[Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression (#208891)\n\n## Summary\r\n\r\npart of https://github.com/elastic/kibana/issues/208908\r\n\r\nReplaces scss to css-in-js. I've tested all the changes.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"91a19c0969bc140ad4c16e69eb23f424b0ecae4f","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","Feature:Lens","v9.0.0","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression","number":208891,"url":"https://github.com/elastic/kibana/pull/208891","mergeCommit":{"message":"[Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression (#208891)\n\n## Summary\r\n\r\npart of https://github.com/elastic/kibana/issues/208908\r\n\r\nReplaces scss to css-in-js. I've tested all the changes.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"91a19c0969bc140ad4c16e69eb23f424b0ecae4f"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/208891","number":208891,"mergeCommit":{"message":"[Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression (#208891)\n\n## Summary\r\n\r\npart of https://github.com/elastic/kibana/issues/208908\r\n\r\nReplaces scss to css-in-js. I've tested all the changes.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"91a19c0969bc140ad4c16e69eb23f424b0ecae4f"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
…mponents and gauge expression (#208891) (#211566) # Backport This will backport the following commits from `main` to `8.x`: - [[Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression (#208891)](#208891) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Marta Bondyra","email":"4283304+mbondyra@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-18T12:31:09Z","message":"[Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression (#208891)\n\n## Summary\r\n\r\npart of https://github.com/elastic/kibana/issues/208908\r\n\r\nReplaces scss to css-in-js. I've tested all the changes.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"91a19c0969bc140ad4c16e69eb23f424b0ecae4f","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","Feature:Lens","v9.0.0","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression","number":208891,"url":"https://github.com/elastic/kibana/pull/208891","mergeCommit":{"message":"[Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression (#208891)\n\n## Summary\r\n\r\npart of https://github.com/elastic/kibana/issues/208908\r\n\r\nReplaces scss to css-in-js. I've tested all the changes.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"91a19c0969bc140ad4c16e69eb23f424b0ecae4f"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/208891","number":208891,"mergeCommit":{"message":"[Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression (#208891)\n\n## Summary\r\n\r\npart of https://github.com/elastic/kibana/issues/208908\r\n\r\nReplaces scss to css-in-js. I've tested all the changes.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"91a19c0969bc140ad4c16e69eb23f424b0ecae4f"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Marta Bondyra <4283304+mbondyra@users.noreply.github.com>
Summary
part of #208908
Replaces scss to css-in-js. I've tested all the changes.