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

Upgrade EUI to v60.0.0 #134919

Merged
merged 19 commits into from
Jun 28, 2022
Merged

Upgrade EUI to v60.0.0 #134919

merged 19 commits into from
Jun 28, 2022

Conversation

cee-chen
Copy link
Contributor

@cee-chen cee-chen commented Jun 22, 2022

Summary

[email protected][email protected]

  • In this PR, we've added an Emotion snapshot serializer change that changes the dynamic css-{hash} emotion className prefixes to a static emotion-. The long-term goal of this is to reduce thrashing on downstream Kibana snapshots whenever EUI CSS changes.

  • Added .render() calls to snapshot tests are intended to reduce the output of EUI components that use Emotion for styling. If you prefer the more verbose snapshot output in your plugin, we can remove the call.

  • Emotion cache & meta/style tag details

    There are two types of styling conflict issues in Kibana that this PR fixes:

    • Emotion styles in Kibana targeting/overriding EUI components using Sass
    • Sass styles in Kibana targeting EUI components using Emotion

    Depending on selector specificity, the incorrect styles could be applied because of style tag source order. To solve this, EUI implements a way to better handle style tag injection which allows for the following ordering:

    1. EUI global styles
    2. EUI compiled Sass
    3. Emotion styles (both EUI and Kibana)
    4. Kibana compiled Sass

    This commit has the changes to Kibana to make this happen. The gist is that we need to target another tag in the and a second Emotion cache to bundle styles together. EUI takes care of the rest.

    This is only necessary while EUI is in transition to Emotion and we have to manage two types of styling.


