-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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(v8/solidstart): Add withSentry
wrapper for SolidStart config
#15135
Conversation
* | ||
* @deprecated This plugin will be removed in v9. Instead, use `withSentry` to wrap your SolidStart config. Example: | ||
* ``` | ||
* export default defineConfig( | ||
* withSentry( | ||
* { | ||
* // SolidStart config... | ||
* }, | ||
* { | ||
* // Sentry config | ||
* org: process.env.SENTRY_ORG, | ||
* project: process.env.SENTRY_PROJECT, | ||
* authToken: process.env.SENTRY_AUTH_TOKEN, | ||
* }, | ||
* ), | ||
* ); | ||
* ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything in this PR is just a backport of the PRs merged into the v9 branch.
Those JSDoc lines are new. And I kept the E2E tests solidstart
and solidstart-spa
as they were before, to still test that the old way of setting up the SDK (with the Vite plugin) works.
withSentry
wrapper for SolidStart configwithSentry
wrapper for SolidStart config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks!
…erSentry` (#14862) This PR adds a `withSentry` wrapper for SolidStart's config to build and place `instrument.server.ts` alongside the server build output so that it doesn't have to be placed in `/public` anymore to be discoverable. The setup is changed to be aligned with Nuxt. First, the `instrument.server.ts` file is added to the build output (the sentry release injection file needs to be copied as well - this is not ideal at the moment as there **could** be other imports as well, but it's okay for now) Then, there are two options to set up the SDK: 1. Users provide an `--import` CLI flag to their start command like this: ```node --import ./.output/server/instrument.server.mjs .output/server/index.mjs``` 2. Users can add `autoInjectServerSentry: 'top-level-import'` and the Sentry config will be imported at the top of the server entry ```typescript // app.config.ts import { defineConfig } from '@solidjs/start/config'; import { withSentry } from '@sentry/solidstart'; export default defineConfig(withSentry( { /* ... */ }, { autoInjectServerSentry: 'top-level-import' // optional }) ); ``` --- builds on top of the idea in this PR: #13784 --------- Co-authored-by: Andrei Borza <[email protected]>
…import` (#14863)⚠️ THIS PR IS BASED ON #14862 Adds the option to dynamically import the server config file. ```typescript // app.config.ts import { defineConfig } from '@solidjs/start/config'; import { sentrySolidStartVite, withSentry } from '@sentry/solidstart'; export default defineConfig(withSentry( { /* ... */ }, { autoInjectServerSentry: 'experimental_dynamic-import' }) ); ``` --------- Co-authored-by: Andrei Borza <[email protected]> (cherry picked from commit 38ff6eb)
6d4eda9
to
c611265
Compare
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@sentry/react](https://github.com/getsentry/sentry-javascript/tree/master/packages/react) ([source](https://github.com/getsentry/sentry-javascript)) | dependencies | minor | [`8.51.0` -> `8.52.0`](https://renovatebot.com/diffs/npm/@sentry%2freact/8.51.0/8.52.0) | --- ### Release Notes <details> <summary>getsentry/sentry-javascript (@​sentry/react)</summary> ### [`v8.52.0`](https://github.com/getsentry/sentry-javascript/releases/tag/8.52.0) [Compare Source](getsentry/sentry-javascript@8.51.0...8.52.0) ##### Important Changes - **feat(solidstart): Add `withSentry` wrapper for SolidStart config ([#​15135](getsentry/sentry-javascript#15135 To enable the SolidStart SDK, wrap your SolidStart Config with `withSentry`. The `sentrySolidStartVite` plugin is now automatically added by `withSentry` and you can pass the Sentry build-time options like this: ```js import { defineConfig } from '@​solidjs/start/config'; import { withSentry } from '@​sentry/solidstart'; export default defineConfig( withSentry( { /* Your SolidStart config options... */ }, { // Options for setting up source maps org: process.env.SENTRY_ORG, project: process.env.SENTRY_PROJECT, authToken: process.env.SENTRY_AUTH_TOKEN, }, ), ); ``` With the `withSentry` wrapper, the Sentry server config should not be added to the `public` directory anymore. Add the Sentry server config in `src/instrument.server.ts`. Then, the server config will be placed inside the server build output as `instrument.server.mjs`. Now, there are two options to set up the SDK: 1. **(recommended)** Provide an `--import` CLI flag to the start command like this (path depends on your server setup): `node --import ./.output/server/instrument.server.mjs .output/server/index.mjs` 2. Add `autoInjectServerSentry: 'top-level-import'` and the Sentry config will be imported at the top of the server entry (comes with tracing limitations) ```js withSentry( { /* Your SolidStart config options... */ }, { // Optional: Install Sentry with a top-level import autoInjectServerSentry: 'top-level-import', }, ); ``` ##### Other Changes - feat(v8/core): Add client outcomes for breadcrumbs buffer ([#​15149](getsentry/sentry-javascript#15149)) - feat(v8/core): Improve error formatting in ZodErrors integration ([#​15155](getsentry/sentry-javascript#15155)) - fix(v8/bun): Ensure instrumentation of `Bun.serve` survives a server reload ([#​15157](getsentry/sentry-javascript#15157)) - fix(v8/core): Pass `module` into `loadModule` ([#​15139](getsentry/sentry-javascript#15139)) ([#​15166](getsentry/sentry-javascript#15166)) Work in this release was contributed by [@​jahands](https://github.com/jahands), [@​jrandolf](https://github.com/jrandolf), and [@​nathankleyn](https://github.com/nathankleyn). Thank you for your contributions! #### Bundle size 📦 | Path | Size | | ---------------------------------------------------------------- | ----------------- | | [@​sentry/browser](https://github.com/sentry/browser) | 23.32 KB | | [@​sentry/browser](https://github.com/sentry/browser) - with treeshaking flags | 23.2 KB | | [@​sentry/browser](https://github.com/sentry/browser) (incl. Tracing) | 35.88 KB | | [@​sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay) | 73.23 KB | | [@​sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay) - with treeshaking flags | 66.7 KB | | [@​sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay with Canvas) | 77.54 KB | | [@​sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay, Feedback) | 89.47 KB | | [@​sentry/browser](https://github.com/sentry/browser) (incl. Feedback) | 39.53 KB | | [@​sentry/browser](https://github.com/sentry/browser) (incl. sendFeedback) | 27.94 KB | | [@​sentry/browser](https://github.com/sentry/browser) (incl. FeedbackAsync) | 32.73 KB | | [@​sentry/react](https://github.com/sentry/react) | 26 KB | | [@​sentry/react](https://github.com/sentry/react) (incl. Tracing) | 38.71 KB | | [@​sentry/vue](https://github.com/sentry/vue) | 27.6 KB | | [@​sentry/vue](https://github.com/sentry/vue) (incl. Tracing) | 37.74 KB | | [@​sentry/svelte](https://github.com/sentry/svelte) | 23.49 KB | | CDN Bundle | 24.52 KB | | CDN Bundle (incl. Tracing) | 37.59 KB | | CDN Bundle (incl. Tracing, Replay) | 72.87 KB | | CDN Bundle (incl. Tracing, Replay, Feedback) | 78.24 KB | | CDN Bundle - uncompressed | 72.01 KB | | CDN Bundle (incl. Tracing) - uncompressed | 111.51 KB | | CDN Bundle (incl. Tracing, Replay) - uncompressed | 225.76 KB | | CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed | 238.86 KB | | [@​sentry/nextjs](https://github.com/sentry/nextjs) (client) | 38.96 KB | | [@​sentry/sveltekit](https://github.com/sentry/sveltekit) (client) | 36.39 KB | | [@​sentry/node](https://github.com/sentry/node) | 162.87 KB | | [@​sentry/node](https://github.com/sentry/node) - without tracing | 99.18 KB | | [@​sentry/aws-serverless](https://github.com/sentry/aws-serverless) | 126.69 KB | </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMzguMiIsInVwZGF0ZWRJblZlciI6IjM5LjEzOC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=--> Reviewed-on: https://git.tristess.app/alexandresoro/ouca-web/pulls/63 Reviewed-by: Alexandre Soro <[email protected]> Co-authored-by: renovate <[email protected]> Co-committed-by: renovate <[email protected]>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@sentry/node](https://github.com/getsentry/sentry-javascript/tree/master/packages/node) ([source](https://github.com/getsentry/sentry-javascript)) | dependencies | minor | [`8.51.0` -> `8.52.0`](https://renovatebot.com/diffs/npm/@sentry%2fnode/8.51.0/8.52.0) | --- ### Release Notes <details> <summary>getsentry/sentry-javascript (@​sentry/node)</summary> ### [`v8.52.0`](https://github.com/getsentry/sentry-javascript/releases/tag/8.52.0) [Compare Source](getsentry/sentry-javascript@8.51.0...8.52.0) ##### Important Changes - **feat(solidstart): Add `withSentry` wrapper for SolidStart config ([#​15135](getsentry/sentry-javascript#15135 To enable the SolidStart SDK, wrap your SolidStart Config with `withSentry`. The `sentrySolidStartVite` plugin is now automatically added by `withSentry` and you can pass the Sentry build-time options like this: ```js import { defineConfig } from '@​solidjs/start/config'; import { withSentry } from '@​sentry/solidstart'; export default defineConfig( withSentry( { /* Your SolidStart config options... */ }, { // Options for setting up source maps org: process.env.SENTRY_ORG, project: process.env.SENTRY_PROJECT, authToken: process.env.SENTRY_AUTH_TOKEN, }, ), ); ``` With the `withSentry` wrapper, the Sentry server config should not be added to the `public` directory anymore. Add the Sentry server config in `src/instrument.server.ts`. Then, the server config will be placed inside the server build output as `instrument.server.mjs`. Now, there are two options to set up the SDK: 1. **(recommended)** Provide an `--import` CLI flag to the start command like this (path depends on your server setup): `node --import ./.output/server/instrument.server.mjs .output/server/index.mjs` 2. Add `autoInjectServerSentry: 'top-level-import'` and the Sentry config will be imported at the top of the server entry (comes with tracing limitations) ```js withSentry( { /* Your SolidStart config options... */ }, { // Optional: Install Sentry with a top-level import autoInjectServerSentry: 'top-level-import', }, ); ``` ##### Other Changes - feat(v8/core): Add client outcomes for breadcrumbs buffer ([#​15149](getsentry/sentry-javascript#15149)) - feat(v8/core): Improve error formatting in ZodErrors integration ([#​15155](getsentry/sentry-javascript#15155)) - fix(v8/bun): Ensure instrumentation of `Bun.serve` survives a server reload ([#​15157](getsentry/sentry-javascript#15157)) - fix(v8/core): Pass `module` into `loadModule` ([#​15139](getsentry/sentry-javascript#15139)) ([#​15166](getsentry/sentry-javascript#15166)) Work in this release was contributed by [@​jahands](https://github.com/jahands), [@​jrandolf](https://github.com/jrandolf), and [@​nathankleyn](https://github.com/nathankleyn). Thank you for your contributions! #### Bundle size 📦 | Path | Size | | ---------------------------------------------------------------- | ----------------- | | [@​sentry/browser](https://github.com/sentry/browser) | 23.32 KB | | [@​sentry/browser](https://github.com/sentry/browser) - with treeshaking flags | 23.2 KB | | [@​sentry/browser](https://github.com/sentry/browser) (incl. Tracing) | 35.88 KB | | [@​sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay) | 73.23 KB | | [@​sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay) - with treeshaking flags | 66.7 KB | | [@​sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay with Canvas) | 77.54 KB | | [@​sentry/browser](https://github.com/sentry/browser) (incl. Tracing, Replay, Feedback) | 89.47 KB | | [@​sentry/browser](https://github.com/sentry/browser) (incl. Feedback) | 39.53 KB | | [@​sentry/browser](https://github.com/sentry/browser) (incl. sendFeedback) | 27.94 KB | | [@​sentry/browser](https://github.com/sentry/browser) (incl. FeedbackAsync) | 32.73 KB | | [@​sentry/react](https://github.com/sentry/react) | 26 KB | | [@​sentry/react](https://github.com/sentry/react) (incl. Tracing) | 38.71 KB | | [@​sentry/vue](https://github.com/sentry/vue) | 27.6 KB | | [@​sentry/vue](https://github.com/sentry/vue) (incl. Tracing) | 37.74 KB | | [@​sentry/svelte](https://github.com/sentry/svelte) | 23.49 KB | | CDN Bundle | 24.52 KB | | CDN Bundle (incl. Tracing) | 37.59 KB | | CDN Bundle (incl. Tracing, Replay) | 72.87 KB | | CDN Bundle (incl. Tracing, Replay, Feedback) | 78.24 KB | | CDN Bundle - uncompressed | 72.01 KB | | CDN Bundle (incl. Tracing) - uncompressed | 111.51 KB | | CDN Bundle (incl. Tracing, Replay) - uncompressed | 225.76 KB | | CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed | 238.86 KB | | [@​sentry/nextjs](https://github.com/sentry/nextjs) (client) | 38.96 KB | | [@​sentry/sveltekit](https://github.com/sentry/sveltekit) (client) | 36.39 KB | | [@​sentry/node](https://github.com/sentry/node) | 162.87 KB | | [@​sentry/node](https://github.com/sentry/node) - without tracing | 99.18 KB | | [@​sentry/aws-serverless](https://github.com/sentry/aws-serverless) | 126.69 KB | </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMzguMiIsInVwZGF0ZWRJblZlciI6IjM5LjEzOC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=--> Reviewed-on: https://git.tristess.app/alexandresoro/ouca-backend/pulls/509 Reviewed-by: Alexandre Soro <[email protected]> Co-authored-by: renovate <[email protected]> Co-committed-by: renovate <[email protected]>
Backport of #14862 and #14863