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

ref(browser/core): Move all log flushing logic into clients #15831

Merged
merged 3 commits into from
Mar 28, 2025

Conversation

AbhiPrasad
Copy link
Member

I experimented with a bunch of different approaches to register log flushing implementations, but I found the cleanest and most performant solution was to have log flushing logic live in clients.

This refactors the browser client to do that, and adds tests for all of our flushing logic everywhere.

The bundle size increase is not ideal, but I recognize we have no choice.

After this gets merged in, I'll add the console logging integration to core. I'll also add some quick integrations for pino and winston.

@AbhiPrasad AbhiPrasad requested review from mydea and lforst March 26, 2025 16:59
@AbhiPrasad AbhiPrasad self-assigned this Mar 26, 2025
Copy link
Contributor

github-actions bot commented Mar 26, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.27 KB +0.84% +197 B 🔺
@sentry/browser - with treeshaking flags 23.1 KB +0.95% +222 B 🔺
@sentry/browser (incl. Tracing) 36.68 KB +0.53% +197 B 🔺
@sentry/browser (incl. Tracing, Replay) 73.85 KB +0.27% +203 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.22 KB +0.33% +222 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 78.5 KB +0.27% +212 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 91.07 KB +0.23% +206 B 🔺
@sentry/browser (incl. Feedback) 40.41 KB +0.51% +209 B 🔺
@sentry/browser (incl. sendFeedback) 27.9 KB +0.69% +193 B 🔺
@sentry/browser (incl. FeedbackAsync) 32.7 KB +0.62% +205 B 🔺
@sentry/react 25.08 KB +0.88% +222 B 🔺
@sentry/react (incl. Tracing) 38.6 KB +0.56% +217 B 🔺
@sentry/vue 27.48 KB +0.69% +191 B 🔺
@sentry/vue (incl. Tracing) 38.38 KB +0.53% +206 B 🔺
@sentry/svelte 23.3 KB +0.82% +193 B 🔺
CDN Bundle 24.51 KB +0.73% +181 B 🔺
CDN Bundle (incl. Tracing) 36.69 KB +0.51% +190 B 🔺
CDN Bundle (incl. Tracing, Replay) 71.7 KB +0.25% +179 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 76.88 KB +0.24% +183 B 🔺
CDN Bundle - uncompressed 71.44 KB +0.72% +521 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 108.62 KB +0.48% +521 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 219.91 KB +0.24% +521 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 232.48 KB +0.22% +521 B 🔺
@sentry/nextjs (client) 39.89 KB +0.54% +219 B 🔺
@sentry/sveltekit (client) 37.1 KB +0.52% +193 B 🔺
@sentry/node 142.92 KB +0.01% +13 B 🔺
@sentry/node - without tracing 96.12 KB +0.02% +13 B 🔺
@sentry/aws-serverless 120.47 KB +0.02% +13 B 🔺

View base workflow run

Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

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

LGTM!

@AbhiPrasad AbhiPrasad merged commit 64308ce into develop Mar 28, 2025
151 of 152 checks passed
@AbhiPrasad AbhiPrasad deleted the abhi-move-into-client-logs branch March 28, 2025 13:45
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