-
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
Make Borealis the default theme in non-serverless #203840
Make Borealis the default theme in non-serverless #203840
Conversation
b91bf8f
to
fadf076
Compare
## Summary This PR migrates style overrides within core from SCSS to leverage emotion. Why is this necessary? Kibana builds it's stylesheets we get 4 stylesheets for all the supported themes, in which in turn impacts the files built. Switching to leveraging emotion makes it such that we don't need to build 4 files anymore for this particular cases in turn reducing the page load bundle size. This PR results in ~12% reduction in the page load bundle, that would have come into effect from [the PR](#203840) that introduces the new Borealis theme as a default. The results can be seen in [this build](https://buildkite.com/elastic/kibana-pull-request/builds/260881) <!-- ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
dbf49f8
to
b76b674
Compare
## Summary This PR migrates style overrides within core from SCSS to leverage emotion. Why is this necessary? Kibana builds it's stylesheets we get 4 stylesheets for all the supported themes, in which in turn impacts the files built. Switching to leveraging emotion makes it such that we don't need to build 4 files anymore for this particular cases in turn reducing the page load bundle size. This PR results in ~12% reduction in the page load bundle, that would have come into effect from [the PR](elastic#203840) that introduces the new Borealis theme as a default. The results can be seen in [this build](https://buildkite.com/elastic/kibana-pull-request/builds/260881) <!-- ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
d122ac7
to
a328476
Compare
Pinging @elastic/eui-team (EUI) |
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.
Kibana Security changes LGTM
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.
x-pack/test/functional/apps/infra/home_page.ts
changes LGTM
a328476
to
0a2e6fe
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.
Change LGTM, tested locally and works great.
{ key: '5,722.775 - 8,529.22', name: '5,722.775 - 8,529.22', color: '#599dff' }, | ||
{ key: '8,529.22 - 11,335.665', name: '8,529.22 - 11,335.665', color: '#c5deff' }, | ||
{ key: '11,335.665 - 14,142.11', name: '11,335.665 - 14,142.11', color: '#f6f9fc' }, | ||
{ key: '14,142.11 - 16,948.555', name: '14,142.11 - 16,948.555', color: '#ffcbc5' }, | ||
{ key: '≥ 16,948.555', name: '≥ 16,948.555', color: '#f66d64' }, |
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.
In general, not in this PR obviously, we should encourage asserting colors based on token instead of hardcoded strings.
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.
We have an ESLint rule for this, but it may not be enabled in tests. @eYo?
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.
That's true. I have a spike to research this exact thing later today and plan its implementation 👍
It's going to be hugely useful when backporting to 8.x
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.
Presentation functional test changes LGTM 👍
…en no custom input is provided
…erless dev and prod builds
a1fb80b
to
8582a46
Compare
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
cc @tkajtoch |
## Summary This PR migrates style overrides within core from SCSS to leverage emotion. Why is this necessary? Kibana builds it's stylesheets we get 4 stylesheets for all the supported themes, in which in turn impacts the files built. Switching to leveraging emotion makes it such that we don't need to build 4 files anymore for this particular cases in turn reducing the page load bundle size. This PR results in ~12% reduction in the page load bundle, that would have come into effect from [the PR](elastic#203840) that introduces the new Borealis theme as a default. The results can be seen in [this build](https://buildkite.com/elastic/kibana-pull-request/builds/260881) <!-- ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary This PR migrates style overrides within core from SCSS to leverage emotion. Why is this necessary? Kibana builds it's stylesheets we get 4 stylesheets for all the supported themes, in which in turn impacts the files built. Switching to leveraging emotion makes it such that we don't need to build 4 files anymore for this particular cases in turn reducing the page load bundle size. This PR results in ~12% reduction in the page load bundle, that would have come into effect from [the PR](elastic#203840) that introduces the new Borealis theme as a default. The results can be seen in [this build](https://buildkite.com/elastic/kibana-pull-request/builds/260881) <!-- ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
This PR enables Borealis in dev mode and the theme switcher in non-serverless dev and prod environments, allowing users to switch between Amsterdam and Borealis as they like. This makes for easier testing of Borealis using cloud PR deployments thanks to the added theme toggle.
We acknowledge this PR has increased the bundle size. This is caused by the added
borealislight
andborealisdark
theme tags, resulting in imported SCSS files being built and bundled for 4 theme tags instead of 2. This is necessary to provide runtime-level theme switching and to keep the distributable the same for traditional and serverless kibana flavors. The Shared UX team is concurrently working on reducing the number of SCSS files, mainly by migrating SCSS styles to Emotion, which will decrease the size increase overall. Additionally, the bundle size increase is temporary until we release Borealis on Serverless, which will coincide with 9.0 Beta 1.Theme updates
Non-serverless: running on Borealis by default; theme switcher is available in Advanced settings and allows to toggle between Amsterdam and Borealis. Theme switcher will stay available until right before 9.0 FF.
Serverless: running on Amsterdam by default; theme switcher is not available