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

[ML] Data Visualizer: Optimize initial load bundles. #199029

Merged
merged 4 commits into from
Nov 11, 2024

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Nov 5, 2024

Summary

Part of #194171.

The dataVisualizer plugin loads quite some bundle chunks on the first Kibana load. On main it currently looks like this on page load:

CleanShot 2024-11-05 at 17 51 35@2x

This PR refactors how embeddables and UI actions get initialized to avoid loading any additional async bundles on page load.

CleanShot 2024-11-06 at 10 51 36@2x

Checklist

@walterra walterra self-assigned this Nov 5, 2024
@walterra walterra marked this pull request as ready for review November 6, 2024 09:40
@walterra walterra requested review from a team as code owners November 6, 2024 09:40
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@walterra walterra added release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels labels Nov 6, 2024
@walterra walterra requested review from qn895 and rbrtj November 6, 2024 09:43
Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

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

LGTM

@qn895
Copy link
Member

qn895 commented Nov 11, 2024

LGTM 🎉

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
dataVisualizer 615.9KB 630.1KB +14.2KB

Page load bundle

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

id before after diff
dataVisualizer 24.6KB 27.1KB +2.5KB
Unknown metric groups

async chunk count

id before after diff
dataVisualizer 19 24 +5

History

cc @walterra

@walterra walterra merged commit aa4f430 into elastic:main Nov 11, 2024
21 checks passed
@walterra walterra deleted the ml-data-visualizer-optimize-bundles branch November 11, 2024 15:38
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11781637408

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 11, 2024
## Summary

Part of elastic#194171.

The `dataVisualizer` plugin loads quite some bundle chunks on the first
Kibana load. On `main` it currently looks like this on page load:

![CleanShot 2024-11-05 at 17 51
35@2x](https://github.com/user-attachments/assets/7b2fcc7e-08fb-48b8-a1d9-03063b555e38)

This PR refactors how embeddables and UI actions get initialized to
avoid loading any additional async bundles on page load.

![CleanShot 2024-11-06 at 10 51
36@2x](https://github.com/user-attachments/assets/019c3c79-49b5-4e63-9b94-3d7b02963a9b)

### Checklist

- [ ] [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)

(cherry picked from commit aa4f430)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 11, 2024
…199663)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ML] Data Visualizer: Optimize initial load bundles.
(#199029)](#199029)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Walter
Rafelsberger","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-11T15:38:01Z","message":"[ML]
Data Visualizer: Optimize initial load bundles. (#199029)\n\n##
Summary\r\n\r\nPart of
https://github.com/elastic/kibana/issues/194171.\r\n\r\nThe
`dataVisualizer` plugin loads quite some bundle chunks on the
first\r\nKibana load. On `main` it currently looks like this on page
load:\r\n\r\n![CleanShot 2024-11-05 at 17
51\r\n35@2x](https://github.com/user-attachments/assets/7b2fcc7e-08fb-48b8-a1d9-03063b555e38)\r\n\r\nThis
PR refactors how embeddables and UI actions get initialized to\r\navoid
loading any additional async bundles on page load.\r\n\r\n![CleanShot
2024-11-06 at 10
51\r\n36@2x](https://github.com/user-attachments/assets/019c3c79-49b5-4e63-9b94-3d7b02963a9b)\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [x] This was checked for breaking
API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)","sha":"aa4f430ed59694b7f8c3d5b318c76e6aef95331e","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","release_note:skip","Feature:File
and Index Data Viz","v9.0.0","backport:version","v8.17.0"],"title":"[ML]
Data Visualizer: Optimize initial load
bundles.","number":199029,"url":"https://github.com/elastic/kibana/pull/199029","mergeCommit":{"message":"[ML]
Data Visualizer: Optimize initial load bundles. (#199029)\n\n##
Summary\r\n\r\nPart of
https://github.com/elastic/kibana/issues/194171.\r\n\r\nThe
`dataVisualizer` plugin loads quite some bundle chunks on the
first\r\nKibana load. On `main` it currently looks like this on page
load:\r\n\r\n![CleanShot 2024-11-05 at 17
51\r\n35@2x](https://github.com/user-attachments/assets/7b2fcc7e-08fb-48b8-a1d9-03063b555e38)\r\n\r\nThis
PR refactors how embeddables and UI actions get initialized to\r\navoid
loading any additional async bundles on page load.\r\n\r\n![CleanShot
2024-11-06 at 10
51\r\n36@2x](https://github.com/user-attachments/assets/019c3c79-49b5-4e63-9b94-3d7b02963a9b)\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [x] This was checked for breaking
API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)","sha":"aa4f430ed59694b7f8c3d5b318c76e6aef95331e"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199029","number":199029,"mergeCommit":{"message":"[ML]
Data Visualizer: Optimize initial load bundles. (#199029)\n\n##
Summary\r\n\r\nPart of
https://github.com/elastic/kibana/issues/194171.\r\n\r\nThe
`dataVisualizer` plugin loads quite some bundle chunks on the
first\r\nKibana load. On `main` it currently looks like this on page
load:\r\n\r\n![CleanShot 2024-11-05 at 17
51\r\n35@2x](https://github.com/user-attachments/assets/7b2fcc7e-08fb-48b8-a1d9-03063b555e38)\r\n\r\nThis
PR refactors how embeddables and UI actions get initialized to\r\navoid
loading any additional async bundles on page load.\r\n\r\n![CleanShot
2024-11-06 at 10
51\r\n36@2x](https://github.com/user-attachments/assets/019c3c79-49b5-4e63-9b94-3d7b02963a9b)\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [x] This was checked for breaking
API changes and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)","sha":"aa4f430ed59694b7f8c3d5b318c76e6aef95331e"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Walter Rafelsberger <[email protected]>
tkajtoch pushed a commit to tkajtoch/kibana that referenced this pull request Nov 12, 2024
## Summary

Part of elastic#194171.

The `dataVisualizer` plugin loads quite some bundle chunks on the first
Kibana load. On `main` it currently looks like this on page load:

![CleanShot 2024-11-05 at 17 51
35@2x](https://github.com/user-attachments/assets/7b2fcc7e-08fb-48b8-a1d9-03063b555e38)

This PR refactors how embeddables and UI actions get initialized to
avoid loading any additional async bundles on page load.

![CleanShot 2024-11-06 at 10 51
36@2x](https://github.com/user-attachments/assets/019c3c79-49b5-4e63-9b94-3d7b02963a9b)

### Checklist

- [ ] [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Nov 18, 2024
## Summary

Part of elastic#194171.

The `dataVisualizer` plugin loads quite some bundle chunks on the first
Kibana load. On `main` it currently looks like this on page load:

![CleanShot 2024-11-05 at 17 51
35@2x](https://github.com/user-attachments/assets/7b2fcc7e-08fb-48b8-a1d9-03063b555e38)

This PR refactors how embeddables and UI actions get initialized to
avoid loading any additional async bundles on page load.

![CleanShot 2024-11-06 at 10 51
36@2x](https://github.com/user-attachments/assets/019c3c79-49b5-4e63-9b94-3d7b02963a9b)

### Checklist

- [ ] [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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels Feature:File and Index Data Viz ML file and index data visualizer :ml release_note:skip Skip the PR/issue when compiling release notes v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants