-
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
Add code splitting to the client bundles in triggers_actions_ui plugin #64315
Comments
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
Picking this up as a time-boxed (a half day or so) investigation to figure out what's causing such an unexpected size and to report back to the team. |
Looking at the bundle created when building the Triggers UI is primarily made up of 3 "packages":
In the PR I've put together I changed the Email action so that the Params and Connector field components are loaded lazily. Looks like everything still works same as before except the files have been chunked up such that the email components only get loaded when the Flyout is actually rendered. In addition we should be able to lazy load the routes to the alerting UI - this should defer loading about 200k until the user actually navigates into the UI. All in all once complete - this work should reduce the size loaded when Kibana boots up by just shy of 300k. I'm going to talk to Platform - as it doesn't make sense to include Lodash, Brace, FP-TS and IO-TS when talking about how big Triggers UI is - as I assume it's loaded by other parts of Kibana too and hopefully we're not loading that for each plugin 😱 |
To see the details for yourself you can use: https://chrisbateman.github.io/webpack-visualizer/ Drop in the attached |
We are. Only |
Cool, thanks Mikhail. |
I'm surprised that @gmmorris we will fix the problem with lodash as soon as update the version. that will allow us to use the same version in the whole Kibana #7537 |
@restrry I've created #65301 to track removing the |
Cool cool 👍 looking at the |
yeah, this optimization can wait. |
I recommend not using lodash :) |
triggers_actions_ui.plugin.js
bundle size is 2.7Mb at the momentThis bundle is loaded eagerly whenever a user opens the Kibana app.
We could decrease the plugin size drastically if add code-splitting and lazy loading for the plugin. The most obvious candidates for optimization are UI components used in
actionTypeRegistry
that could be loaded on-demand.Related discussion #64179
The text was updated successfully, but these errors were encountered: