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(sveltekit): Inject Sentry.init calls into server and client bundles #7391

Merged
merged 7 commits into from Mar 9, 2023

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Mar 9, 2023

This PR adds an initial version of Sentry.init call injection to our new SvelteKit SDK:
Specifically, we add a withSentryViteConfig wrapper function, which users will need to wrap around their Vite config. This will:

  • Inject a Vite plugin which takes care of injecting Sentry.init calls from sentry.(client|server).config.(ts|js) files, providing a DX identical to the NextJS SDK.
    • The server-side init is injected into the server index.js file
    • The client-side init is injected into the app.js file
    • The injection works both for production builds (with the Node adapter for now) as well as for a local dev server
  • Add the root directory of the project to the allowed directories for the Vite dev server. We need this so that the client config is correctly picked up by the Vite dev server.

With this in place, we can start adding error monitoring and performance monitoring to the SDK.

ref #7348 #6692

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.21 KB (-0.01% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 62.89 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.85 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified) 55.8 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.6 KB (0%)
@sentry/browser - Webpack (minified) 67.32 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.62 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 48.51 KB (+0.11% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 27.49 KB (+0.15% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.75 KB (+0.14% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 43.17 KB (0%)
@sentry/replay - Webpack (gzipped + minified) 37.19 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 61.16 KB (+0.07% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 54.33 KB (0%)

@Lms24 Lms24 force-pushed the lms/sveltekit-inject-inits branch from 2b6ad6b to bbb97b8 Compare March 9, 2023 14:50
@Lms24 Lms24 marked this pull request as ready for review March 9, 2023 14:51
@Lms24 Lms24 requested a review from lforst March 9, 2023 14:51
@Lms24 Lms24 enabled auto-merge (squash) March 9, 2023 16:11
@Lms24 Lms24 merged commit cc26081 into develop Mar 9, 2023
@Lms24 Lms24 deleted the lms/sveltekit-inject-inits branch March 9, 2023 16:52
@Lms24 Lms24 self-assigned this Mar 10, 2023
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.

None yet

2 participants