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): Support edge runtime #6730

Closed
wants to merge 9 commits into from

Conversation

lforst
Copy link
Member

@lforst lforst commented Jan 11, 2023

Ref: #6120
Ref: #4206

This PR allows users to call Sentry API inside Edge Runtime code (i.e. middleware and edge routes) to capture errors and transactions. The errors are still very barebones and we have no way of source mapping yet (we don't even know if it is possible).

@github-actions
Copy link
Contributor

github-actions bot commented Jan 11, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.84 KB (0%)
@sentry/browser - ES5 CDN Bundle (minified) 61.46 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.62 KB (+0.02% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 55 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.38 KB (0%)
@sentry/browser - Webpack (minified) 66.55 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.4 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.63 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.82 KB (+0.02% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.25 KB (-0.01% 🔽)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 42.95 KB (-0.43% 🔽)
@sentry/replay - Webpack (gzipped + minified) 38.33 KB (-0.01% 🔽)

@lforst lforst changed the title feat(nextjs): Support middleware and edge functions feat(nextjs): Support error monitoring in middleware and edge functions Jan 11, 2023
@lforst lforst changed the title feat(nextjs): Support error monitoring in middleware and edge functions feat(nextjs): Support edge runtime Jan 12, 2023
@lforst lforst marked this pull request as ready for review January 12, 2023 09:24
@lforst lforst self-assigned this Jan 12, 2023
@lforst
Copy link
Member Author

lforst commented Jan 12, 2023

Okay, this is impossible to integration test because the edge code runs in some sort of sandbox which nock can't get to. I tested this extensively manually and everything should work. I will add proper E2E tests after #6746 is merged.

@lforst lforst requested a review from AbhiPrasad January 12, 2023 10:55
@AbhiPrasad
Copy link
Member

AbhiPrasad commented Jan 12, 2023

Can we split this up into two parts?

  1. where we only add the new edge client, event builder, and transport (and include it's necessary unit tests)
  2. where we add the multiplexer that hooks everything up

This allows us to examine both changes in isolation, hopefully also makes it easier to review things and revert if needed.

We can leave this PR open as reference.

@lforst
Copy link
Member Author

lforst commented Jan 12, 2023

Superseded by #6752 and #6753

@lforst lforst closed this Jan 12, 2023
@lforst lforst deleted the lforst-nextjs-sdk-multiplexer branch January 16, 2023 16:32
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