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

Bumping EUI to 71.0.0 #147142

Merged
merged 20 commits into from
Dec 19, 2022
Merged

Bumping EUI to 71.0.0 #147142

merged 20 commits into from
Dec 19, 2022

Conversation

breehall
Copy link
Contributor

@breehall breehall commented Dec 6, 2022

[email protected][email protected]


71.0.0

  • Implemented new EuiRange and EuiDualRange designs where the levels are now on top of the tracks (#6092)
  • Added discuss and dotInCircle glyphs to EuiIcon (#6434)
  • Added article glyph to EuiIcon (#6437)
  • Changed the EuiProvider usage warnings to not rely on development mode. (#6451)

Breaking changes

  • EuiDualRange now explicitly requires both min and max via props types, to match EuiRange (#6092)
  • EuiRange and EuiDualRange's compressed size no longer impacts track or level sizes, but continues to compress tick and input sizes. (#6092)
  • Removed all variables for the following components from EUI's theme JSON files: (#6443)
    • euiCollapsibleNav*
    • euiColorPicker*
    • euiContextMenu*
    • euiControlBar*
    • euiDataGrid* (except for z-indices and cell padding sizes)
    • euiDatePicker*
    • euiSuperDatePicker*
    • euiDragAndDrop*
    • euiEuiEmptyPrompt*
    • euiFilePicker*
    • euiRange*
    • euiHeaderLinks*
    • euiKeyPad*
    • euiMarkdownEditor*
    • euiResizable*
    • euiSelectable*
    • euiSideNav*
    • euiStep*
    • euiSuggest*
    • euiTable* (except for color variables)
    • euiTooltip*
    • euiButtonFontWeight, euiButtonDefaultTransparency, and euiButtonMinWidth
  • If you were importing any of the above removed JSON variables, we strongly recommend using generic color or sizing variables from useEuiTheme() instead. (#6443)

CSS-in-JS conversions

  • Converted EuiRange and EuiDualRange to Emotion; Removed $euiRangeThumbRadius (#6092)
  • Added a new logicalStyles utility that automatically converts all non-logical properties in a style object to their corresponding logical properties (#6426)
  • Added a new logicalShorthandCSS utility that automatically converts margin, padding, and other 4-sided shorthands to their corresponding logical properties (#6429)
  • Added a new logicalBorderRadiusCSS utility that automatically converts border-radius to corresponding logical properties (#6429)

@breehall breehall added release_note:skip Skip the PR/issue when compiling release notes EUI backport:skip This commit does not require backporting v8.7.0 labels Dec 6, 2022
- the styling is significantly different on EuiRangeLevels and any previous tweaks likely should not carry over

- also these classes no longer exist and as such their selectors no longer apply
- now that the component is wrapped in `withEuiTheme`, unfortunately things are extremely messy

- unfortunately converting EuiDualRange to a function component is not necesssarily the answer as these specific use cases then lose access to the `onResize` instance method

+ fix incorrect usage of `rangeRef` in `src/plugins/controls` - the rangeRef was never actually getting passed down and thus never actually calling `onResize` - also `onResize` needs an actual width number
…e in the EuiText class name that required a snapshot update
…e in the EuiText class name that required a snapshots update.

[ScatterPlots] Updated the grayboilder plate and ticks/grid/axis colors within the ML scatterplt matrix wizard to match the EUI darkest shade
@cee-chen
Copy link
Member

@elasticmachine merge upstream

Comment on lines -288 to -290
...(depVarIsRuntimeField || jobTypeChanged || depVarNotIncluded
? { includes: formToUse.includes }
: {}),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

jobTypeChanged was removed here because it caused extra renders of the component that prevented the includedFields table on the Regression job page not to be automatically populated when dependentVariable was selected. This occurred because this condition was detecting a job change when there wasn't one.

@breehall breehall marked this pull request as ready for review December 14, 2022 16:20
@breehall breehall requested review from a team as code owners December 14, 2022 16:20
@breehall breehall requested a review from a team December 14, 2022 16:20
@elasticmachine
Copy link
Contributor

Pinging @elastic/eui-design (EUI)

@botelastic botelastic bot added the Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability label Dec 14, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

Copy link
Contributor

@patrykkopycinski patrykkopycinski left a comment

Choose a reason for hiding this comment

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

Asset management LGTM

Copy link
Contributor

@thomheymann thomheymann left a comment

Choose a reason for hiding this comment

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

security changes LGTM!

Copy link
Contributor

@alisonelizabeth alisonelizabeth left a comment

Choose a reason for hiding this comment

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

Deployment Management changes LGTM

@@ -18,6 +18,7 @@ import {
EuiText,
EuiToolTip,
} from '@elastic/eui';
import type { _SingleRangeChangeEvent } from '@elastic/eui/src/components/form/range/types';
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

@cee-chen cee-chen Dec 14, 2022

Choose a reason for hiding this comment

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

Unfortunately not because of the syntax used. onSigmaChange is using function onSigmaChange() {} as opposed to const onSigmaChange = () => {}, and cannot be typed to a function type (EuiRangeProps['onChange']) the same way as consts can (at least, I couldn't find a way to accomplish this in my google journeys - I'd love to be wrong on this, please tell me if you know of a way to do so!)

I also attempted to use Parameters<EuiRangeProps['onChange']>[0] but unfortunately Typescript couldn't figure that out - I think possibly due to some bizarre combination of reaching into an interface for a key and that key being optional/potentially undefined.

Importing the event type directly was the easiest way I could figure out to update typings without changing your source code, but if you're okay with changing your syntax - sure, we can make that change :)

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

Reviewed this locally, paying special attention to the sliders, and everything looks good! The new design works well. Left a few questions about some of the changes.

min={hasAvailableRange ? rangeSliderMin : undefined}
max={hasAvailableRange ? rangeSliderMax : undefined}
min={hasAvailableRange ? rangeSliderMin : 0}
max={hasAvailableRange ? rangeSliderMax : 100}
Copy link
Contributor

Choose a reason for hiding this comment

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

Tested this by getting the range slider control into a no-data state, and it looks the same as it did before. 👌

@@ -26,9 +27,11 @@ import { rangeSliderReducers } from '../range_slider_reducers';
import { RangeSliderReduxState } from '../types';
import { RangeSliderStrings } from './range_slider_strings';

export const RangeSliderPopover: FC = () => {
// Unfortunately, wrapping EuiDualRange in `withEuiTheme` has created this annoying/verbose typing
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there anything we can do on our side to get rid of these complex types? Maybe a forward ref? Or some other way of getting a handle on the class?

Copy link
Member

@cee-chen cee-chen Dec 14, 2022

Choose a reason for hiding this comment

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

Honestly? Without knowing exactly why you're calling the internal EuiDualRange's internal onResize class method... my recommendation is to not do that 😅 (which removes the need for the ref entirely, and thus the ref typing shenanigans).

If we ever convert EuiRange/EuiDualRange to functional non-class components as a tech debt item, you'd lose access to this API entirely (it's not something we're deliberately exposing or documenting as a consumer API). I did create a regression test to ensure we continued exposing onResize via ref, just for this specific Kibana usage of it, but honestly, we'd prefer y'all not reach for it at all, or figure out what problem it's solving and have us try to solve it in a less technically hacky way.

I don't have the context as to why that original call was added or what it's doing - but it's definitely a code smell that makes me think either this usage of it is trying to do things EuiDualRange is not meant to do, or is super custom and undoing things EuiDualRange does and then re-doing them later (also not great).

Copy link
Contributor

Choose a reason for hiding this comment

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

If I remember correctly, this usage is due to us not being able to use EuiInputPopover, but still wanting to have the popover to be tied to the width of the input. I can't exactly remember why we couldn't use EuiInputPopover though.

I wonder if we would run into any regressions by removing that call entirely? @cqliu1, do you remember why we had to use EuiPopover?

event: ChangeEvent<HTMLInputElement | HTMLSelectElement> | MouseEvent<HTMLButtonElement>
event:
| ChangeEvent<HTMLInputElement | HTMLSelectElement>
| KeyboardEvent<HTMLInputElement>
Copy link
Contributor

Choose a reason for hiding this comment

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

What exactly changed here requiring the addition of the KeyboardEvent type?

Copy link
Member

@cee-chen cee-chen Dec 14, 2022

Choose a reason for hiding this comment

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

A slightly younger and far more naive version of me was looking at the EuiRange types and was like, "keyboard users / keyboard events on the input are also a thing! Let me modify our event types to add that, surely there won't be that many Kibana usages for us to update, right?"

Narrator: There were that many Kibana usages.

So yeah, that change is squarely my fault. The type change didn't really have to happen and was just me going "hm this is probably nice to have" and not realizing it would affect so many downstream Kibana consumers 😭 On the plus side, 6f1dfd2 dried out statically copied types for multiple instances/usages, so for most cases (except this one, where I couldn't extend EuiRangeProps['onChange'] for whatever arcane Typescript reason - see an earlier comment about Parameters<>), this was generally a very small net cleanup.

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

Visualizations changes LGTM, I did a brief testing in Lens and agg based visualizations that use ranges and everything works as expected.

Copy link
Member

@sphilipse sphilipse left a comment

Choose a reason for hiding this comment

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

Enterprise Search changes LGTM

Copy link
Member

@spong spong left a comment

Choose a reason for hiding this comment

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

Checked out, tested locally, and both the AnomalyThresholdSlider and the RiskScoreMapping EuiRange components are functioning as expected within Security Solution. Security Detections changes LGTM! 👍 Thanks @breehall! 🙂

@banderror banderror removed their request for review December 19, 2022 08:38
Copy link
Contributor

@michaelolo24 michaelolo24 left a comment

Choose a reason for hiding this comment

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

Security investigations review! LGTM!

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

ML changes LGTM

@cee-chen
Copy link
Member

@elasticmachine merge upstream

Copy link
Contributor

@opauloh opauloh left a comment

Choose a reason for hiding this comment

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

awp-viz lgtm

- use a more generic version instead
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
infra 1216 1217 +1
visTypeVega 307 308 +1
total +2

Async chunks

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

id before after diff
controls 454.3KB 454.3KB -1.0B
enterpriseSearch 2.0MB 2.0MB +7.0B
infra 1.2MB 1.3MB +5.3KB
inputControlVis 49.9KB 49.9KB +14.0B
ml 3.4MB 3.4MB +53.0B
securitySolution 12.6MB 12.6MB +84.0B
sessionView 385.0KB 384.8KB -174.0B
synthetics 1.3MB 1.3MB -11.0B
visTypeVega 1.8MB 1.8MB +5.3KB
total +10.6KB

Page load bundle

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

id before after diff
kbnUiSharedDeps-css 340.5KB 324.3KB -16.2KB
kbnUiSharedDeps-npmDll 5.2MB 5.3MB +147.1KB
total +130.9KB
Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 61 67 +6
osquery 109 115 +6
securitySolution 439 445 +6
total +20

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 70 76 +6
osquery 110 117 +7
securitySolution 516 522 +6
total +21

History

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

cc @breehall

@jbudz jbudz merged commit 6bdfc48 into main Dec 19, 2022
@jbudz jbudz deleted the eui-71.0.0 branch December 19, 2022 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting EUI release_note:skip Skip the PR/issue when compiling release notes Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.