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

dist bundle size #2483

Closed
pkieltyka opened this issue Jul 6, 2024 · 4 comments
Closed

dist bundle size #2483

pkieltyka opened this issue Jul 6, 2024 · 4 comments
Labels
A: Docs Area: Documentation

Comments

@pkieltyka
Copy link

What is the type of issue?

Documentation is incorrect

What is the issue?

docs state viem is ~31kb minified + gzipped

image

bundlephobia says its ~74kb minified + gzipped

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

image

Where did you find it?

@pkieltyka pkieltyka added the A: Docs Area: Documentation label Jul 6, 2024
@jxom
Copy link
Member

jxom commented Jul 6, 2024

Docs are correct. The comparison here is the size to import createPublicClient and http from Viem – the minimum amount of modules to replicate JsonRpcProvider or Web3.js' Provider.

Bundlephobia is not a great source of truth for bundle size of ESM packages as it doesn't account for tree-shaking, and shows the bundle size to import every single module from Viem into your application.

We also keep track of our module sizes here via size-limit.

@jxom jxom closed this as not planned Won't fix, can't repro, duplicate, stale Jul 6, 2024
@pkieltyka
Copy link
Author

How are you measuring that with tree shaking?

@jxom
Copy link
Member

jxom commented Jul 6, 2024

Can configure the size-limit imports here then run pnpm size.

Copy link
Contributor

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Viem version. If you have any questions or comments you can create a new discussion thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A: Docs Area: Documentation
Projects
None yet
Development

No branches or pull requests

2 participants