components icon indicating copy to clipboard operation
components copied to clipboard

bundle size significantly larger for experimental vs legacy components

Open jponeill opened this issue 3 years ago • 5 comments

Is this a regression?

  • [ ] Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

I know this is work in progress, but when I compare the bundle size of the legacy components vs the experimental ones, the experimental ones are significantly larger (50% larger, in my project). I've attached source-map-explorer that shows the difference for form-field, button, dialog, expansion & icon. Screenshot 2023-06-30 at 11 54 29 AM Screenshot 2023-06-30 at 11 44 19 AM

Reproduction

StackBlitz link: Steps to reproduce:

  1. Build project w/ material legacy components 2.Build project w/ material experimental components
  2. Compare bundle size using source-map-explorer ... experimental bundle size is much larger.

Expected Behavior

I expect legacy and experimental bundle sizes to be close in size

Actual Behavior

Experimental bundle sizes are much larger.

Environment

  • Angular: 16.2.0-next.0
  • CDK/Material: 16.2.0-next.1
  • Browser(s): N/A
  • Operating System (e.g. Windows, macOS, Ubuntu): MacOS

jponeill avatar Jun 30 '23 16:06 jponeill

It's worth noting that some of the styles moved from the theme to the component styles which can explain some of the difference since the visualization doesn't show the theme.

crisbeto avatar Jul 03 '23 07:07 crisbeto

You're right, @crisbeto , the CSS bundle size is ~9K smaller. Accounting for that, it looks like there's ~40% increase for these components.

jponeill avatar Jul 03 '23 12:07 jponeill

@crisbeto I see that the legacy components have been removed in v17. I'm looking forward to switching over, but am a little worried about the increase in bundle size based on my quick tests.

jponeill avatar Aug 18 '23 13:08 jponeill

We are closing this issue, because we've determined, using a semi-automated process, that it is no longer relevant, has low engagement, or it does not have enough information to proceed. Feel free to comment if you think the issue should be reopened, or open a new issue with the latest version of our code instead.

crisbeto avatar May 29 '26 13:05 crisbeto

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.