Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,27 @@ module.exports = [
gzip: true,
limit: '35 KB',
},
{
name: '@sentry/browser (incl. Metrics)',
path: 'packages/browser/build/npm/esm/prod/index.js',
import: createImport('init', 'metrics'),
Copy link
Member Author

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.

gzip: true,
limit: '27 KB',
},
{
name: '@sentry/browser (incl. Logs)',
path: 'packages/browser/build/npm/esm/prod/index.js',
import: createImport('init', 'logger'),
gzip: true,
limit: '27 KB',
},
{
name: '@sentry/browser (incl. Metrics & Logs)',
path: 'packages/browser/build/npm/esm/prod/index.js',
import: createImport('init', 'metrics', 'logger'),
gzip: true,
limit: '28 KB',
},
// React SDK (ESM)
{
name: '@sentry/react',
Expand Down
Loading