[Infra UI] Avoid eager async imports in metric alert registrations#123285
[Infra UI] Avoid eager async imports in metric alert registrations#123285weltenwort merged 11 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI) |
|
looks like an unrelated failure of the CI infrastructure |
|
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
Unknown metric groupsasync chunk count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @weltenwort |
|
To put the bundle size changes into perspective, here are the changes from the original PR that caused the unfortunate loading behavior: Async chunks
Page load bundle
|
💔 All backports failed
How to fixRe-run the backport manually: Questions ?Please refer to the Backport tool documentation |
|
These manual backports will take a while because many of the prior code changes have not been backported cleanly and/or were partially reverted. |
…lastic#123285) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 629c602) # Conflicts: # x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx # x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx # x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/evaluate_condition.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/lib/calculate_from_based_on_metric.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_rule.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_rule_type.ts # x-pack/test/api_integration/apis/metrics_ui/inventory_threshold_alert.ts
…123285) (#123868) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 629c602) # Conflicts: # x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx # x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx # x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/evaluate_condition.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/lib/calculate_from_based_on_metric.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_rule.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_rule_type.ts # x-pack/test/api_integration/apis/metrics_ui/inventory_threshold_alert.ts
…lastic#123285) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 629c602) # Conflicts: # x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx # x-pack/plugins/infra/public/alerting/inventory/components/expression_chart.tsx # x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx # x-pack/plugins/infra/public/alerting/inventory/index.ts # x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/index.ts # x-pack/plugins/infra/public/plugin.ts # x-pack/plugins/infra/server/features.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/evaluate_condition.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/lib/calculate_from_based_on_metric.ts # x-pack/plugins/infra/server/lib/alerting/metric_anomaly/metric_anomaly_executor.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_alert.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/metric_query.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_alert_type.ts # x-pack/test/api_integration/apis/metrics_ui/inventory_threshold_alert.ts # x-pack/test/api_integration/apis/metrics_ui/metric_threshold_alert.ts
…lastic#123285) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…lastic#123285) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx # x-pack/plugins/infra/public/alerting/inventory/components/expression_chart.tsx # x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx # x-pack/plugins/infra/public/alerting/inventory/index.ts # x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/index.ts # x-pack/plugins/infra/public/plugin.ts # x-pack/plugins/infra/server/features.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/evaluate_condition.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/lib/calculate_from_based_on_metric.ts # x-pack/plugins/infra/server/lib/alerting/metric_anomaly/metric_anomaly_executor.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_alert.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/metric_query.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_alert_type.ts # x-pack/test/api_integration/apis/metrics_ui/inventory_threshold_alert.ts # x-pack/test/api_integration/apis/metrics_ui/metric_threshold_alert.ts
…123285) (#124177) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # x-pack/plugins/infra/public/alerting/inventory/components/expression.tsx # x-pack/plugins/infra/public/alerting/inventory/components/expression_chart.tsx # x-pack/plugins/infra/public/alerting/inventory/components/metric.tsx # x-pack/plugins/infra/public/alerting/inventory/index.ts # x-pack/plugins/infra/public/alerting/metric_anomaly/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/components/expression_row.tsx # x-pack/plugins/infra/public/alerting/metric_threshold/index.ts # x-pack/plugins/infra/public/plugin.ts # x-pack/plugins/infra/server/features.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/evaluate_condition.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/inventory_metric_threshold_executor.ts # x-pack/plugins/infra/server/lib/alerting/inventory_metric_threshold/lib/calculate_from_based_on_metric.ts # x-pack/plugins/infra/server/lib/alerting/metric_anomaly/metric_anomaly_executor.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/evaluate_alert.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/lib/metric_query.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.test.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/metric_threshold_executor.ts # x-pack/plugins/infra/server/lib/alerting/metric_threshold/register_metric_threshold_alert_type.ts # x-pack/test/api_integration/apis/metrics_ui/inventory_threshold_alert.ts # x-pack/test/api_integration/apis/metrics_ui/metric_threshold_alert.ts


📝 Summary
This reverts the eager async imports introduced in #119557 to make sure most chunks are loaded on-demand. In doing so it untangles a web of forbidden imports across the
publicandserverdirectories which were flagged as linter exceptions.closes #122941
🕵️♀️ Review notes
serverandcommon, so most forbidden imports could be removed by importing fromcommoninstead. Where the type didn't yet exist incommon, this moves it there.infra.chunk.N.jsbundles are loaded on the login screen, but keep the rule creation fly-outs working.