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 v63.0.6 - updates to new EuiPageTemplate and deprecates old page components #139524

Merged
merged 60 commits into from
Sep 7, 2022

Conversation

cee-chen
Copy link
Member

@cee-chen cee-chen commented Aug 25, 2022

Summary

eui@62.2.4eui@63.0.6


63.0.163.0.6
Patch releases containing bugfixes for EuiPageTemplate and release fixes already present in the previous EUI PR

63.0.6

  • Added a new component prop to EuiPageSection, allowing overriding of the default section tag (#6192)

Deprecations

  • Added @deprecated flags to EuiPageContent_Deprecated, EuiPageContentBody_Deprecated, EuiPageContentHeader_Deprecated, EuiPageContentHeaderSection_Deprecated, EuiPageSideBar_Deprecated and EuiPageTemplate_Deprecated, which will provide helpful hints to IDEs that support jsdoc flags. Consumers will have until August 2023 to migrate from these deprecated components. (#6194)

63.0.5

Bug fixes

  • Fixed missing data-fixed-headers property in some layout configurations using EuiPageTemplate. (#6140)
  • Fixed an EuiPageSidebar bug where inline styles were not correctly updating (#6191)

63.0.4

Bug fixes

  • Fixed the text size of EuiDescriptionListTitle when EuiDescriptionList is compressed (#6160)

63.0.3

Bug fixes

  • Fixed CollapsedItemActions ref callback not accounting for null value (#6145)

63.0.2

Bug fixes

  • Fixed eui.d.ts containing @testing-library type definitions (#6142)

63.0.1

Bug fixes

  • Fixed server-side rendering and test-env errors caused by useCurrentEuiBreakpoint (#6117)
63.0.0 - Main EuiPageTemplate release changelog

63.0.0

  • Added new EuiPageTemplate namespaced component that uses context to pass through props (#5768)
  • Added EuiPageSection component for easier section stacking (#5768)
  • Added EuiPageSidebar component that is an upgrade to EuiPageSideBar (#5768)
  • Extended bottomBorder prop to add 'extended' on EuiPageHeader (#5768)
  • Added paddingSize and restrictWidth directly on EuiPageHeaderContent (#5768)
  • Added data-fixed-headers attribute to <body> with the count of fixed EuiHeader components (#5768)
  • Extended usePortal prop on EuiBottomBar to accept EuiPortalProps (#5768)
  • Increased paddingSize support by EuiPage for xl and xs sizes (#5768)
  • Moved restrictWidth default true style to style attribute on EuiPage and EuiPageBody (#5768)
  • Added optional height parameter to euiYScroll(), useEuiYScroll, euiYScrollWithShadows(), and useEuiYScrollWithShadows (#5768)
  • Added repositionOnScroll directly to EuiPopover rendered by mobile version of EuiHeaderLinks (#5768)

Bug fixes

  • Fixed missing render of breadcrumbs on EuiPageHeader when alignItems = 'top' (#5768)
  • Fixed logicalStyle() to return the same value type as was passed in (instead of converting to string) (#5768)

Deprecations

  • Deprecated the old EuiPageTemplate component and renamed to EuiPageTemplate_Deprecated (#5768)
  • Deprecated EuiPageContent and EuiPageContentBody in favor of new EuiPageSection (#5768)
  • Deprecated EuiPageContent and renamed to EuiPageContent_Deprecated (#5768)
  • Deprecated EuiPageContentBody and renamed to EuiPageContentBody_Deprecated (#5768)
  • Deprecated EuiPageContentHeader and renamed to EuiPageContentHeader_Deprecated (#5768)
  • Deprecated EuiPageContentHeaderSection and renamed to EuiPageContentHeaderSection_Deprecated (#5768)
  • Deprecated EuiPageSideBar and renamed to EuiPageSideBar_Deprecated (#5768)

Breaking changes

  • Removed nested EuiPageHeader styles when a child of EuiPageBody (#5768)
  • Changed default paddingSize of EuiPage from m to none (#5768)

CSS-in-JS conversion

  • Converted EuiPage and EuiPageBody to Emotion (#5768)
  • Converted EuiPageHeader and EuiPageHeaderContent to Emotion (#5768)
  • Removed euiPageRestrictWidth() Sass mixin (#5768)

EuiPageTemplate

This component has been replaced (in EUI) with a new flexible namespaced component that utilizes React context to pass through top level props and a new sectioning component that makes it easier to stack page contents including headers in any order.

👉 New component docs: https://elastic.github.io/eui/#/templates/page-template
👉 EUI PR with details: elastic/eui#5768
👉 Guidelines: https://elastic.github.io/eui/#/templates/page-template/guidelines

In addition, the latest update deprecates a lot of (now defunct) page components like EuiPageContent and renames then with _Deprecated. This will hopefully alert owners that they should be switching to the latest template paradigm.

Tasks performed

✅ Updated deprecated page component imports

Example:

import {
-  EuiPageContent,
-  EuiPageContentBody,
+  EuiPageContent_Deprecated as EuiPageContent,
+  EuiPageContentBody_Deprecated as EuiPageContentBody,
} from '@elastic/eui';

✅ Updated the @kbn/shared-ux-page-kibana-template version of KibanaPageTemplate

This is mostly done and even re-exports the namespaced components so that consumers in Kibana don't have to mis-match Kibana vs EUI prefixed components.

export const KibanaPageTemplate = Object.assign(_KibanaPageTemplate, {
Sidebar: EuiPageTemplate.Sidebar,
Header: EuiPageTemplate.Header,
Section: EuiPageTemplate.Section,
BottomBar: EuiPageTemplate.BottomBar,
EmptyPrompt: EuiPageTemplate.EmptyPrompt,
});

✅ Updated the tutorial documentation page

New version found here: https://github.com/elastic/kibana/blob/2829dea45c970ef21188e399c4004ca40a02dca9/dev_docs/tutorials/kibana_page_template.mdx

✅ Fixed current usages of the Shared-UX KibanaPageTemplate

Only those consuming KibanaPageTemplate from @kbn/shared-ux-page-kibana-template have been fixed / updated to the new paradigm.

✅ Converted a few examples from old template to new

For changes affected by 9812251, see Caroline's comment review in her original PR: #138546 (review)

✅ Updated snapshots and FTR tests

The snapshots and tests caught some amount of bugs, but can't catch every possible UI bug or regression. Please take the time to manually QA/regression test your app.

🚨 Affected apps/teams 🚨

If your app/solution is in the below list list, it was affected by the new EuiPageTemplate/KibanaPageTemplate updates. Please take the time to manually QA/UI regression test your app.

  • Observability Solution
  • Security Solution
  • Enterprise Search Solution
  • Kibana Overview plugin
  • Home plugin
  • Management plugin
  • Security plugin - API keys

⚠️ Teams that should eventually migrate from deprecated components ⚠️

Apps importing KibanaPageTemplate from @kbn/kibana-react-plugin/public are using the old/deprecated EuiPageTemplate and should convert to the KibanaPageTemplate from @kbn/shared-ux-page-kibana-template as soon as possible. This applies to the following apps:

  • Canvas plugin
  • ML plugin
  • OSQuery plugin
  • Spaces plugin - spaces selector

Teams that were directly using the now-deprecated EuiPageTemplate/EuiPageContent components (as noted by an _Deprecated import from EUI) should generally convert to using KibanaPageTemplate, or at minimum the new non-deprecated EuiPage* equivalents. There are too many applications to list of these usages (222 files total), so we cannot call these teams out individually, but please consider doing a grep for _Deprecated as in your team codebase to check for them and start planning to migrate over.

The deprecated page components will be removed by August 2023.

@cee-chen cee-chen force-pushed the test/page_template branch 13 times, most recently from 9f94033 to fb7ecee Compare August 31, 2022 05:12
@cee-chen cee-chen changed the title [WIP] Test CI Upgrade EUI to v63.0.6 - updates to new EuiPageTemplate and deprecates old page components Aug 31, 2022
@cee-chen cee-chen added EUI v8.5.0 release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting labels Aug 31, 2022
@cee-chen
Copy link
Member Author

cee-chen commented Sep 6, 2022

@elasticmachine merge upstream

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

Did a quick smoke test of Management apps and didn't notice anything weird.

Copy link
Contributor

@matschaffer matschaffer left a comment

Choose a reason for hiding this comment

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

LGTM - I opened #140149 for @elastic/infra-monitoring-ui to clean up.

Is there a specific migration guide? If so can you point it out? I didn't see anything that looked quite like a step by step from old to new. Would be helpful to have specific instructions I think.

Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

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

Fleet change LGTM

@sphilipse
Copy link
Member

Enterprise Search lgtm

@@ -226,7 +226,9 @@ describe('Service Overview', () => {
'suggestionsRequest'
);

cy.get('[data-test-subj="environmentFilter"]').type('production');
cy.get('[data-test-subj="environmentFilter"] input').type('production', {
Copy link
Contributor

@gbamparop gbamparop Sep 7, 2022

Choose a reason for hiding this comment

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

Is this change needed? If the test is flaky we could raise an issue to fix it.

Copy link
Member Author

@cee-chen cee-chen Sep 7, 2022

Choose a reason for hiding this comment

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

The APM Cypress tests failed 4 times in a row without it, which technically I can ask KibanaOps to skip the tests for us, but the failure looked solvable and the fix looked reasonable so I figured I'd add it in. The test is flaky, but I think this resolves that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, thanks for doing that!

Copy link
Contributor

@yuliacech yuliacech left a comment

Choose a reason for hiding this comment

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

Thanks a lot for working on this EUI update @constancecchen!
Platform Onboarding changes LGTM, tested locally 👍

@cee-chen
Copy link
Member Author

cee-chen commented Sep 7, 2022

LGTM - I opened #140149 for https://github.com/orgs/elastic/teams/infra-monitoring-ui to clean up.
Is there a specific migration guide? If so can you point it out? I didn't see anything that looked quite like a step by step from old to new. Would be helpful to have specific instructions I think.

Thanks a million @matschaffer! There's not a step-by-step migration guide for the old EuiPageTemplate_Deprecated to EuiPageTemplate but there are some helpful guidelines here: https://elastic.github.io/eui/#/templates/page-template/guidelines

For the other granular components, the migration looks like:

  • EuiPageContent_Deprecated / EuiPageContentBody_Deprecated -> use EuiPageSection instead
  • EuiPageContentHeader_Deprecated / EuiPageContentHeaderSection_Deprecated -> use EuiPageHeader instead
  • EuiPageSideBar_Deprecated -> use the new EuiPageSidebar

Please feel free to ping me or the EUI team either in Slack or in your issue for assistance, we'd be super happy to help.

Copy link
Contributor

@gbamparop gbamparop 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!

@cee-chen
Copy link
Member Author

cee-chen commented Sep 7, 2022

@elastic/kibana-design @elastic/uptime @dasansol92

As a heads up, since the major affected solutions/plugins have approved this PR at this point, I'll be asking KibanaOps to admin merge this PR by EOD today. Please do take a look / speak up if you see any issues!

Copy link
Contributor

@dominiqueclarke dominiqueclarke 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

@cee-chen
Copy link
Member Author

cee-chen commented Sep 7, 2022

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

kibana-ci commented Sep 7, 2022

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Security Solution Tests #2 / Exceptions flyout flyout errors When updating an item for a list that has since been deleted Displays missing exception list error
  • [job] [logs] Security Solution Tests #2 / Exceptions flyout flyout errors When updating an item with version conflict Displays version conflict error
  • [job] [logs] FTR Configs #27 / ObservabilityApp Observability alerts Alerts table Flyout Can be opened

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
esUiShared 162 220 +58
infra 953 1011 +58
management 30 88 +58
security 420 465 +45
total +219

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/shared-ux-page-kibana-template 4 2 -2

Async chunks

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

id before after diff
aiops 479.6KB 479.7KB +33.0B
apm 3.0MB 3.0MB +11.0B
console 398.0KB 398.0KB +22.0B
crossClusterReplication 165.4KB 165.5KB +154.0B
dashboard 369.4KB 369.1KB -320.0B
dataViewManagement 145.8KB 145.8KB +44.0B
dataVisualizer 565.8KB 565.8KB +77.0B
discover 463.4KB 463.1KB -284.0B
enterpriseSearch 1.6MB 1.6MB +17.0B
fleet 865.8KB 865.8KB +22.0B
grokdebugger 59.1KB 59.1KB +44.0B
home 146.8KB 146.9KB +101.0B
indexLifecycleManagement 152.8KB 152.8KB +55.0B
indexManagement 522.7KB 522.7KB +88.0B
infra 993.8KB 1016.2KB +22.4KB
ingestPipelines 430.8KB 430.8KB +88.0B
kibanaOverview 46.3KB 46.1KB -205.0B
lens 1.2MB 1.2MB -286.0B
licenseManagement 63.3KB 63.4KB +66.0B
logstash 30.6KB 30.6KB +22.0B
management 8.5KB 30.4KB +21.9KB
ml 3.3MB 3.3MB +110.0B
monitoring 478.5KB 478.8KB +384.0B
observability 522.9KB 523.0KB +84.0B
osquery 1.0MB 1.0MB +11.0B
remoteClusters 84.0KB 84.1KB +77.0B
rollup 131.2KB 131.2KB +55.0B
searchprofiler 160.9KB 160.9KB +22.0B
security 512.7KB 536.1KB +23.3KB
securitySolution 6.4MB 6.4MB +13.0B
share 2.4KB 2.4KB +22.0B
snapshotRestore 266.6KB 266.7KB +143.0B
spaces 152.7KB 152.8KB +44.0B
synthetics 983.8KB 983.8KB -36.0B
transform 387.1KB 387.2KB +77.0B
triggersActionsUi 1.0MB 1.0MB +11.0B
upgradeAssistant 179.6KB 179.7KB +132.0B
ux 164.2KB 164.2KB +27.0B
visualizations 197.8KB 197.5KB -317.0B
watcher 273.4KB 273.5KB +121.0B
total +68.4KB

Page load bundle

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

id before after diff
core 359.2KB 361.0KB +1.8KB
esUiShared 130.5KB 152.6KB +22.1KB
infra 84.4KB 84.5KB +56.0B
kbnUiSharedDeps-css 451.0KB 443.9KB -7.1KB
kbnUiSharedDeps-npmDll 5.0MB 5.0MB +18.1KB
kibanaReact 63.0KB 63.0KB +58.0B
management 9.7KB 9.8KB +49.0B
screenshotting 7.6KB 7.6KB +22.0B
security 52.0KB 52.2KB +213.0B
securitySolution 260.3KB 259.9KB -407.0B
threatIntelligence 11.2KB 11.2KB -23.0B
total +34.8KB
Unknown metric groups

API count

id before after diff
@kbn/shared-ux-page-kibana-template 10 11 +1

ESLint disabled in files

id before after diff
enterpriseSearch 0 1 +1

miscellaneous assets size

id before after diff
esUiShared 0.0B 161.8KB +161.8KB
infra 412.2KB 574.0KB +161.8KB
management 0.0B 161.8KB +161.8KB
security 0.0B 161.8KB +161.8KB
total +647.1KB

References to deprecated APIs

id before after diff
home 14 11 -3
management 6 1 -5
total -8

Total ESLint disabled count

id before after diff
enterpriseSearch 13 14 +1

Unreferenced deprecated APIs

id before after diff
kibanaReact 0 1 +1

History

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

@jbudz
Copy link
Member

jbudz commented Sep 7, 2022

Merging - the osquery failures seem to be unrelated, caused by elastic-agent setup failures followed by missing index patterns.

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:APM All issues that need APM UI Team support Team:Fleet Team label for Observability Data Collection Fleet team Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.