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

[Uptime] Reduce miscellaneous uptime bundle size #70632

Merged
merged 11 commits into from
Jul 28, 2020

Conversation

shahzad31
Copy link
Contributor

@shahzad31 shahzad31 commented Jul 2, 2020

Summary

Fixes: elastic/uptime#232

This PR reduces uptime page load bundle size by introducing lazy loading for dependent code

Ultimate dependent diagram looks like this for uptime.plugin.js bundle. Bundle size get's reduced by 95%.

image

Testing

This doesn't change any functionality or tests, few things to look out for, make sure, uptime data is displayed on obsv overview page. User can edit alerts from alerting app.

Uptime works as expected.

Testing Bundle Size

Create webpack stats
node scripts/build_kibana_platform_plugins.js --no-core --no-examples --profile with and without --dist
Find the Uptime bundle in x-pack/plugins/apm/target/public/uptime.plugin.js. This should be as small as possible.

Analyze x-pack/plugins/uptime/target/public/stats.json file using one of the two:
upload stats.json to chrisbateman.github.io/webpack-visualizer

run npx webpack-bundle-analyzer x-pack/plugins/apm/target/public/stats.json

This PR was inspired by #67654

@shahzad31 shahzad31 changed the title update [Uptime] Reduce miscellaneous uptime bundle size Jul 15, 2020
@shahzad31
Copy link
Contributor Author

@elasticmachine merge upstream

@shahzad31 shahzad31 self-assigned this Jul 16, 2020
@shahzad31 shahzad31 added v7.1.0 v7.9.0 v8.0.0 release_note:skip Skip the PR/issue when compiling release notes labels Jul 16, 2020
@shahzad31 shahzad31 marked this pull request as ready for review July 16, 2020 14:12
@shahzad31 shahzad31 requested review from a team as code owners July 16, 2020 14:12
@botelastic botelastic bot added the Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability label Jul 16, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

Copy link
Contributor

@mikecote mikecote left a comment

Choose a reason for hiding this comment

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

triggers_actions_ui code LGTM

@shahzad31 shahzad31 requested a review from andrewvc July 16, 2020 15:28
Copy link
Contributor

@justinkambic justinkambic left a comment

Choose a reason for hiding this comment

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

LGTM WFG

Thanks for removing all the lodash references as well.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

@kbn/optimizer bundle module count

id value diff baseline
uptime 252 +3 249

async chunks size

id value diff baseline
uptime 1.6MB +972.5KB 620.3KB

page load bundle size

id value diff baseline
triggers_actions_ui 267.0KB +93.0B 266.9KB
uptime 23.7KB -462.7KB 486.3KB
total - -462.6KB -

History

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

@shahzad31 shahzad31 merged commit 330c966 into elastic:master Jul 28, 2020
@shahzad31 shahzad31 deleted the remove-lodash branch July 28, 2020 14:31
shahzad31 added a commit to shahzad31/kibana that referenced this pull request Jul 29, 2020
@shahzad31 shahzad31 removed the v7.9.0 label Jul 30, 2020
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

@kibanamachine kibanamachine added backport missing Added to PRs automatically when the are determined to be missing a backport. and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Jul 30, 2020
shahzad31 added a commit that referenced this pull request Jul 30, 2020
Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Shahzad <[email protected]>
Co-authored-by: Justin Kambic <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Uptime] Reduce uptime bundle size removing unnecessary packages and using lazy loading
5 participants