Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle size regression in 3.5 #12039

Open
panstromek opened this issue Sep 26, 2024 · 3 comments
Open

Bundle size regression in 3.5 #12039

panstromek opened this issue Sep 26, 2024 · 3 comments

Comments

@panstromek
Copy link

Vue version

3.5

Link to minimal reproduction

https://bundlephobia.com/package/[email protected]

Steps to reproduce

Update to 3.5

What is expected?

No significant size increase

What is actually happening?

Bundle size increased by 8% from 41.2 kb gzipped to 44.5.

System Info

No response

Any additional comments?

I don't know it this is expected but it's pretty unfortunate, because there were no significant additional features, and we don't use anything new either - bundle size increase is unconditional, just bumping the version failed our size-limit on CI.

There's also a lot of room for improvement - If I look at the output, there's a lot of function keywords, classes, switch statements and this accesses. Those can all be eliminated by using smaller equivalents (e.g. arrow functions instead of functions, if statements instead of switches, etc.).

@seanogdev
Copy link

there were no significant additional features

Free performance improvements are a pretty big feature

@edison1105
Copy link
Member

The main reason is that the @vue/reactivity package has increased in size(from 35.4 kB to 52.1 kB). Because of the refactoring of the reactivity system.

@panstromek
Copy link
Author

panstromek commented Sep 26, 2024

there were no significant additional features

Free performance improvements are a pretty big feature

Fair point, but it's pretty much not free if it's at the expense of bundle size, which is one of the most important performance metrics (and it's definitely not free for me now, because I have to mitigate the regression elsewhere to stay within our budget).


The main reason is that the @vue/reactivity package has increased in size(from 35.4 kB to 52.1 kB). Because of the refactoring of the reactivity system.

Makes sense, I saw a #12007 PR trying to mitigate some of that. Is there a plan to continue? Do you think there's a chance that a larger effort like that would be merged? There's seems to be some low hanging fruit - swapping functions with arrow functions, replacing switches with if-else, etc. but I'm not sure what's a long term plan for the package or if there's some changes that are not desirable because of style guide (or other reasons, I'm not sure why exactly are classes used in the codebase, so I'd be hesitant to replace them for example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants