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][Event annotations] Move logic into packages #161500

Merged

Conversation

drewdaemon
Copy link
Contributor

@drewdaemon drewdaemon commented Jul 7, 2023

Resolve #161140

Note — this PR doesn't change any behavior. Purely reorganizing existing code.

Specifically, this PR creates three new packages and removes one plugin:

  • @kbn/visualization-ui-components — the plugin has been moved to a static package since there's no need of Kibana dependency injection or lifecycle. Leaf dependency.
  • @kbn/event-annotation-common — a few core annotation-related types and utilities that are available in both server and browser contexts. Leaf dependency.
  • @kbn/event-annotation-components — a collection of static components used for interacting with event annotations

drewdaemon and others added 30 commits July 5, 2023 18:06
…om:drewdaemon/kibana into create-event-annotation-application-plugin
…om:drewdaemon/kibana into create-event-annotation-application-plugin
…om:drewdaemon/kibana into create-event-annotation-application-plugin
…om:drewdaemon/kibana into create-event-annotation-application-plugin
@drewdaemon drewdaemon changed the title Create event annotation application plugin [Lens][Event annotations] Move logic into packages Jul 13, 2023
@drewdaemon drewdaemon marked this pull request as ready for review July 13, 2023 19:07
@drewdaemon drewdaemon requested review from a team as code owners July 13, 2023 19:07
@drewdaemon drewdaemon added Team:Visualizations Visualization editors, elastic-charts and infrastructure release_note:skip Skip the PR/issue when compiling release notes Feature:Lens labels Jul 13, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations)

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

This looks great, I tested it locally and I dont see any regression.

Can we run the bundle analyzer and understand why Lens async bundle has been increased so?

@drewdaemon
Copy link
Contributor Author

@stratoula good idea. I just added the label

@drewdaemon
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@MichaelMarcialis MichaelMarcialis left a comment

Choose a reason for hiding this comment

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

Code review only. LGTM.

Copy link
Contributor

@dej611 dej611 left a comment

Choose a reason for hiding this comment

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

The jump in async load seems a bit too much. I've left few suggestions on treeshake, attempting to reduce such increase.

packages/kbn-event-annotation-common/package.json Outdated Show resolved Hide resolved
packages/kbn-event-annotation-components/package.json Outdated Show resolved Hide resolved
packages/kbn-visualization-ui-components/package.json Outdated Show resolved Hide resolved
@drewdaemon
Copy link
Contributor Author

@stratoula how do you feel about the new bundle stats? Lens grew, but expressions shrunk.

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #6 / maps app lens choropleth chart should allow creation of choropleth chart

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
eventAnnotation 219 322 +103
expressionXY 152 154 +2
lens 1003 1110 +107
visualizationUiComponents 114 - -114
total +98

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/event-annotation-common - 39 +39
@kbn/event-annotation-components - 65 +65
@kbn/visualization-ui-components - 151 +151
eventAnnotation 236 192 -44
visualizationUiComponents 150 - -150
total +61

Any counts in public APIs

Total count of every any typed public API. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats any for more detailed information.

id before after diff
@kbn/event-annotation-common - 1 +1
@kbn/event-annotation-components - 1 +1
@kbn/visualization-ui-components - 1 +1
visualizationUiComponents 1 - -1
total +2

Async chunks

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

id before after diff
charts 41.2KB 9.8KB -31.4KB
eventAnnotation 140.5KB 176.3KB +35.9KB
expressionHeatmap 53.9KB 26.5KB -27.3KB
expressionMetricVis 33.4KB 4.5KB -28.9KB
expressionXY 121.5KB 121.6KB +77.0B
lens 1.3MB 1.4MB +52.6KB
visualizationUiComponents 38.7KB - -38.7KB
total -37.8KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/event-annotation-components - 1 +1
@kbn/visualization-ui-components - 3 +3
eventAnnotation 4 2 -2
visualizationUiComponents 4 - -4
total -2

Page load bundle

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

id before after diff
charts 45.1KB 44.9KB -171.0B
eventAnnotation 27.8KB 21.5KB -6.3KB
expressionHeatmap 14.7KB 14.6KB -99.0B
expressionMetricVis 13.8KB 13.6KB -155.0B
expressionXY 38.1KB 37.9KB -145.0B
lens 36.5KB 36.2KB -300.0B
visualizationUiComponents 38.2KB - -38.2KB
total -45.3KB
Unknown metric groups

API count

id before after diff
@kbn/event-annotation-common - 39 +39
@kbn/event-annotation-components - 65 +65
@kbn/visualization-ui-components - 155 +155
eventAnnotation 236 192 -44
visualizationUiComponents 154 - -154
total +61

async chunk count

id before after diff
charts 5 4 -1
eventAnnotation 5 6 +1
expressionHeatmap 2 1 -1
expressionMetricVis 2 1 -1
lens 21 22 +1
visualizationUiComponents 2 - -2
total -3

ESLint disabled in files

id before after diff
eventAnnotation 1 0 -1

ESLint disabled line counts

id before after diff
@kbn/event-annotation-components - 1 +1
eventAnnotation 1 0 -1
total -0

References to deprecated APIs

id before after diff
@kbn/event-annotation-components - 10 +10
@kbn/visualization-ui-components - 5 +5
eventAnnotation 15 5 -10
visualizationUiComponents 5 - -5
total -0

Total ESLint disabled count

id before after diff
@kbn/event-annotation-components - 1 +1
eventAnnotation 2 0 -2
total -1

History

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

@drewdaemon drewdaemon merged commit 092e988 into elastic:main Jul 19, 2023
@kibanamachine kibanamachine added v8.10.0 backport:skip This commit does not require backporting labels Jul 19, 2023
Ruhshan pushed a commit to Ruhshan/kibana that referenced this pull request Jul 19, 2023
ThomThomson pushed a commit to ThomThomson/kibana that referenced this pull request Aug 1, 2023
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 ci:build-webpack-bundle-analyzer Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] make visualization_ui_components plugin a static package
8 participants