-
-
Notifications
You must be signed in to change notification settings - Fork 217
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
Misleading example in docs / readme #952
Comments
Hey 👋 thank you for reaching out!
This is not true. Please paste the entire code into bundlejs.com and click build to verify.
No, there is no difference between wildcard and named imports when it comes to tree shaking. |
Should I close this issue? |
I think there's a misunderstanding - it's a bit ambiguous if the initial example implies library total bundle size (it's around ~10kb gzipped) or only size of the actually used functions(around ~1.25kb). In practice this specific code example with most modern bundlers would result in ~1.25kb bundle - it's just that the phrasing is unclear if using more validators would increase this value and it's not the size of the whole library. |
What exactly should I change? |
OK @fabian-hiller my bad, import syntax does not indeed affect bundle size (unless you materialize the namespace object by doing |
Hi there, and thanks for the wonderful library! I noticed a few issues with the first code example as seen in readme and the docs:
I think it'd be best to write the example with named imports to encourage optimal usage:
Alternatively, we could update the example with the current full-bundle size, or remove the kB size altogether.
Which option would you prefer?
The text was updated successfully, but these errors were encountered: