Skip to content

fix(nextjs): Make all wrappers isomorphic and available in all runtimes #8743

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 10 commits into from
Aug 8, 2023

Conversation

lforst
Copy link
Contributor

@lforst lforst commented Aug 7, 2023

Fixes #8738
Fixes #8416

We had an issue that sometimes some exports from our SDK were not available in all of Next.js' runtimes. This caused an issue when people imported stuff from certain runtime files into other runtime files. (e.g. import something from _app in middleware, which would cause an issue because the auto-injected wrapAppGetInitialPropsWithSentry is not exported from the edge part of the SDK).

We are fixing this by exporting all of the auto-injected exports from everywhere. This is possible because theoretically all of these exports don't use any runtime-specific internals.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2023

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 74.96 KB (+0.14% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 31.11 KB (0%)
@sentry/browser - Webpack (gzipped) 21.81 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 69.58 KB (+0.06% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 28.15 KB (+0.01% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 20.17 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 219.29 KB (+0.11% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 84.67 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 59.83 KB (0%)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 31.02 KB (+0.01% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 65.16 KB (+0.16% 🔺)
@sentry/react - Webpack (gzipped) 21.84 KB (0%)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 92.75 KB (+0.11% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 50.6 KB (-0.01% 🔽)

@lforst lforst self-assigned this Aug 7, 2023
@lforst lforst marked this pull request as ready for review August 8, 2023 09:55
@@ -0,0 +1,39 @@
export {
Copy link
Contributor

@kamilogorek kamilogorek Aug 8, 2023

Choose a reason for hiding this comment

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

NIT: newline consistency, but ignore it, as CI is already green

Copy link
Contributor

@kamilogorek kamilogorek left a comment

Choose a reason for hiding this comment

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

Shuffling things around, what can possibly go wrong

@lforst lforst merged commit fac2be8 into develop Aug 8, 2023
@lforst lforst deleted the lforst-isomorphic-nextjs branch August 8, 2023 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants