Skip to content

Remove eCharts and zrender from the main chunk

Mike Greiling requested to merge mg-remove-echarts-from-main-bundle into master

What does this MR do?

eCharts was inadvertently placed into a webpack chunk that gets loaded on all pages when we implemented embedded kubernetes charts in GitLab-flavored markdown (GFM). This MR utilizes code-splitting to load the required components on-demand only when they are needed (e.g. on a page that has GFM with one of these charts embedded in it). This will save about a megabyte of javascript from nearly every entrypoint on GitLab.

Screenshots

before after
before after

Note these sizes are from the development-mode build and not representative of the size in production, but the relative size difference between the before/after illustrates the improvement.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Merge request reports