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

feat(nextjs): Record turbopack as tag #15928

Merged
merged 6 commits into from
Apr 2, 2025
Merged

feat(nextjs): Record turbopack as tag #15928

merged 6 commits into from
Apr 2, 2025

Conversation

lforst
Copy link
Member

@lforst lforst commented Mar 31, 2025

This tag can be useful for troubleshooting inside the product.

Note that the process.turbopack flag is only available in code bundled by Next.js.

@lforst lforst requested a review from mydea March 31, 2025 09:06
Copy link
Contributor

github-actions bot commented Mar 31, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.2 KB - -
@sentry/browser - with treeshaking flags 23.02 KB - -
@sentry/browser (incl. Tracing) 36.76 KB - -
@sentry/browser (incl. Tracing, Replay) 73.92 KB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.32 KB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 78.59 KB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 91.16 KB - -
@sentry/browser (incl. Feedback) 40.33 KB - -
@sentry/browser (incl. sendFeedback) 27.83 KB - -
@sentry/browser (incl. FeedbackAsync) 32.63 KB - -
@sentry/react 25 KB - -
@sentry/react (incl. Tracing) 38.68 KB - -
@sentry/vue 27.41 KB - -
@sentry/vue (incl. Tracing) 38.48 KB - -
@sentry/svelte 23.23 KB - -
CDN Bundle 24.44 KB - -
CDN Bundle (incl. Tracing) 36.78 KB - -
CDN Bundle (incl. Tracing, Replay) 71.8 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 76.99 KB - -
CDN Bundle - uncompressed 71.24 KB - -
CDN Bundle (incl. Tracing) - uncompressed 108.76 KB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 220.05 KB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 232.62 KB - -
@sentry/nextjs (client) 39.99 KB +0.07% +26 B 🔺
@sentry/sveltekit (client) 37.2 KB - -
@sentry/node 142.88 KB -0.01% -1 B 🔽
@sentry/node - without tracing 96.08 KB - -
@sentry/aws-serverless 120.43 KB -0.01% -1 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.

can we add tests for this?

@lforst
Copy link
Member Author

lforst commented Mar 31, 2025

can we add tests for this?

Tricky because it relies very strongly on Next.js versions and stuff.

try {
// @ts-expect-error `process.turbopack` is a magic string that will be replaced by Next.js
if (process.turbopack) {
getGlobalScope().setTag('turbopack', true);
Copy link
Member

Choose a reason for hiding this comment

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

hmm are we sure we want to set a tag over a context here? Is there value in making this searchable?

Copy link
Member Author

Choose a reason for hiding this comment

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

I say yes - for now. Sigrid is working on some stuff in the protocol that will allow us to send stuff like this in a more structured way. It will be invaluable for us in the transitionary period when turbopack ships and we have to debug potential issues with the SDK.

@lforst lforst merged commit 305df9f into develop Apr 2, 2025
128 of 129 checks passed
@lforst lforst deleted the lforst-turbopack-flag branch April 2, 2025 09:32
onurtemizkan pushed a commit that referenced this pull request Apr 3, 2025
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.

3 participants