60.0.0

  • Added configuration options to EuiProvider.cache to enable more granular style insertion (#5853)
  • Added a utility classes component (#5853)
  • Added utility classes configuration options to EuiProvider (#5853)
  • Added gutterSize prop to EuiTimeline (#5955)
  • Added optional onActiveOptionChange callback to EuiSelectable (#5978)

Bug fixes

  • Fixed bug in EuiTimelineItem where the vertical line was not showing on the last item when verticalAlign was set to center (#5955)
  • Fixed bug in logicalCSS() where the left and right logicalPositions were wrong (#5955)
  • Fixed a maximum call stack error in EuiComboBox when an option group contains hundreds of thousands of options (#5976)

Breaking changes

  • Removed component prop from EuiTimelineItem, which now defaults to li. Consequently, a EuiTimeline (ol) is required to wrap the timeline items (#5955)

CSS-in-JS conversions

  • Converted EuiStat to Emotion (#5968)

59.1.0

  • Added new color prop to EuiLoadingSpinner (#5878)
  • Added the overrideLinkBehavior prop to EuiSkipLink for applications that use hash routers (#5957)

Bug fixes

  • Fixed EuiSelectableMessage flex layout when containing multiple children nodes (#5966)
  • Fixed export location of JS based shadow mixins (#5970)

CSS-in-JS

  • Converted EuiFacetGroup and EuiFacetButton to Emotion and removed $euiFacetGutterSizes (#5878)

Closes #134908

@cee-chen cee-chen added release_note:skip Skip the PR/issue when compiling release notes EUI backport:skip This commit does not require backporting ci:deploy-cloud v8.4.0 labels Jun 22, 2022
@cee-chen cee-chen force-pushed the eui-60.0.0 branch 9 times, most recently from b75a6a5 to 6e3500b Compare June 23, 2022 02:35
cee-chen and others added 7 commits June 22, 2022 22:52
…n-` prefix instead of a dynamic hash

- The goal of this is to reduce thrashing on downstream Kibana snapshots whenever EUI CSS changes

+ Add serializer to Canvas' storyshots tests as well

+ Switch several .html() snapshots to .render() - render uses the new serializer logic, but .html() does not and will still output CSS hashes, plus is more difficult to read
@cee-chen cee-chen marked this pull request as ready for review June 23, 2022 15:32
@cee-chen cee-chen requested a review from a team June 23, 2022 15:32
@cee-chen cee-chen requested review from a team as code owners June 23, 2022 15:32
@cee-chen cee-chen requested a review from a team June 23, 2022 15:32
@cee-chen cee-chen requested review from a team as code owners June 23, 2022 15:32
Copy link
Contributor

@fkanout fkanout left a comment

Choose a reason for hiding this comment

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

Actionable Observability changes LGTM.

Copy link
Contributor

@ogupte ogupte left a comment

Choose a reason for hiding this comment

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

APM changes LGTM!

Copy link
Contributor

@justinkambic justinkambic left a comment

Choose a reason for hiding this comment

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

Uptime changes LGTM

- the Cypress query/command being used wasn't working correctly
Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@paul-tavares paul-tavares left a comment

Choose a reason for hiding this comment

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

👍 on behalf of Security Solution Onboarding and Lifecycle Management team

Copy link
Member

@azasypkin azasypkin left a comment

Choose a reason for hiding this comment

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

Security and Interactive Setup changes LGTM.

Copy link
Contributor

@Kerry350 Kerry350 left a comment

Choose a reason for hiding this comment

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

Monitoring changes LGTM

@cee-chen cee-chen enabled auto-merge (squash) June 28, 2022 15:18
@cee-chen
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Security Solution Tests #3 / Inspect Network stats and tables "before all" hook for "inspects the Source IPs Table"

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
core 354 349 -5
dashboard 421 416 -5
dataViewManagement 212 207 -5
discover 593 588 -5
kibanaOverview 175 170 -5
lens 922 917 -5
visualizations 373 368 -5
total -35

Async chunks

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

id before after diff
core 136.3KB 136.3KB -11.0B
dashboard 392.7KB 380.7KB -12.1KB
dataViewManagement 192.9KB 180.8KB -12.1KB
discover 491.2KB 491.1KB -15.0B
kibanaOverview 95.9KB 83.8KB -12.1KB
kibanaReact 209.6KB 209.6KB +2.0B
kibanaUtils 51.6KB 51.6KB +1.0B
lens 1.2MB 1.2MB -12.1KB
visualizations 254.6KB 242.6KB -12.1KB
total -60.4KB

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 4955 4967 +12
total size 7.7MB 7.7MB +583.0B

Page load bundle

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

id before after diff
core 310.5KB 298.7KB -11.9KB
dashboard 65.9KB 65.9KB +56.0B
dataViewManagement 4.5KB 4.6KB +56.0B
discover 40.7KB 28.7KB -12.0KB
interactiveSetup 58.3KB 58.6KB +312.0B
kbnUiSharedDeps-css 547.7KB 543.5KB -4.2KB
kbnUiSharedDeps-npmDll 5.0MB 5.0MB +13.6KB
kbnUiSharedDeps-srcJs 3.8MB 3.8MB +93.0B
kibanaOverview 15.4KB 15.5KB +56.0B
kibanaReact 62.2KB 62.5KB +310.0B
kibanaUtils 65.4KB 65.7KB +312.0B
lens 32.9KB 32.9KB +56.0B
visualizations 47.0KB 47.0KB +56.0B
total -13.2KB

History

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

@cee-chen cee-chen merged commit de20876 into elastic:main Jun 28, 2022
@cee-chen cee-chen deleted the eui-60.0.0 branch June 28, 2022 18:24
@tylersmalley tylersmalley added ci:cloud-deploy Create or update a Cloud deployment and removed ci:deploy-cloud labels Aug 17, 2022
cee-chen added a commit that referenced this pull request Jul 13, 2023
## Summary

fixes #161441
fixes #161464

The recent `EuiButtonEmpty`/`EuiButtonIcon` Emotion conversions have
highlighted a CSS order/specificity flaw in Kibana compared to EUI - EUI
orders its Sass _after_ its Emotion styles (see
https://elastic.github.io/eui/#/), and Kibana orders Sass _before_
Emotion styles.

I'm not totally sure why Greg set up Kibana's style order the way he did
in #134919, but at this point, EUI
has enough of its baseline atom components converted to Emotion that
remaining components in Sass are all generally molecules or higher level
components that need to come after Emotion.

### QA

- [x] Test as many pages in Kibana as possible to ensure no visual
regressions 🤞

---------

Co-authored-by: Kibana Machine <[email protected]>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 13, 2023
## Summary

fixes elastic#161441
fixes elastic#161464

The recent `EuiButtonEmpty`/`EuiButtonIcon` Emotion conversions have
highlighted a CSS order/specificity flaw in Kibana compared to EUI - EUI
orders its Sass _after_ its Emotion styles (see
https://elastic.github.io/eui/#/), and Kibana orders Sass _before_
Emotion styles.

I'm not totally sure why Greg set up Kibana's style order the way he did
in elastic#134919, but at this point, EUI
has enough of its baseline atom components converted to Emotion that
remaining components in Sass are all generally molecules or higher level
components that need to come after Emotion.

### QA

- [x] Test as many pages in Kibana as possible to ensure no visual
regressions 🤞

---------

Co-authored-by: Kibana Machine <[email protected]>
(cherry picked from commit b9eae62)
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 ci:cloud-deploy Create or update a Cloud deployment EUI Feature:Embedding Embedding content via iFrame release_note:skip Skip the PR/issue when compiling release notes Team:APM - DEPRECATED Use Team:obs-ux-infra_services. Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Global search] No results view does not render correctly