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

fix(browser): Remove browserPerformanceTimeOrigin side-effects #14025

Merged
merged 24 commits into from
Jan 14, 2025

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Oct 18, 2024

Due to the side-effect, browserPerformanceTimeOrigin ends up in the non-tracing browser bundle.

This change ensures that the code is only included when tracing is in use at a slight cost to the tracing bundles.

Copy link
Contributor

github-actions bot commented Oct 18, 2024

size-limit report 📦

Path Size % Change Change
@sentry/browser 22.87 KB -0.6% -139 B 🔽
@sentry/browser - with treeshaking flags 21.56 KB -0.56% -123 B 🔽
@sentry/browser (incl. Tracing) 35.54 KB +0.06% +20 B 🔺
@sentry/browser (incl. Tracing, Replay) 72.31 KB +0.02% +13 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 62.84 KB +0.04% +20 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 76.58 KB +0.03% +16 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 88.59 KB +0.03% +21 B 🔺
@sentry/browser (incl. Feedback) 39.11 KB -0.31% -123 B 🔽
@sentry/browser (incl. sendFeedback) 27.51 KB -0.44% -124 B 🔽
@sentry/browser (incl. FeedbackAsync) 32.29 KB -0.38% -125 B 🔽
@sentry/react 25.6 KB -0.44% -115 B 🔽
@sentry/react (incl. Tracing) 38.31 KB +0.05% +16 B 🔺
@sentry/vue 27 KB -0.43% -118 B 🔽
@sentry/vue (incl. Tracing) 37.28 KB +0.06% +21 B 🔺
@sentry/svelte 23.01 KB -0.52% -123 B 🔽
CDN Bundle 24.19 KB -0.37% -91 B 🔽
CDN Bundle (incl. Tracing) 35.89 KB +0.17% +62 B 🔺
CDN Bundle (incl. Tracing, Replay) 70.51 KB +0.05% +33 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 75.66 KB +0.05% +38 B 🔺
CDN Bundle - uncompressed 70.55 KB -0.33% -232 B 🔽
CDN Bundle (incl. Tracing) - uncompressed 106.2 KB +0.14% +146 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 217.03 KB +0.07% +148 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 229.56 KB +0.07% +148 B 🔺
@sentry/nextjs (client) 38.43 KB +0.05% +19 B 🔺
@sentry/sveltekit (client) 36.07 KB +0.04% +13 B 🔺
@sentry/node 161.34 KB -0.07% -109 B 🔽
@sentry/node - without tracing 97.1 KB -0.16% -151 B 🔽
@sentry/aws-serverless 126.99 KB -0.1% -119 B 🔽

View base workflow run

@timfish
Copy link
Collaborator Author

timfish commented Dec 4, 2024

@mydea or @billyvg do you know why my changes could be causing this Replay test failure with an incorrect segmentId?
https://github.com/getsentry/sentry-javascript/actions/runs/12156896052/job/33901817087?pr=14025#step:6:426

@timfish
Copy link
Collaborator Author

timfish commented Dec 13, 2024

@lforst since this is now a breaking change, can I rebase this PR on top of the v9 branch?

@lforst
Copy link
Member

lforst commented Dec 13, 2024

@lforst since this is now a breaking change, can I rebase this PR on top of the v9 branch?

We already cut the v8 branch so the branch to target with breaking changes is now develop.

@timfish timfish added this to the 9.0.0 milestone Jan 2, 2025
@timfish timfish requested a review from lforst January 13, 2025 21:14
@timfish timfish marked this pull request as ready for review January 13, 2025 21:14
@timfish timfish requested a review from a team as a code owner January 13, 2025 21:14
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

Good change!

*/
export const browserPerformanceTimeOrigin = ((): number | undefined => {
Copy link
Member

Choose a reason for hiding this comment

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

I wonder how much of this logic we can simplify 🤔

Probably not worth the effort.

@lforst lforst merged commit 02742ef into develop Jan 14, 2025
160 checks passed
@lforst lforst deleted the timfish/time-side-effects branch January 14, 2025 11:25
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.

5 participants