From bd4b036fe4e8e7938c4edbef64b03c45140d0f74 Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Thu, 23 Jan 2025 09:41:17 +0100 Subject: [PATCH 1/4] feat(solidstart)!: No longer export `sentrySolidStartVite` --- docs/migration/v8-to-v9.md | 4 ++++ packages/solidstart/src/index.server.ts | 1 - packages/solidstart/src/index.types.ts | 1 - packages/solidstart/src/vite/index.ts | 1 - 4 files changed, 4 insertions(+), 3 deletions(-) delete mode 100644 packages/solidstart/src/vite/index.ts diff --git a/docs/migration/v8-to-v9.md b/docs/migration/v8-to-v9.md index a6bd0aa35e7c..fdb30348111c 100644 --- a/docs/migration/v8-to-v9.md +++ b/docs/migration/v8-to-v9.md @@ -234,6 +234,10 @@ Sentry.init({ - The `addNormalizedRequestDataToEvent` method has been removed. Use `httpRequestToRequestData` instead and put the resulting object directly on `event.request`. - A `sampleRand` field on `PropagationContext` is now required. This is relevant if you used `scope.setPropagationContext(...)` +### `@sentry/solidstart` + +- The `sentrySolidStartVite` plugin is no longer exported. Instead, wrap the SolidStart config with `withSentry` and provide Sentry options as the second parameter. + #### Other/Internal Changes The following changes are unlikely to affect users of the SDK. They are listed here only for completion sake, and to alert users that may be relying on internal behavior. diff --git a/packages/solidstart/src/index.server.ts b/packages/solidstart/src/index.server.ts index a20a0367f557..82b6fe6cbff4 100644 --- a/packages/solidstart/src/index.server.ts +++ b/packages/solidstart/src/index.server.ts @@ -1,3 +1,2 @@ export * from './server'; -export * from './vite'; export * from './config'; diff --git a/packages/solidstart/src/index.types.ts b/packages/solidstart/src/index.types.ts index 39f9831c543c..54a5ec6d6a3c 100644 --- a/packages/solidstart/src/index.types.ts +++ b/packages/solidstart/src/index.types.ts @@ -3,7 +3,6 @@ // exports in this file - which we do below. export * from './client'; export * from './server'; -export * from './vite'; export * from './config'; import type { Client, Integration, Options, StackParser } from '@sentry/core'; diff --git a/packages/solidstart/src/vite/index.ts b/packages/solidstart/src/vite/index.ts deleted file mode 100644 index 464bbd604fbe..000000000000 --- a/packages/solidstart/src/vite/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './sentrySolidStartVite'; From 7729ddc25846c0ed3d173a26f0e686814033f1d8 Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Thu, 23 Jan 2025 09:59:39 +0100 Subject: [PATCH 2/4] fix import --- packages/solidstart/src/config/withSentry.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/solidstart/src/config/withSentry.ts b/packages/solidstart/src/config/withSentry.ts index c1050f0da1cc..aa045ade00ab 100644 --- a/packages/solidstart/src/config/withSentry.ts +++ b/packages/solidstart/src/config/withSentry.ts @@ -1,6 +1,6 @@ import { logger } from '@sentry/core'; import type { Nitro } from 'nitropack'; -import { addSentryPluginToVite } from '../vite'; +import { addSentryPluginToVite } from '../vite/sentrySolidStartVite'; import type { SentrySolidStartPluginOptions } from '../vite/types'; import { addDynamicImportEntryFileWrapper, From e3d9e028c32527da72fdfe9ab6c3cf9285ad451b Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Thu, 23 Jan 2025 13:21:41 +0100 Subject: [PATCH 3/4] improve changelog entry with example --- docs/migration/v8-to-v9.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/migration/v8-to-v9.md b/docs/migration/v8-to-v9.md index fdb30348111c..e279fb0ebc86 100644 --- a/docs/migration/v8-to-v9.md +++ b/docs/migration/v8-to-v9.md @@ -236,7 +236,19 @@ Sentry.init({ ### `@sentry/solidstart` -- The `sentrySolidStartVite` plugin is no longer exported. Instead, wrap the SolidStart config with `withSentry` and provide Sentry options as the second parameter. +- The `sentrySolidStartVite` plugin is no longer exported. Instead, wrap the SolidStart config with `withSentry` and + provide Sentry options as the second parameter. + + ``` + // app.config.ts + import { defineConfig } from '@solidjs/start/config'; + import { withSentry } from '@sentry/solidstart'; + + export default defineConfig(withSentry( + { /* SolidStart config */ }, + { /* Sentry build-time config (like project and org) */ }) + ); + ``` #### Other/Internal Changes From a522c4193b5ee9b1668158fe67ba1628a23d961c Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Thu, 23 Jan 2025 13:23:01 +0100 Subject: [PATCH 4/4] remove not relevant changelog entry --- CHANGELOG.md | 44 -------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcbfecab7da4..10de3a8c8ca5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,50 +12,6 @@ Work in this release was contributed by @tjhiggins, @GrizliK1988, @davidturissini, @nwalters512, @aloisklink, @arturovt, @benjick, @maximepvrt, @mstrokin, and @kunal-511. Thank you for your contributions! -- **feat(solidstart)!: Default to `--import` setup and add `autoInjectServerSentry` ([#14862](https://github.com/getsentry/sentry-javascript/pull/14862))** - -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', - }, - ); - ``` - ## 9.0.0-alpha.0 This is an alpha release of the upcoming major release of version 9.