Skip to content

Introduce code splitting and lazy load components to reduce bundle sizes #7257

Open
@thelovekesh

Description

@thelovekesh

Currently, AMP plugin JS assets constitute various modules which are as follows with their bundle size:

Module Stat Parsed Gzipped
AMP Validation 54.74 KB 21.97 KB 7.77 KB
Block Editor 171.13 KB 83.56 KB 21.42 KB
Classic Editor
Admin 81.32 KB 34.54 KB 12.02 KB
Customizer 31.22 KB 12.99 KB 4.87 KB
WordPress Polyfills
Onboarding wizard
Settings page 3.13 MB 1.64 MB 284.67 KB
Support Page 989.85 KB 388.23 KB 127.26 KB
Styles
Mobile Redirection

Source: Webpack Bundle Analyzer

Upon bundling these assets Webpack warns of a bundle limit exceeding 244 kb size that is not optimal for web performance. Even though these things will not affect an end user but can affect the admin side.

To overcome these bundle-heavy situations we can implement react lazy loading and code splitting for such components/modules which are not needed at the time of first loading impression.

More refs on lazy loading and code splitting:

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Low priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions