Skip to content
New issue

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

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

Already on GitHub? # to your account

Bundle Size #13

Closed
timoxley opened this issue Oct 3, 2020 · 5 comments
Closed

Bundle Size #13

timoxley opened this issue Oct 3, 2020 · 5 comments

Comments

@timoxley
Copy link

timoxley commented Oct 3, 2020

I know it's not really the point of these repos but 31.7 kB does seem like a lot of kilobytes:

https://bundlephobia.com/result?p=es-aggregate-error@1.0.4

image

Any recommendations on what can be done?

@ljharb
Copy link
Member

ljharb commented Oct 3, 2020

Bundlephobia is inaccurate, because you can't reliably measure bundle size outside the context of a complete application.

npx browserify index.js | wc -l in the repo tells me it's 2416 bytes, or 2.36K, not 31k.

Additionally, all es-abstract usage (as well as pretty much all of these dependents) gets aggressively deduplicated when you're using the entire es-shims ecosystem, so the overall impact ends up being pretty small.

@ljharb ljharb closed this as completed Nov 22, 2020
@zloirock
Copy link

zloirock commented Nov 23, 2020

@ljharb wc -l shows the number of lines, not bytes. browserify output for es-aggregate-error@1.0.5 - 91174 bytes, minified - 40.2 kB, so bundlephobia is correct.

@ljharb
Copy link
Member

ljharb commented Nov 23, 2020

@zloirock ha, fair enough. thanks for correcting me. Either way, size is irrelevant until correctness is assured, and it's not possible to ensure correctness with less code as far as I'm aware.

@zloirock
Copy link

@ljharb bundled version of AggregateError from core-js takes 12kB, however, it's the different approaches. It just was interesting for me how it could take 2.3kB -)

@ljharb
Copy link
Member

ljharb commented Nov 23, 2020

Yep, I made a mistake and meant to use -c :-)

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

No branches or pull requests

3 participants