Title: Rework SvelteKit SDK build time API · Issue #7787 · getsentry/sentry-javascript · GitHub
Open Graph Title: Rework SvelteKit SDK build time API · Issue #7787 · getsentry/sentry-javascript
X Title: Rework SvelteKit SDK build time API · Issue #7787 · getsentry/sentry-javascript
Description: Problem Statement Currently, in SvelteKit, we instruct users to wrap withSentryViteConfig around their vite config object, similarly to withSentryConfig in the NextJS SDK. There are a couple of concerns with this approach: Depending on o...
Open Graph Description: Problem Statement Currently, in SvelteKit, we instruct users to wrap withSentryViteConfig around their vite config object, similarly to withSentryConfig in the NextJS SDK. There are a couple of con...
X Description: Problem Statement Currently, in SvelteKit, we instruct users to wrap withSentryViteConfig around their vite config object, similarly to withSentryConfig in the NextJS SDK. There are a couple of con...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/7787
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Rework SvelteKit SDK build time API ","articleBody":"### Problem Statement\r\n\r\nCurrently, in SvelteKit, we instruct users to wrap `withSentryViteConfig` around their vite config object, similarly to `withSentryConfig` in the NextJS SDK. There are a couple of concerns with this approach:\r\n\r\n1. Depending on other wrappers people might use, our current types for the wrapper would cause TS errors. This is fixable by using broad enough generics but should we (see other points)?\r\n2. We received [feedback](https://github.com/getsentry/sentry-javascript/issues/6692#issuecomment-1479731983) that such a generic wrapper around the entire config is a little opaque in what it actually does and why we don’t simply use a plugin instead. Fair enough then!\r\n\r\n\r\n### Solution Brainstorm\r\n\r\nVite's plugin system exposes the `configure` hook which we can use to modify users' vite configs within a plugin.\r\n\r\nSo we'll build a \"meta\" `SentrySvelteKitPlugin` which adjusts the user's vite config:\r\n* ~Inject the init injection plugin if necessary~\r\n * ~adjust the allowed serve directories~\r\n * This will be dropped as a feature in favour of using hooks. \r\n* Inject the source maps plugin (=Sentry Vite Plugin w/ a couple of modifications)\r\n* In the future, possibly inject other plugins for auto instrumentation\r\n\r\nWe believe this provides a more transparent API than wrapping the entire config. At the same time, we don't lose the freedom to introduce further modification of the config.\r\nThe SvelteKit build plugin itself also uses the `configure` hook to merge user config w/ Kit-internal config.\r\n\r\n```[tasklist]\r\nTasks\r\n\r\n- [ ] https://github.com/getsentry/sentry-javascript/pull/7788\r\n- [ ] #7789\r\n- [ ] #7791\r\n- [ ] #7792\r\n```\r\n\r\nref: #6692 #7669 ","author":{"url":"https://github.com/Lms24","@type":"Person","name":"Lms24"},"datePublished":"2023-04-07T09:59:28Z","url":"https://github.com/getsentry/sentry-javascript/issues/7787"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9c64ea6f-9e03-9f37-b5f1-38da856c48ca |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 807C:2D47A6:6A3ED5:8EB256:6B04A3B2 |
| html-safe-nonce | 8e1c5f29f72544d4224f953ad4219db5116de7a250f89c76bae63fea1475d0ec |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDdDOjJENDdBNjo2QTNFRDU6OEVCMjU2OjZCMDRBM0IyIiwidmlzaXRvcl9pZCI6IjM4OTI4NTAxMTcxMjQwNzIzNzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6a135d059a129753d3cd98dd1bb089950004f8ea9a94bce6ea4e6a2d833a2ff2 |
| hovercard-subject-tag | issue:1658620904 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/7787/issue_layout |
| twitter:image | https://opengraph.githubassets.com/989d53835eb4f0d1fc8b5a2014bd0c6eb5b90d97da9e49a7adc1af72ba66f11f/getsentry/sentry-javascript/issues/7787 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/989d53835eb4f0d1fc8b5a2014bd0c6eb5b90d97da9e49a7adc1af72ba66f11f/getsentry/sentry-javascript/issues/7787 |
| og:image:alt | Problem Statement Currently, in SvelteKit, we instruct users to wrap withSentryViteConfig around their vite config object, similarly to withSentryConfig in the NextJS SDK. There are a couple of con... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Lms24 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 188497a0f45a7aa8f7c866faa1950d1a7f8d82b59416adf549b222ad1d1dd19b |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 557cfbac6cdb532730c95c90f2cefdc0c4128029 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width