Open nreese opened 1 month ago
ML has an example of this as well: https://github.com/elastic/kibana/issues/189755
Pinging @elastic/kibana-core (Team:Core)
Thanks for documenting this. We fixed it now for the aiops
and dataVisualizer
plugin:
Doing it for the ml
plugin is more work, but we have a PoC already that shows that we can fix the pattern and keep the loading bundle below 100Kbytes. Like mentioned elsewhere, it would be great if UI actions could be registered asynchronously!
Pinging @elastic/ml-ui (:ml)
Problematic pattern
Avoid the pattern below, where plugin setup or start method async imports code during method execution.
This results in poor performance because the first Kibana page load requires additional server requests to download async modules. In the screen shot below, notice how there are 5 additional requests made to download dashboard bundles.
This pattern masks the true page load bundle size, as async imported code is not counted towards page load bundle size.
Examples that follow this anti-pattern
Preferred pattern
Instead, synchronously import code in the plugin so that true page load bundle size is captured.