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 v43.1.1 #120935

Merged
merged 47 commits into from
Dec 20, 2021
Merged

Upgrade EUI to v43.1.1 #120935

merged 47 commits into from
Dec 20, 2021

Conversation

thompsongl
Copy link
Contributor

@thompsongl thompsongl commented Dec 9, 2021

Summary

[email protected][email protected]

  • Date picker UI has been partially redesigned
    • Enable auto refresh prior to changing interval
    • "Show dates" button replaced with click target over the input
    • Start date popover opens automatically when showing range
  • EuiCode and EuiCodeBlock have be refactored to share less code and simplify markup
  • Amsterdam is now the default theme in EUI
    • Kibana had already made this theme change
    • EUI Sass files were moved to new locations
  • Updates CoreThemeProvider to use EuiProvider, which extends EuiThemeProvider
    • Provides reset and global styles
    • Accepts an @emotion/cache configuration for reset and global styles
  • Adds a @emotion/cache configuration for reset and global styles to ensure they load before static CSS
  • Updates various theme-related types and constants to import from EUI
  • showStyleSelector prop was renamed showDisplaySelector in EuiDataGrid

43.1.1

Bug fixes

  • Fixed EuiDataGrid's cell popover overlapping with modals and flyouts (#5461)
  • Fixed an accessibility issue where EuiDatePicker time options did not have unique IDs (#5466)
  • Fixed global and reset styles when using the legacy theme (#5473)
  • Fixed EuiSuperDatePicker not passing isDisabled to EuiAutoRefresh (#5472)

43.1.0

  • Added magnifyWithExclamation icon (#5455)

Bug fixes

  • Reinstated EuiCode and EuiCodeBlock testenv mocking (#5464)

43.0.0

  • Updated the organization of EuiDataGrid's toolbar/grid controls (#5334)
  • Updated EuiDataGrid's full screen mode to use the fullScreenExit icon (#5415)
  • Added left.append and left.prepend to EuiDataGrid's toolbarVisibility.additionalControls prop #5394)
  • Added a row height control to EuiDataGrid's toolbar (#5372)
  • Added onChange callbacks to EuiDataGrid's gridStyle and rowHeightOptions settings (#5424)
  • Added a reset button to EuiDataGrid's display controls (#5428)
  • Added timeRefresh icon (#5383)
  • Added responsive and iconOnly props to EuiSuperUpdateButton (#5383)
  • Added better auto refresh indicator to EuiSuperDatePicker (#5383)
  • Added compressed, width, isQuickSelectOnly props to EuiSuperDatePicker (#5383)
  • Updated showUpdateButton prop with iconOnly option in EuiSuperDatePicker (#5383)
  • Increased default refreshInterval of EuiSuperDatePicker to 1000 (#5383)
  • Remove Show dates button from pretty format of EuiSuperDatePicker in favor of directly opening start date popover (#5383)
  • Added shortHand option to prettyInterval (#5383)
  • Moved rounding switch to popover footer in relative tab of EuiSuperDatePicker (#5383)
  • Simplified EuiRefreshInterval to use a switch to start/stop and other visual touch ups (#5383)
  • Created stand alone EuiAutoRefresh and EuiAutoRefreshButton components (#5383)

Bug fixes

  • Fixed persistent EuiDataGrid full screen <body> class (#5354)
  • Fixed dark mode background color of EuiFormControlLayout prepend and append (#5383)
  • Fixed background color of EuiFormControlLayout when readOnly (#5383)
  • Fixed the name of data-test-subj prop of EuiFormControlLayout (#5383)
  • Fixed global reset styles for plain <button>s (#5452)

Breaking changes

  • Removed toolbarVisibility's showStyleSelector prop of EuiDataGrid in favor of showDisplaySelector, which allows configuration of both grid density and row height (#5372)
  • Changed prop name applyRefreshInterval to onRefreshChange in EuiRefreshInterval (#5383)
  • Increased the size of s-sized EuiLoadingSpinners to match s-sized EuiIcons (#5440)

42.1.0

  • Added first and last page arrow buttons to EuiPagination when compressed=true (#5362)
  • Added support for indeterminate EuiPagination when pageCount=0 (#5362)
  • Moved mobile behavior to a customizable responsive prop to EuiPagination that renders the compressed display (#5362)
  • Added doubleArrowLeft, doubleArrowRight, arrowStart, arrowEnd icons (#5362)

Bug fixes

  • Fixed scrollbars in EuiRange tick labels in Safari (#5427)
  • Fixed an EuiOverlayMask bug where it calls window.document on server side(#5422)
  • Fixed unremoved event listener memory leak in EuiPopover (#5437)
  • Fixed EuiDatePicker not correctly handling the onBlur callback (#5441)
  • Fixed EuiToolTip not correctly handling child onBlur and onFocus callbacks (#5441)

42.0.0

Feature: CSS-in-JS (#5121)

  • Added reset and global styles via CSS-in-JS with @emotion/react/Global
  • Added EuiProvider, a React context provider for theming and global styles
  • Added isDefaultTheme and isLegacyTheme utilities

Breaking changes

  • Added @emotion/react to peerDependencies
  • Amsterdam is now the default theme, deprecated and renamed old theme as "legacy"
  • Re-organized Sass files including where the globals are imported from

41.4.0

  • Added payment glyph to EuiIcon (#5414)
  • Updated EuiCodeBlock's full screen mode to use the fullScreenExit icon (#5421)

Bug fixes

  • Fixed an EuiCodeBlock bug where empty code blocks could be copyable (#5421)
  • Fixed an accessibility issue in EuiAvatar by adding a meaningful role (#5423)

41.3.0

  • Updated color of EuiHorizontalRule when rendered inside EuiToolTip (#5378)

Bug fixes

  • Fixed an EuiDataGrid bug where paginated overflowing data grids could become unscrollable when rowCount changed (#5400)
  • Fixed EuiCode line-wrapping (#5379)
  • Fixed EuiCodeBlock not passing data-test-subj or aria-label to virtualized & full-screen code blocks (#5379)
  • Fixed EuiCodeBlock not closing full-screen mode when the Escape key is pressed (#5379)
  • Fixed virtualized EuiCodeBlocks blanking out when entering & exiting full-screen mode (#5379)
  • Fixed EuiCodeBlock's full-screen mode to use a large font and padding size & added several missing wrapper classes (#5379)
  • Fixed EuiCodeBlock broken line wrapping when using virtualization (#5379)
  • Fixed type exports to not include test mocks & specs (#5412)

Theme: Amsterdam

  • Fixed EuiCodeBlock not properly increasing large font sizes on Amsterdam (#5379)

For maintainers

@thompsongl thompsongl added release_note:skip Skip the PR/issue when compiling release notes EUI v8.1.0 labels Dec 9, 2021
Comment on lines 22 to +23
return {
colorMode: darkMode ? 'DARK' : 'LIGHT',
colorMode: darkMode ? COLOR_MODES_STANDARD.dark : COLOR_MODES_STANDARD.light,
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 thanks for that

* @internal Only meant to be used within core for internal usages of EUI/React
*/
export const CoreThemeProvider: FC<CoreThemeProviderProps> = ({ theme$, children }) => {
const coreTheme = useObservable(theme$, defaultTheme);
const euiTheme = useMemo(() => convertCoreTheme(coreTheme), [coreTheme]);
return (
<EuiThemeProvider colorMode={euiTheme.colorMode} theme={euiTheme.euiThemeSystem}>
<EuiProvider
modify={{ LIGHT: { colors: { primary: '#FF0000' } } }}
Copy link
Contributor

@pgayvallet pgayvallet Dec 16, 2021

Choose a reason for hiding this comment

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

I think declaring a const for this modify value outside of the component is slightly better for memory and rerendering triggers as it would not be recreated at each rerendering + only one instance will be used for all usages of CoreThemeProvider

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for flagging this. This was meant entirely to test the setup and will be removed before merging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will want to expand the API to pass modify to KibanaThemeProvider, but I don't see that as an immediate need.

Comment on lines +26 to +29
const emotionCache = createCache({
key: 'eui-styles',
container: document.querySelector(`meta[name="${EUI_STYLES_GLOBAL}"]`) as HTMLElement,
});
Copy link
Contributor

@pgayvallet pgayvallet Dec 16, 2021

Choose a reason for hiding this comment

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

Hum, shouldn't this also be used in the public version of the EuiProvider wrapper in src/plugins/kibana_react/public/theme/kibana_theme_provider.tsx ? (same for modify)

If that's the case, we'll have to expose this cache from core somehow, so that both version of the wrapper use the same cache instance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only the top-level theme provider needs the cache because it's the only provider that now also provides global styles. Those global styles only need to be included once and are the only styles that require the cache. Eventually, once EUI has converted all components to Emotion, the global style cache will be unnecessary and can be removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, Just to be sure we're on the same page, this CoreThemeProvider component is not used only once.

It is used as a 'top level' provider for chrome's react tree, but is also used for internal core's components, such as toasts, flyout and modal, as all those components are their own distinct react tree / ReactDOM.render call.

Is it still fine?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is fine, thanks for clarifying. My main point was that a nested KibanaThemeProvider does not need to be aware of the cache.

I'll probably have a follow-up PR that ensures no duplication of the global styles from the various toasts, flyout and modal, etc. instances, but there will be no adverse affects in the meantime.

Copy link
Member

@cnasikas cnasikas left a comment

Choose a reason for hiding this comment

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

Security solution changes LGTM!

Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

Data discover code changes LGTM, didn't test for now, but I'm excited that data grid row height selection is now available in Kibana 🥳

Comment on lines +197 to +199
const toggleButtonChecked = await this.testSubjects.getAttribute(
'superDatePickerToggleRefreshButton',
'aria-checked'
Copy link
Contributor

Choose a reason for hiding this comment

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

I <3 this tweak

Copy link
Contributor

@claudiopro claudiopro left a comment

Choose a reason for hiding this comment

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

Observability test changes look good, thanks for the fix.

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

@weltenwort weltenwort self-requested a review December 16, 2021 15:48
Copy link
Contributor

@walterra walterra left a comment

Choose a reason for hiding this comment

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

ML/transform changes LGTM

Copy link
Member

@weltenwort weltenwort left a comment

Choose a reason for hiding this comment

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

no visible breakage in infra and monitoring 👍

Copy link
Contributor

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

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

LGTM for core changes

Copy link
Contributor

@Dosant Dosant left a comment

Choose a reason for hiding this comment

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

App services LGTM
I tested refresh interval in Discover and Dashboard and didn't find any issues

@kertal
Copy link
Member

kertal commented Dec 20, 2021

@elasticmachine merge upstream

@thompsongl
Copy link
Contributor Author

Remaining reviews are for snapshot changes only. Will merge on the next successful CI run.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
core 325 331 +6

Async chunks

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

id before after diff
core 132.5KB 132.5KB +12.0B
discover 316.4KB 316.4KB +2.0B
ml 3.5MB 3.5MB +4.0B
osquery 942.3KB 942.3KB +2.0B
securitySolution 4.6MB 4.6MB -1.0B
timelines 227.0KB 227.0KB +2.0B
visTypeTable 15.7KB 15.7KB +2.0B
total +23.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 277.6KB 290.6KB +13.0KB
data 441.0KB 441.1KB +75.0B
interactiveSetup 58.4KB 58.4KB +42.0B
kbnUiSharedDeps-css 590.8KB 591.5KB +691.0B
kbnUiSharedDeps-npmDll 5.1MB 6.1MB ⚠️ +1.0MB
kbnUiSharedDeps-srcJs 3.8MB 3.8MB -3.0B
kibanaReact 58.5KB 58.6KB +42.0B
total ⚠️ +1.0MB

History

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

@thompsongl thompsongl merged commit 604409b into elastic:main Dec 20, 2021
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Dec 20, 2021
mibragimov pushed a commit to mibragimov/kibana that referenced this pull request Dec 22, 2021
* eui to v43.0.0

* update themeprovider types

* update sass import location

* storyshots

* snapshots

* jest

* jest

* timepicker functional test helpers

* snapshots

* timepicker functional test helpers

* invert checked logic

* fix i18n token

* snapshots

* handle new refresh interval operations order

* refactor refresh interval logic, test

* jest

* timepicker popover order

* eui to v43.1.0

* jest

* jest

* jest

* euicode selector

* jest

* functional tests

* functional tests

* timepicker

* bump timeout

* conditional click to close

* clean up

* eui to v43.1.1

* clean up

* loading background

Co-authored-by: Kibana Machine <[email protected]>
thompsongl added a commit to thompsongl/kibana that referenced this pull request Jan 4, 2022
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.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.