-
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
load react component lazily to reduce entry bundle #65267
load react component lazily to reduce entry bundle #65267
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I tested locally and it works fine.
Just added 1 super NIT.
|
||
// required for lazy loading | ||
// eslint-disable-next-line import/no-default-export | ||
export { TelemetryManagementSection as default }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super NIT: why the export { X as Y }
instead of the straight export default TelemetryManagementSection;
format?
export { TelemetryManagementSection as default }; | |
export default TelemetryManagementSection; |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* load react component lazily to reduce entry bundle * address comments
Summary
Parent issue: #62263
We strive to keep the entry bundle as small as possible to speed up Kibana load + bootstrap time.
telemetry_management_section.plugin.js
bundle is loaded whenever a user opens Kibana and should be lightweight. This PR adds lazy loading to reducetelemetry_management_section.plugin.js
bundle size to load the main chunk of code by demand when the section is mounted.telemetry_management_section.plugin.js
size before:966Kb
telemetry_management_section.plugin.js
size after:8.7Kb