Skip to content

ref(tracing): Reduce metrics bundle size #4432

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

Merged
merged 1 commit into from
Jan 21, 2022
Merged

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Jan 20, 2022

  • Extract out function _tagMetricInfo (rename to tagMetricInfo)
  • Update addPerformanceNavigationTiming function signature to avoid
    using object destructure
  • Small change to entryScriptSrc

Now that we have integration tests, can more confidently refactor this file :)

@AbhiPrasad AbhiPrasad added this to the Treeshaking / Bundle Size milestone Jan 20, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2022

size-limit report

Path Base Size (ff923f9) Current Size Change
@sentry/browser - CDN Bundle (gzipped) 19.59 KB 19.59 KB 0%
@sentry/browser - CDN Bundle (minified) 62.51 KB 62.51 KB +0.01% 🔺
@sentry/browser - Webpack 22.11 KB 22.11 KB 0%
@sentry/browser - Webpack - gzip = false 75.63 KB 75.63 KB 0%
@sentry/react - Webpack 22.14 KB 22.14 KB 0%
@sentry/nextjs Client - Webpack 46.33 KB 46.24 KB -0.21% 🔽
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 28.31 KB 28.25 KB -0.23% 🔽

@@ -194,60 +194,11 @@ export class MetricsInstrumentation {
}

transaction.setMeasurements(this._measurements);
this._tagMetricInfo(transaction);

_tagMetricInfo(transaction, this._lcpEntry, this._clsEntry);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we dont use _ for regular functions. Just private class members due to linting/mangling setup.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is just there due to copy paste, I'll change.

- Extract out function _tagMetricInfo
- Update `addPerformanceNavigationTiming` function signature to avoid
  using object destructure
- Small change to entryScriptSrc
@AbhiPrasad AbhiPrasad force-pushed the abhi-tracing-bundle-size branch from 3205257 to e16aedf Compare January 21, 2022 13:18
@AbhiPrasad AbhiPrasad enabled auto-merge (squash) January 21, 2022 13:19
@AbhiPrasad AbhiPrasad merged commit 1219b75 into master Jan 21, 2022
@AbhiPrasad AbhiPrasad deleted the abhi-tracing-bundle-size branch January 21, 2022 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants