-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
chore(size-limit): Add size checks for metrics and logs #18573
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
Conversation
size-limit report 📦
|
| { | ||
| name: '@sentry/browser (incl. Metrics)', | ||
| path: 'packages/browser/build/npm/esm/prod/index.js', | ||
| import: createImport('init', 'metrics'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tbh, I was surprised that the import of metrics and logs is enough in this case because I was under the impression that just importing this object would still tree-shake the implementation of the individual log/metric operations.
However, I inspected the bundle created by size-limit and it turns out that they're still included.
Also further verified this with creating a custom entry file and writing logger.info, etc statements and in either case, the resulting bundle was smaller than just specifying the logger/metric import. So I think we should take this as the upper bound.
This PR adds 3 size-limit entries for logs, metrics and both combined. I have some optimizations lined up for reducing bundle size in both but I need a baseline to see if they actually do any good.
ref #18571
ref #18164