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

[triggersActionsUi] Reduce page load bundle to under 100kB #95871

Closed
tylersmalley opened this issue Mar 30, 2021 · 4 comments · Fixed by #97770 or #100525
Closed

[triggersActionsUi] Reduce page load bundle to under 100kB #95871

tylersmalley opened this issue Mar 30, 2021 · 4 comments · Fixed by #97770 or #100525
Assignees
Labels
Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@tylersmalley
Copy link
Contributor

For details, refer to the meta issue at #95853

The triggersActionsUi plugin is currently 102,609 bytes. To consider this issue closed, the limits.yml should be updated with the value under 100000.

@tylersmalley tylersmalley added the Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) label Mar 30, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@tylersmalley tylersmalley changed the title [triggersActionsUi] Reduce page load bundle to under 100k [triggersActionsUi] Reduce page load bundle to under 100kb Mar 30, 2021
@tylersmalley tylersmalley changed the title [triggersActionsUi] Reduce page load bundle to under 100kb [triggersActionsUi] Reduce page load bundle to under 100kB Mar 30, 2021
@ymao1 ymao1 self-assigned this Apr 8, 2021
@ymao1 ymao1 removed their assignment Apr 14, 2021
@YulNaumenko YulNaumenko self-assigned this Apr 19, 2021
@YulNaumenko
Copy link
Contributor

YulNaumenko commented May 22, 2021

Based on the investigation of the triggersActions plugin bundle size:
Screen Shot 2021-05-23 at 7 42 13 PM
Screen Shot 2021-05-23 at 7 41 56 PM

, there are three different areas (PRs) which should be changed to reduce the non required file loads:

  1. change all SVG files to be lazy loaded as a React components. This will save us: 13Kb

  2. remove direct exposure of Jira, IBM Resilient and ServiceNow in x-pack/plugins/triggers_actions_ui/public/common/index.ts. This is historically used by the Cases plugin and should be changed to use triggersActionsUi plugin setup contract, which has this data through the actionsTypeRegistry.

Screen Shot 2021-05-22 at 4 01 40 PM

  1. change action type validation methods validateConnector and validateParams to be asynchronous and load(+ memoize) translations only when it's executed. This will save us: 15Kb

Screen Shot 2021-05-22 at 8 21 58 AM

  1. minor code refactoring:
  • change ActionForm, AlertConditions, AlertConditionsGroup to be exposed through the plugin start contract and remove direct component links from Security plugin
  • move shared components props definitions to the x-pack/plugins/triggers_actions_ui/public/types.ts ;
  • security plugin should use actions API call instead of direct linking to the triggersActionsUi plugin files;
  • remove the usage duplication for x-pack/plugins/triggers_actions_ui/public/common/get_add_alert_flyout.tsx, x-pack/plugins/triggers_actions_ui/public/common/get_add_connector_flyout.tsx, x-pack/plugins/triggers_actions_ui/public/common/get_edit_alert_flyout.tsx, x-pack/plugins/triggers_actions_ui/public/common/get_edit_connector_flyout.tsx;
  • replace <Fragment></Fragment> with shorter version <></>;
  • remove not used imports from x-pack/plugins/triggers_actions_ui/public/index.ts

@tylersmalley
Copy link
Contributor Author

Reopening as the bundle is no longer under 100kB

@XavierM XavierM assigned XavierM and unassigned YulNaumenko May 19, 2022
@XavierM
Copy link
Contributor

XavierM commented Jul 11, 2022

we are back to normal!

@XavierM XavierM closed this as completed Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment