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

[Lens] Bundle Size Reduction #142938

Merged
merged 5 commits into from
Oct 10, 2022
Merged

Conversation

alexwizp
Copy link
Contributor

@alexwizp alexwizp commented Oct 7, 2022

Summary

[Lens] Bundle Size Reduction

What was done

  • layerTypes was removed from Lens, now we import it from expression-xy (around -0.5KB)
  • open_in_discover_helpers moved into async chunk (around -1.8KB)
  • some imports were updated

@alexwizp alexwizp self-assigned this Oct 10, 2022
@alexwizp alexwizp added v8.6.0 Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Oct 10, 2022
@alexwizp alexwizp marked this pull request as ready for review October 10, 2022 08:41
@alexwizp alexwizp requested a review from a team as a code owner October 10, 2022 08:41
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)

@alexwizp
Copy link
Contributor Author

@elasticmachine merge upstream

@alexwizp alexwizp changed the title [Draft][Lens] Bundle Size Reduction [Lens] Bundle Size Reduction Oct 10, 2022
Copy link
Contributor

@mbondyra mbondyra left a comment

Choose a reason for hiding this comment

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

Impressive 🎉 ! I tested it on Chrome by clicking through things and couldn't find any problems, I hope functional tests will give us enough confidence.

Just for me to learn: Out of the things mentioned by you in the description, what had the biggest influence to reduce the bundle size?

@alexwizp alexwizp enabled auto-merge (squash) October 10, 2022 10:06
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
expressionXY 150 151 +1
lens 929 925 -4
total -3

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
expressionXY 143 145 +2
lens 565 563 -2
total -0

Async chunks

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

id before after diff
lens 1.3MB 1.3MB +11.6KB

Page load bundle

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

id before after diff
expressionXY 37.0KB 37.0KB +45.0B
lens 35.6KB 29.1KB -6.5KB
total -6.4KB
Unknown metric groups

API count

id before after diff
expressionXY 153 155 +2
lens 656 654 -2
total -0

async chunk count

id before after diff
lens 15 16 +1

ESLint disabled line counts

id before after diff
lens 22 21 -1

References to deprecated APIs

id before after diff
maps 17 21 +4
ml 24 34 +10
total +14

Total ESLint disabled count

id before after diff
lens 25 24 -1

History

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

cc @alexwizp

@alexwizp alexwizp merged commit c38712a into elastic:main Oct 10, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Oct 10, 2022
@drewdaemon
Copy link
Contributor

We need the Lens layerTypes to be separate from the expression-xy layerTypes. Metric trendlines will be Lens layers, but they will have nothing to do with the XY visualization.

@drewdaemon
Copy link
Contributor

I will have to add them back in #141851, but @alexwizp I'll request your review to see if there's a way to mitigate the bundle size impact!

WafaaNasr pushed a commit to WafaaNasr/kibana that referenced this pull request Oct 11, 2022
* [Draft][Lens] Bundle Size Reduction

* fix JEST

* update some imports

* Update x-pack/plugins/lens/common/expressions/datatable/sorting.tsx

Co-authored-by: Marco Liberati <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Marco Liberati <[email protected]>
WafaaNasr pushed a commit to WafaaNasr/kibana that referenced this pull request Oct 14, 2022
* [Draft][Lens] Bundle Size Reduction

* fix JEST

* update some imports

* Update x-pack/plugins/lens/common/expressions/datatable/sorting.tsx

Co-authored-by: Marco Liberati <[email protected]>

Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Marco Liberati <[email protected]>
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 Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants